/* ISSUE 9 FIX: Improved Color Contrast for Better Visibility */

/* Enhanced contrast for muted text - replace low-contrast gray with darker alternatives */
.text-muted-enhanced {
    color: #495057 !important; /* Darker gray instead of Bootstrap's #6c757d */
}

/* Better contrast for secondary text */
.text-secondary-enhanced {
    color: #343a40 !important; /* Much darker than Bootstrap's text-secondary */
}

/* High contrast alternatives for critical UI elements */
.high-contrast-label {
    color: #212529 !important;
    font-weight: 500;
}

/* Enhanced button contrast */
.btn-outline-primary {
    border-color: #0056b3 !important;
    color: #0056b3 !important;
}

.btn-outline-primary:hover {
    background-color: #0056b3 !important;
    border-color: #004085 !important;
}

.btn-outline-secondary {
    border-color: #495057 !important;
    color: #495057 !important;
}

.btn-outline-secondary:hover {
    background-color: #495057 !important;
    border-color: #343a40 !important;
}

/* Enhanced contrast for small text elements */
.small.text-muted,
.text-muted.small {
    color: #495057 !important;
    font-weight: 400;
}

/* Better visibility for timer and status elements */
#ctlTimer {
    color: #212529 !important;
    background-color: #e9ecef !important;
    border: 1px solid #ced4da !important;
}

/* Enhanced contrast for form labels and inputs */
.form-label {
    color: #212529 !important;
    font-weight: 500;
}

/* Better contrast for question preview text */
.question-preview {
    color: #212529 !important;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    border-radius: 0.375rem;
}

/* Enhanced buzzer status visibility */
#buzzer-status {
    color: #495057 !important;
    font-weight: 500;
}

/* Improved visibility for URLs and connection info */
#localURL, #lanURL {
    color: #495057 !important;
    font-weight: 500;
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

/* Better contrast for session labels */
#sessionNameLabel {
    color: #495057 !important;
    font-weight: 500;
}

/* Enhanced visibility for player choice buttons */
.choice {
    border-width: 2px !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* Make answer text more prominent - larger and bolder */
.choice, 
#choices button,
.multi-tap-choice,
.numeric-calculator button,
.letter-grid button,
.btn-group .btn {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
    line-height: 1.3 !important;
}

/* Extra emphasis for single letter/number choices */
.choice:has-text(1), 
.choice:has-text(2),
.choice:has-text(3),
.choice:has-text(4),
.choice:has-text(5),
.choice:has-text(6),
.choice:has-text(7),
.choice:has-text(8),
.choice:has-text(9),
.choice:has-text(0),
button[data-choice="A"],
button[data-choice="B"], 
button[data-choice="C"],
button[data-choice="D"],
button[data-choice="E"],
button[data-choice="F"] {
    font-size: 1.6rem !important;
    font-weight: 800 !important;
}

.choice:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
    border-color: #86b7fe !important;
}

/* ===== MCQ ENHANCED STYLING FOR UP TO 6 OPTIONS ===== */
/* MCQ container ensures single-column vertical layout */
#choices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 800px;
    margin: 0 auto;
}

/* MCQ option buttons - large tiles for easy tapping */
#choices .choice[data-choice] {
    width: 100%;
    min-height: 75px;
    transition: all 0.2s ease;
    border-width: 2px !important;
    font-size: 1.1rem !important;
    display: flex;
    align-items: center;
    text-align: left;
    padding: 1rem 1.25rem !important;
    position: relative;
}

#choices .choice[data-choice]:hover:not(.selected):not(:disabled) {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: rgba(13, 110, 253, 0.05);
}

#choices .choice[data-choice].selected,
#choices .choice[data-choice].btn-primary {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Option letter badge styling */
.option-letter {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    margin-right: 1rem;
    flex-shrink: 0;
    text-shadow: none !important;
}

#choices .choice[data-choice].selected .option-letter,
#choices .choice[data-choice].btn-primary .option-letter {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.option-text {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    flex: 1;
}

/* True/False big-button styling */
.tf-btn {
    width: 100%;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 1.8rem;
    font-weight: 700;
    border-radius: 16px;
    border: 3px solid;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.tf-btn:active {
    transform: scale(0.97);
}

.tf-btn-true {
    background: linear-gradient(135deg, #1a7a3a 0%, #28a745 100%);
    border-color: #1a7a3a;
    color: #fff;
}

.tf-btn-true:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.5);
}

.tf-btn-false {
    background: linear-gradient(135deg, #a52834 0%, #dc3545 100%);
    border-color: #a52834;
    color: #fff;
}

.tf-btn-false:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.5);
}

.tf-icon {
    font-size: 2.4rem;
    line-height: 1;
}

.tf-label {
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tf-btn.is-selected {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6), 0 6px 24px rgba(0,0,0,0.3);
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .tf-btn {
        min-height: 85px;
    }
    .tf-icon {
        font-size: 2rem;
    }
    .tf-label {
        font-size: 1.5rem;
    }
}

/* New UI: True/False tile styling */
.tf-tile.tf-new-true {
    background: linear-gradient(135deg, #1a7a3a 0%, #28a745 100%) !important;
    border-color: #1a7a3a !important;
    color: #fff !important;
}
.tf-tile.tf-new-false {
    background: linear-gradient(135deg, #a52834 0%, #dc3545 100%) !important;
    border-color: #a52834 !important;
    color: #fff !important;
}
.tf-tile.selected {
    box-shadow: 0 0 0 4px rgba(255,255,255,0.6), 0 6px 24px rgba(0,0,0,0.3);
    transform: scale(1.03);
}

/* Adjust sizing for 5-6 options to prevent overflow */
#choices:has(> :nth-child(5)) .choice[data-choice] {
    min-height: 70px;
    padding: 0.875rem 1.25rem !important;
}

#choices:has(> :nth-child(6)) .choice[data-choice] {
    min-height: 65px;
    padding: 0.75rem 1rem !important;
}

#choices:has(> :nth-child(6)) .option-letter {
    width: 45px;
    height: 45px;
    font-size: 1.3rem !important;
}

#choices:has(> :nth-child(6)) .option-text {
    font-size: 1.1rem !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #choices .choice[data-choice] {
        min-height: 70px;
        padding: 0.875rem 1rem !important;
    }
    
    .option-text {
        font-size: 1.1rem !important;
    }
    
    .option-letter {
        width: 45px;
        height: 45px;
        font-size: 1.3rem !important;
        margin-right: 0.75rem;
    }
    
    #choices:has(> :nth-child(5)) .choice[data-choice] {
        min-height: 65px;
        padding: 0.75rem 0.875rem !important;
    }
    
    #choices:has(> :nth-child(6)) .choice[data-choice] {
        min-height: 60px;
        padding: 0.65rem 0.875rem !important;
    }
    
    #choices:has(> :nth-child(6)) .option-letter {
        width: 40px;
        height: 40px;
        font-size: 1.2rem !important;
    }
    
    #choices:has(> :nth-child(6)) .option-text {
        font-size: 1rem !important;
    }
}
/* ===== END MCQ ENHANCED STYLING ===== */

/* Better contrast for answer feedback */
.alert {
    border-width: 2px !important;
}

.alert-info {
    color: #055160 !important;
    background-color: #d1ecf1 !important;
    border-color: #b6d4fe !important;
}

.alert-success {
    color: #0a3622 !important;
    background-color: #d1e7dd !important;
    border-color: #a3cfbb !important;
}

.alert-danger {
    color: #58151c !important;
    background-color: #f8d7da !important;
    border-color: #f1aeb5 !important;
}

.alert-warning {
    color: #664d03 !important;
    background-color: #fff3cd !important;
    border-color: #ffda6a !important;
}

/* Enhanced table contrast */
.table-warning {
    background-color: #fff3cd !important;
    color: #664d03 !important;
    border-color: #ffda6a !important;
}

/* Better visibility for fastest player announcements */
#fastest-announcement {
    background-color: rgba(255, 193, 7, 0.15) !important;
    border: 2px solid #ffc107 !important;
    color: #664d03 !important;
}

/* Improved contrast for diagnostic text */
.diagnostic-entry {
    color: #212529 !important;
    background-color: #f8f9fa;
    border-left: 3px solid #dee2e6;
    padding: 0.5rem;
    margin: 0.25rem 0;
}

@keyframes fastestGlow {
    0% { box-shadow: 0 0 16px 4px #ffd700, 0 4px 8px rgba(0,0,0,0.3); }
    100% { box-shadow: 0 0 32px 12px #ffd700, 0 4px 8px rgba(0,0,0,0.3); }
}

@keyframes fastestPopupIn {
    0% { opacity: 0; transform: translate(-50%, -40px) scale(0.95); }
    100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes fastestFullScreen {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}
/* Enhanced Host Soundboard Styles */
.sound-categories {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sound-category {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
}

.sound-category h6 {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 5px;
}

.sound-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sound-button {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

.sound-button:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.sound-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

.sound-button.game-sound {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    box-shadow: 0 2px 4px rgba(40,167,69,0.2);
}

.sound-button.game-sound:hover {
    background: linear-gradient(135deg, #1e7e34, #155724);
    box-shadow: 0 4px 8px rgba(40,167,69,0.3);
}

.sound-button.reaction-sound {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    box-shadow: 0 2px 4px rgba(255,193,7,0.2);
    color: #212529;
}

.sound-button.reaction-sound:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    box-shadow: 0 4px 8px rgba(255,193,7,0.3);
}

.sound-button.effect-sound {
    background: linear-gradient(135deg, #6f42c1, #59359a);
    box-shadow: 0 2px 4px rgba(111,66,193,0.2);
}

.sound-button.effect-sound:hover {
    background: linear-gradient(135deg, #59359a, #4c2a85);
    box-shadow: 0 4px 8px rgba(111,66,193,0.3);
}

/* Add or update these styles */
.question-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.question-item:hover {
    background-color: #f0f0f0;
}

/* Animation for new answers in the log */
.new-answer {
    animation: slideIn 0.3s ease-out;
    background-color: rgba(40, 167, 69, 0.1);
}

/* Animation for updated answers in the log (multi-tap real-time updates) */
.updated-answer {
    animation: pulseUpdate 0.5s ease-out;
    background-color: rgba(0, 123, 255, 0.15);
    border-left: 3px solid #007bff;
}

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

@keyframes pulseUpdate {
    0% {
        background-color: rgba(0, 123, 255, 0.3);
        transform: scale(1.02);
    }
    50% {
        background-color: rgba(0, 123, 255, 0.2);
        transform: scale(1.01);
    }
    100% {
        background-color: rgba(0, 123, 255, 0.15);
        transform: scale(1);
    }
}

/* Mobile-friendly styles for input controls */
@media (max-width: 768px) {
    #numeric-keypad button {
        font-size: 1.5rem;
        padding: 1.2rem;
        height: 60px;
        min-height: 60px;
        border-radius: 8px;
        margin: 2px;
    }
    
    #letter-input input {
        font-size: 1.4rem;
        padding: 1rem;
        height: 60px;
    }
    
    #letter-input button {
        font-size: 1.3rem;
        padding: 1rem;
        height: 60px;
    }
    
    .btn-group {
        display: flex;
        flex-wrap: wrap;
    }
    
    /* MCQ Buttons */
    #choices button {
        font-size: 1.4rem !important;
        font-weight: 700 !important;
        padding: 1rem 0.8rem;
        margin: 0.3rem 0;
        min-height: 60px;
        text-align: left;
        border-radius: 8px;
        text-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
    }
    
    /* Letter pad grid for mobile */
    .letter-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin: 1rem 0;
    }
    
    .letter-grid button {
        font-size: 1.8rem !important;
        font-weight: 800 !important;
        padding: 1.2rem;
        height: 60px;
        border-radius: 8px;
        text-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    }
}

/* Calculator-style numeric keypad */
.numeric-calculator {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 300px;
    margin: 0 auto;
}

.numeric-calculator button {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    padding: 1.2rem;
    height: 70px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    transition: all 0.2s;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

.numeric-calculator button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.numeric-calculator .btn-outline-primary {
    background-color: #f8f9fa;
    border-color: #0d6efd;
    color: #0d6efd;
}

.numeric-calculator .btn-outline-danger {
    background-color: #f8f9fa;
    border-color: #dc3545;
    color: #dc3545;
}

.numeric-calculator .btn-success {
    background-color: #198754;
    border-color: #198754;
}

/* Additional mobile styles for button groups */
@media (max-width: 768px) {
    .btn-group > .btn {
        flex: 1 0 45%;
        margin: 0.25rem;
    }
}

.question-item.bg-primary {
    border-radius: 4px;
    padding: 8px !important;
    margin: 2px 0;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    background-color: #0d6efd !important;
    color: white !important;
}

.question-item.bg-light {
    background-color: #e9ecef !important;
    color: #212529 !important;
    border: 1px solid #ced4da;
}

/* Styling for the host control timer */
#ctlTimer.badge {
    font-size: 1.2rem;
    padding: 0.5rem 0.7rem;
}

/* Styles for the active control buttons */
.btn.active {
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    font-weight: bold;
}

/* Styling for the player's selected answer */
.choice[data-selected="true"] {
    font-weight: bold;
    border-width: 2px;
}

/* Buzz-in button animations - REMOVED pulse to prevent movement */

/* Buzz winner announcement animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Fastest Player Image Glow Animation */
@keyframes fastestGlow {
    0% {
        box-shadow: 0 4px 8px rgba(0,0,0,0.3), 0 0 0 0 rgba(255, 215, 0, 0.7);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 4px 8px rgba(0,0,0,0.3), 0 0 20px 5px rgba(255, 215, 0, 0.4);
        transform: scale(1.02);
    }
}

.fastest-player-image {
    animation: fastestGlow 1.5s ease-in-out infinite alternate;
}

/* Enhanced Fastest Player Display */
#dispFast {
    background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(33,37,41,0.9) 100%) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#dispFast h2 {
    background: rgba(0,0,0,0.7) !important;
    color: #ffd700 !important;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.9) !important;
    border: 2px solid #ffd700 !important;
    padding: 12px 25px !important;
    border-radius: 12px !important;
    display: inline-block !important;
    font-weight: bold !important;
    letter-spacing: 1px !important;
}

/* Pulse animation for text */
@keyframes fastestTextPulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

#dispFast h2 {
    animation: fastestTextPulse 2s ease-in-out infinite;
}

/* ENHANCED: Player Fastest Player Popup Styling */
#playerFast.modal-overlay {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.95) 0%,
        rgba(255, 165, 0, 0.95) 50%,
        rgba(255, 140, 0, 0.95) 100%) !important;
    /* backdrop-filter REMOVED 2026-07-07: it blurred a backdrop hidden behind this 95%-opaque
       gradient — invisible work in the same GPU-freeze class that shipped the Android wheel
       incident, on the exact frame the entrance + confetti start. Zero visual difference. */
    z-index: 9999;
}

.fastest-player-card {
    background: linear-gradient(145deg, #fff, #f8f9fa);
    border: 4px solid #ffd700;
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(255, 215, 0, 0.4),
        0 0 30px rgba(255, 215, 0, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
    padding: 30px;
    max-width: 400px;
    margin: auto;
    position: relative;
    animation: fastestCardPulse 2s ease-in-out infinite;
}

/* TRANSFORM-ONLY since 2026-07-07: this idle pulse used to animate box-shadow too, forcing a
   full repaint EVERY FRAME for the popup's whole lifetime on cheap phones. The static glow now
   comes from .fastest-player-card's own box-shadow; the pulse is compositor-only scale. */
@keyframes fastestCardPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* Reduced motion: the fastest popup keeps all its content (name, avatar, points) but drops
   the idle pulse; the JS side (fastest-popup.js / fast-track-popup.js) skips entrances,
   strobes, cheese rain and confetti under the same media query (2026-07-07). */
@media (prefers-reduced-motion: reduce) {
    .fastest-player-card { animation: none !important; }
}

.fastest-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff4500;
    text-shadow: 
        2px 2px 0 #ffd700,
        4px 4px 8px rgba(255, 69, 0, 0.3);
    margin-bottom: 20px;
    animation: fastestTitleGlow 1.5s ease-in-out infinite alternate;
}

@keyframes fastestTitleGlow {
    0% { 
        text-shadow: 
            2px 2px 0 #ffd700,
            4px 4px 8px rgba(255, 69, 0, 0.3);
    }
    100% { 
        text-shadow: 
            3px 3px 0 #ffd700,
            6px 6px 15px rgba(255, 69, 0, 0.6),
            0 0 20px rgba(255, 215, 0, 0.5);
    }
}

.fastest-img {
    width: 180px !important;
    height: 180px !important;
    border-radius: 50%;
    border: 6px solid #ffd700 !important;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.8),
        inset 0 2px 10px rgba(255, 255, 255, 0.3) !important;
    animation: fastestImgSpin 3s ease-in-out infinite;
    object-fit: cover;
}

@keyframes fastestImgSpin {
    0% { 
        transform: rotate(0deg) scale(1);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
    25% { 
        transform: rotate(5deg) scale(1.05);
        box-shadow: 0 0 40px rgba(255, 215, 0, 1);
    }
    50% { 
        transform: rotate(0deg) scale(1.1);
        box-shadow: 0 0 50px rgba(255, 215, 0, 1);
    }
    75% { 
        transform: rotate(-5deg) scale(1.05);
        box-shadow: 0 0 40px rgba(255, 215, 0, 1);
    }
    100% { 
        transform: rotate(0deg) scale(1);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
}

.fastest-team-name {
    font-size: 2.2rem;
    font-weight: 800;
    color: #2c3e50;
    text-shadow: 1px 1px 3px rgba(255, 215, 0, 0.6);
    margin: 20px 0;
    animation: fastestNamePulse 2.5s ease-in-out infinite;
}

@keyframes fastestNamePulse {
    0% { 
        transform: scale(1);
        color: #2c3e50;
    }
    50% { 
        transform: scale(1.05);
        color: #e74c3c;
    }
    100% { 
        transform: scale(1);
        color: #2c3e50;
    }
}

.fastest-dismiss {
    font-size: 1.1rem;
    font-weight: 600;
    color: #7f8c8d;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #bdc3c7;
    margin-top: 15px;
    animation: fastestDismissBounce 2s ease-in-out infinite;
}

@keyframes fastestDismissBounce {
    0%, 100% { 
        transform: translateY(0);
        background: rgba(255, 255, 255, 0.8);
    }
    50% { 
        transform: translateY(-3px);
        background: rgba(255, 255, 255, 0.9);
    }
}

/* ENHANCED: Correct Answer Blinking Effect */
@keyframes correctAnswerBlink {
    0% { 
        background-color: #28a745; 
        color: white; 
        transform: scale(1);
        box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    }
    50% { 
        background-color: #34ce57; 
        color: white;
        transform: scale(1.02);
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.8);
    }
    100% { 
        background-color: #28a745; 
        color: white;
        transform: scale(1);
        box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    }
}

/* DRAMATIC correct answer pulse - bright yellow flash to green */
@keyframes correctPulse {
    0% { 
        background-color: #28a745 !important;  /* Start green */
        color: white !important;
        border-color: #28a745 !important;
        transform: scale(1);
        box-shadow: 0 0 15px 8px rgba(40, 167, 69, 0.8);
    }
    25% {
        background-color: #ffc107 !important;  /* Flash BRIGHT YELLOW */
        color: black !important;
        border-color: #ffc107 !important;
        transform: scale(1.08);
        box-shadow: 0 0 40px 20px rgba(255, 193, 7, 1);
    }
    50% { 
        background-color: #28a745 !important;  /* Back to green */
        color: white !important;
        border-color: #28a745 !important;
        transform: scale(1.05);
        box-shadow: 0 0 30px 15px rgba(40, 167, 69, 0.9);
    }
    75% {
        background-color: #5dff5d !important;  /* Bright lime flash */
        color: black !important;
        border-color: #5dff5d !important;
        transform: scale(1.08);
        box-shadow: 0 0 40px 20px rgba(93, 255, 93, 0.9);
    }
    100% { 
        background-color: #28a745 !important;  /* End green */
        color: white !important;
        border-color: #28a745 !important;
        transform: scale(1);
        box-shadow: 0 0 15px 8px rgba(40, 167, 69, 0.8);
    }
}

/* CSS class to ensure animation applies (removes inline style specificity) */
.correct-answer-pulse {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
    animation: correctPulse 1.5s ease-in-out 3 !important;
}

/* Force child elements to inherit color during animation - overrides text-muted */
.correct-answer-pulse h3,
.correct-answer-pulse div {
    color: inherit !important;
}

/* Fast Track Epic Animations */
@keyframes fastTrackPulse {
    0% { 
        transform: scale(1); 
        text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
    }
    50% { 
        transform: scale(1.05); 
        text-shadow: 3px 3px 12px rgba(0,0,0,0.9), 0 0 20px rgba(255,255,255,0.3);
    }
    100% { 
        transform: scale(1); 
        text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
    }
}

@keyframes fastTrackGlow {
    0% {
        box-shadow: 0 4px 8px rgba(0,0,0,0.4), 0 0 0 0 rgba(255, 255, 255, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 16px rgba(0,0,0,0.6), 0 0 30px 10px rgba(255, 255, 255, 0.4);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 4px 8px rgba(0,0,0,0.4), 0 0 0 0 rgba(255, 255, 255, 0.8);
        transform: scale(1);
    }
}

.correct-answer-blink {
    animation: correctAnswerBlink 0.8s ease-in-out infinite !important;
    border: 2px solid #28a745 !important;
    font-weight: bold !important;
    background-color: #28a745 !important;
    color: white !important;
    transition: none !important;
}

/* Ensure animation works on buttons with class */
.btn.correct-answer-blink {
    animation: correctAnswerBlink 0.8s ease-in-out infinite !important;
    background-color: #28a745 !important;
    color: white !important;
    transition: none !important;
}


    /* Multi-tap tile selection feedback */
    .tile.selected {
        background-color: #007bff !important;
        color: white !important;
        border: 2px solid #0056b3 !important;
        box-shadow: 0 0 10px rgba(0, 123, 255, 0.5) !important;
        transform: scale(1.05);
        transition: all 0.3s ease;
    }
    
    .tile.selected::after {
        content: "✓";
        position: absolute;
        top: 5px;
        right: 8px;
        font-weight: bold;
        font-size: 16px;
    }

/* HOST DISPLAY LARGE QUESTION TEXT */
@media (min-width: 1200px) {
    #dispQ,
    div#dispQ,
    #dispQ.h4,
    #dispQ.h1,
    #dispQ.h2,
    #dispQ.h3,
    #dispQ.h5,
    #dispQ.h6,
    #dispQ > div,
    #dispQ div.h4,
    #dispQ div.h1,
    #dispQ div.h3,
    #dispQ div.h5,
    #dispQ div.h6 {
        font-size: 4.5rem !important;
        line-height: 1.2 !important;
    }
    
    /* Make set name and question number smaller and gray */
    #dispQ div.h2 {
        font-size: 1.5rem !important;
        color: #6c757d !important;
        line-height: 1.3 !important;
    }
    
    /* Make "Choose one answer:" text smaller */
    #dispQ div.small,
    #dispQ .small {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
    }
}

/* Question Image Popup Styles */
.image-popup-overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.image-popup-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 85%;
    text-align: center;
    animation: imagePopupIn 0.3s ease-out;
}

@keyframes imagePopupIn {
    0% { 
        opacity: 0; 
        transform: scale(0.8) translateY(-20px); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

.image-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.image-popup-close:hover,
.image-popup-close:focus {
    color: #000;
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.popup-image {
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    object-fit: contain;
}

/* Mobile responsive adjustments for image popup */
@media (max-width: 768px) {
    .image-popup-content {
        margin: 2% auto;
        padding: 15px;
        max-width: 95%;
        max-height: 90%;
    }
    
    .popup-image {
        max-height: 75vh;
    }
    
    .image-popup-close {
        top: 5px;
        right: 10px;
        font-size: 24px;
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 480px) {
    .image-popup-content {
        margin: 1% auto;
        padding: 10px;
        max-width: 98%;
        max-height: 95%;
    }
    
    .popup-image {
        max-height: 80vh;
    }
}

