/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Screen Management */
.screen {
    display: none !important;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.screen.active {
    display: block !important;
}

/* Override for join screen to maintain flexbox centering */
#join-screen.screen.active {
    display: flex !important;
}

/* Loading Screen */
#loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Join Screen */
#join-screen.active {
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    overflow: auto;
}

.container {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.form-card {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.status-card {
    background: #fefbf3;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 2px solid #fbbf24;
    text-align: center;
}

.status-card h3 {
    color: #92400e;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.status-card p {
    color: #78716c;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background-color: #d97706;
}

.btn-reset {
    background-color: #7c2d12;
    color: white;
    border: 1px solid #7c2d12;
}

.btn-reset:hover:not(:disabled) {
    background-color: #991b1b;
    border-color: #991b1b;
}

/* Guest Screen Layout (unified: waiting, quiz, results) */
.guest-layout {
    display: grid;
    grid-template-areas:
        "header header"
        "main sidebar";
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr 300px;
    height: 100vh;
    gap: 1rem;
    padding: 1rem;
}

.guest-header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-background);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.guest-main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guest-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    overflow: hidden;
    min-height: 0;
}

.content-section {
    flex: 1;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
}

.content-panel {
    display: block;
}

.waiting-card {
    text-align: center;
}

.waiting-card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.waiting-card p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.waiting-card ul {
    text-align: left;
    margin: 1rem auto;
    max-width: 300px;
    color: var(--text-secondary);
}

.waiting-card li {
    margin-bottom: 0.5rem;
}

.pulse-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    color: var(--primary-color);
    font-weight: 500;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.team-info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.team-info span {
    font-weight: 500;
}

#guest-team-score {
    color: var(--secondary-color);
}

/* Stream Section */
.stream-section {
    flex: 2;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

#youtube-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
}

/* Mobile Play Overlay - iOS live stream fix */
.mobile-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.mobile-play-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #000;
}

.mobile-play-button {
    position: relative;
    z-index: 11;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.mobile-play-overlay:hover .mobile-play-button,
.mobile-play-overlay:active .mobile-play-button {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.8);
}

.mobile-play-button svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.mobile-play-button span {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* YouTube fallback link for iOS when embed fails */
.youtube-fallback-link {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, transform 0.2s ease;
}

.youtube-fallback-link:hover,
.youtube-fallback-link:active {
    background: rgba(204, 0, 0, 1);
    transform: translateX(-50%) scale(1.05);
}

.youtube-fallback-link svg {
    flex-shrink: 0;
}

/* iOS Live Stream Notice */
.ios-stream-notice {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    text-align: center;
    z-index: 10;
}

.ios-notice-icon {
    color: #ff6b6b;
    margin-bottom: 12px;
    opacity: 0.9;
}

.ios-stream-notice h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.ios-stream-notice p {
    color: #a0aec0;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 16px 0;
    max-width: 280px;
}

.ios-youtube-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: #ff0000;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.ios-youtube-button:hover,
.ios-youtube-button:active {
    background: #cc0000;
    transform: scale(1.05);
}

.ios-notice-hint {
    color: #68d391 !important;
    font-size: 13px !important;
    font-weight: 500;
    margin-top: 8px !important;
}

.ios-hide-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #a0aec0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ios-hide-video-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Watching elsewhere button - desktop */
.watching-elsewhere-btn {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s ease;
}

.watching-elsewhere-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Watching elsewhere link on mobile overlay */
.overlay-watch-elsewhere {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    z-index: 15;
    transition: all 0.2s ease;
}

.overlay-watch-elsewhere:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Video hidden state */
.stream-section.video-hidden {
    flex: 0 !important;
    min-height: 50px !important;
    height: 50px !important;
    overflow: hidden;
}

.stream-section.video-hidden #youtube-container {
    display: none !important;
}

/* Collapsed bar when video is hidden */
.video-collapsed-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #a0aec0;
    font-size: 14px;
    height: 100%;
}

.video-collapsed-bar span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-collapsed-bar span::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #68d391;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.show-video-btn {
    padding: 6px 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.show-video-btn:hover {
    background: var(--primary-dark);
}

/* Enhanced countdown background for content area */
.content-section.countdown-active {
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    border: 2px solid var(--warning-color);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
    animation: pulse-question-area 2s infinite;
}

@keyframes pulse-question-area {
    0%, 100% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
    }
}

.waiting-card {
    text-align: center;
    padding: 2rem;
}

.waiting-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.question-card {
    animation: slideIn 0.3s ease-out;
}

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

.question-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#question-text {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    line-height: 1.5;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Default 2x2 for desktop */
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Multiple choice grid - responsive layout */
.question-options-grid.multiple-choice {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* 2x2 grid on desktop */
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
}

.option-button {
    padding: 1.25rem 1.5rem;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    min-height: 60px; /* Ensure 44px+ touch target */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.option-button:hover:not(.disabled):not(.selected) {
    border-color: var(--primary-color);
    background-color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.option-button.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.option-button.selected::after {
    content: '✓';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    font-weight: bold;
}

.option-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}



/* Question Bottom Controls Layout */
.question-bottom {
    margin-top: 1.5rem;
}

.question-bottom #confirm-answer-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 60px; /* Ensure consistent height for layout stability */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Countdown states for the confirm button */
#confirm-answer-btn.countdown-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    animation: pulse-warning 1s infinite;
}

#confirm-answer-btn.countdown-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    animation: pulse-danger 1s infinite;
}

@keyframes pulse-warning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes pulse-danger {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

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

/* Answer Feedback */
.answer-feedback {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

.answer-feedback.correct {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid var(--secondary-color);
}

.answer-feedback.incorrect {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid var(--danger-color);
}

.answer-feedback.submitted {
    background: #f0f9ff;
    color: #0c4a6e;
    border: 2px solid var(--primary-color);
}

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

/* Chat Section */
.chat-section {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    flex: 1; /* Take up full sidebar space when leaderboard is hidden */
    min-height: 0;
    overflow: hidden;
}

.chat-header, .chat-monitor-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chat-header h4, .chat-monitor-header h3 {
    margin-bottom: 0.5rem;
}

.chat-tabs {
    display: flex;
    gap: 0.5rem;
}

.chat-tab {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.chat-tab:hover:not(.active) {
    border-color: var(--primary-color);
    background: #f8fafc;
}

.chat-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.chat-tab.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary-color);
}

.tab-icon {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-message {
    padding: 0.5rem;
    border-radius: 6px;
    background: #f1f5f9;
    font-size: 0.9rem;
}

.chat-message.private {
    background: #fef3c7;
    border-left: 3px solid var(--warning-color);
}

.chat-message .sender {
    font-weight: 600;
    color: var(--primary-color);
}

.delete-message-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem;
    border-radius: 3px;
    float: right;
    margin-left: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.delete-message-btn:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.1);
}

.admin-chat-message .delete-message-btn {
    display: inline-block;
}

.chat-message .delete-message-btn {
    display: none; /* Hide delete buttons for regular users */
}

.chat-form {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    gap: 0.5rem;
}

.chat-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.chat-form button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Leaderboard */
.leaderboard-section {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.leaderboard-section h4 {
    margin-bottom: 1rem;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.leaderboard-item.current-team {
    background: var(--primary-color);
    color: white;
}

.team-rank {
    font-weight: 600;
}

.team-score {
    color: var(--secondary-color);
}

.leaderboard-item.current-team .team-score {
    color: #bfdbfe;
}

/* Host Screen */
.host-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1rem;
    gap: 1rem;
}

.host-header {
    background: var(--card-background);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.host-stats {
    display: flex;
    gap: 2rem;
    font-weight: 500;
}

.host-quick-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.host-main {
    flex: 1;
    display: grid;
    grid-template-areas: 
        "question-control teams-scores chat";
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 1rem;
    min-height: 0;
}

/* Enhanced Question Control Panel */
.question-control-panel {
    grid-area: question-control;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-control-panel.quiz-not-active .question-control-content {
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}

.question-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.question-control-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.current-question-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.current-question-info span:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.question-control-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.question-selection {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.question-selection select {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

.question-selection select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.current-question-display {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

.question-text h4 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.question-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.host-option {
    padding: 0.75rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    position: relative;
}

.host-option.correct {
    border-color: var(--secondary-color);
    background: #d1fae5;
}

.host-option.number-answer {
    max-width: 300px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
}

.host-option .option-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.countdown-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
}

.countdown-settings {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.9rem;
}

.countdown-settings label {
    font-weight: 500;
}

.countdown-settings select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
}

/* Answer Counter Styles */
.answer-counter {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f0f9ff;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-weight: 500;
    color: var(--primary-color);
    animation: pulse-counter 2s infinite;
}

@keyframes pulse-counter {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Combined Teams & Scores Panel */
.teams-scores-panel {
    grid-area: teams-scores;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.teams-scores-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.teams-scores-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.panel-tabs {
    display: flex;
    gap: 0.5rem;
}

.panel-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.panel-tab:hover {
    background: #f8fafc;
    color: var(--text-primary);
}

.panel-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.teams-scores-content {
    flex: 1;
    min-height: 0;
    position: relative;
}

.tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: 1rem;
}

.tab-content.active {
    display: block;
}

.teams-list,
.scores-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.team-item,
.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.team-name,
.score-team-name {
    font-weight: 600;
    color: var(--text-primary);
}

.team-status,
.score-points {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.score-item {
    position: relative;
}

.score-rank {
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.score-rank.top-3 {
    background: var(--secondary-color);
}

.score-rank.first {
    background: #fbbf24;
}

/* Chat Monitor Panel */
.chat-monitor-panel {
    grid-area: chat;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-monitor-panel h3 {
    margin: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.admin-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-chat-message {
    padding: 0.5rem;
    border-radius: 6px;
    background: #f1f5f9;
    font-size: 0.9rem;
}

.admin-chat-message.private {
    background: #fef3c7;
    border-left: 3px solid var(--warning-color);
}

.admin-chat-message .sender {
    font-weight: 600;
    color: var(--primary-color);
}

/* Thread-based Private Chat Styles */
.admin-chat-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.thread-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.no-threads-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.no-threads-message .subtext {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

.thread-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.thread-item:hover {
    background: #e2e8f0;
    border-color: var(--primary-color);
}

.thread-item.has-unread {
    border-left: 3px solid var(--warning-color);
    background: #fef3c7;
}

.thread-team-name {
    font-weight: 600;
    color: var(--text-primary);
}

.thread-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.thread-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.thread-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.thread-count {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.active-thread {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.thread-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.thread-header #active-thread-team-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    background: #fafafa;
}

.thread-message {
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    max-width: 85%;
}

.thread-message.from-team {
    background: #fff;
    border: 1px solid var(--border-color);
    margin-right: auto;
}

.thread-message.from-host {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
}

.thread-message .sender {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.thread-message.from-team .sender {
    color: var(--primary-color);
}

.thread-message.from-host .sender {
    color: rgba(255, 255, 255, 0.8);
}

.thread-message .content {
    font-size: 0.95rem;
}

.thread-message .time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    text-align: right;
}

#thread-reply-form {
    border-top: 1px solid var(--border-color);
}

/* Linear Quiz Progress Styles */
.quiz-progress-info {
    display: flex;
    gap: 2rem;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.progress-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

.quiz-progress-info span:last-child {
    font-weight: 600;
    color: var(--primary-color);
}

/* Linear Navigation Controls */
.linear-navigation {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.linear-navigation .btn {
    flex: 1;
    max-width: 180px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* Standardise host control buttons */
.host-quick-controls .btn {
    min-height: 44px;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
}

#reveal-question-btn,
#start-countdown-btn {
    min-height: 44px;
    font-weight: 500;
}

.quick-jump {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.quick-jump label {
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.quick-jump select {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Question Meta Information */
.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.status-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-indicator.not-revealed {
    background: #fee2e2;
    color: #991b1b;
}

.status-indicator.revealed {
    background: #dbeafe;
    color: #1e40af;
}

.status-indicator.active {
    background: #dcfce7;
    color: #166534;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Countdown Status */
.countdown-status {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--warning-color);
    color: white;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    animation: pulse-countdown 1s infinite;
}

@keyframes pulse-countdown {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Admin Screen (keep existing styles for admin interface) */
.admin-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1rem;
    gap: 1rem;
}

.admin-header {
    background: var(--card-background);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-stats {
    display: flex;
    gap: 2rem;
    font-weight: 500;
}

.admin-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-controls {
    background: var(--card-background);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.registration-controls,
.quiz-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.question-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

.question-controls .countdown-timer {
    flex: 1;
    margin: 0;
}

.question-controls #confirm-answer-btn {
    flex-shrink: 0;
    min-width: 140px;
}

.question-controls select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 200px;
}

.admin-panels {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.panel {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.panel h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.teams-panel,
.scores-panel {
    max-height: 400px;
    overflow-y: auto;
}

/* Admin Interface Styles */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-weight: 500;
    transition: all 0.2s ease;
}

.admin-tab:hover {
    background: #f8fafc;
    color: var(--text-primary);
}

.admin-tab.active {
    background: var(--primary-color);
    color: white;
}

.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.questions-grid,
.users-grid {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.questions-list,
.users-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-item,
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.question-info,
.user-info {
    flex: 1;
}

.question-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.question-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.system-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.control-group {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.control-group h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.setting-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.setting-item label {
    font-weight: 500;
    min-width: 200px;
}

.setting-item input {
    flex: 1;
    min-width: 300px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.2s ease;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Error Messages */
.error-message {
    color: var(--danger-color);
    background: #fee2e2;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-weight: 500;
    display: none;
}

.error-message.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Notifications */
.notifications {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification {
    background: var(--card-background);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    max-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    border-left-color: var(--secondary-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.confirmation-input {
    margin-top: 1.5rem;
}

.confirmation-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.confirmation-input input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.confirmation-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

/* Authentication Modal Styles */
.auth-input-group {
    margin-top: 1.5rem;
}

.auth-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.auth-input-group input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.auth-input-group input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-error-message {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: var(--danger-color);
    font-size: 0.9rem;
}

#auth-modal .modal-header h3 {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .guest-layout {
        grid-template-areas: 
            "header"
            "main"
            "sidebar";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
        min-height: 100vh;
    }
    
    .guest-sidebar {
        flex-direction: row;
        gap: 1rem;
        overflow: visible;
        height: auto;
    }
    
    .stream-section {
        min-height: 200px;
        max-height: 40vh;
    }
    
    .chat-section {
        height: 350px;
        min-height: 350px;
        flex: none;
    }
    
    /* Leaderboard hidden for guests */
    .leaderboard-section {
        display: none;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mobile: Single column for touch-friendly multiple choice */
    .question-options-grid.multiple-choice {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Host layout responsive */
    .host-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .host-quick-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .host-main {
        grid-template-areas: 
            "question-control"
            "teams-scores"
            "chat";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .question-options {
        grid-template-columns: 1fr;
    }
    
    .countdown-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .question-selection {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* Admin controls responsive */
    .admin-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Answer Confirmation */
.answer-confirmation {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

/* Answer Waiting Indicator - REMOVED: Now integrated into button */

/* Submitted Question Card Styling */
.question-card.answer-submitted {
    border: 3px solid var(--warning-color);
    background: linear-gradient(135deg, #fefbf3, #fef3c7);
    border-radius: 12px;
}

/* Locked Answer Button */
.btn.answer-locked {
    pointer-events: none;
    font-weight: 600;
    border-radius: 8px;
}

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

.confirmation-content p {
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.confirmation-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirmation-buttons .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: 1px solid #6b7280;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
    border-color: #4b5563;
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .guest-layout {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .guest-sidebar {
        flex-direction: column;
    }
    
    .confirmation-buttons {
        flex-direction: column;
    }
    
    .confirmation-buttons .btn {
        padding: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* New Question Type Styles */

/* Image Multiple Choice */
.question-options-grid.image-multiple-choice {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.option-button.image-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 200px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-background);
    transition: all 0.2s ease;
}

.option-button.image-option img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    border-radius: 4px;
}

.option-button.image-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.option-button.image-option.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Number Question Styles */
.question-options-grid.number-question {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.number-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 100%;
}

.number-input-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.number-input {
    width: 100%;
    max-width: 250px;
    padding: 0.75rem 1rem;
    font-size: 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    transition: border-color 0.2s ease;
}

.number-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* True/False Question Styles */
.question-options-grid.true-false {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.true-false-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    min-height: 120px;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.true-button {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.false-button {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.true-false-button:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.true-false-button.selected {
    transform: translateY(-2px);
    font-weight: 800;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    position: relative;
}

.true-false-button.selected::after {
    content: '✓';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.5rem;
    font-weight: 900;
    color: inherit;
    text-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.true-button.selected {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4);
}

.false-button.selected {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.4);
}

.true-false-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Question Type Indicators */
.question-type-indicator {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
}

.question-type-indicator.multiple-choice {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.question-type-indicator.number-exact {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.question-type-indicator.number-range {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.question-type-indicator.true-false {
    background: rgba(139, 69, 19, 0.1);
    color: #8b4513;
}

.question-type-indicator.multiple-choice-images {
    background: rgba(147, 51, 234, 0.1);
    color: #9333ea;
}

/* Mobile adjustments for new question types */
@media (max-width: 768px) {
    .question-options-grid.image-multiple-choice {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .option-button.image-option {
        min-height: 150px;
        padding: 0.75rem;
    }
    
    .question-options-grid.true-false {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .true-false-button {
        min-height: 80px;
        font-size: 1.2rem;
        padding: 1rem;
    }
    
    .number-input-container {
        padding: 1.5rem;
    }
}

/* Play Button Overlay for iOS */
.play-button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10;
    cursor: pointer;
}

.play-button {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: transform 0.2s ease;
}

.play-button:hover {
    transform: scale(1.1);
}

.play-button:active {
    transform: scale(0.95);
}

.play-button svg {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

.play-button:hover svg {
    transform: scale(1.05);
}

.play-button p {
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

@media (max-width: 768px) {
    .play-button svg {
        width: 60px;
        height: 60px;
    }
    
    .play-button p {
        font-size: 0.9rem;
    }
}

.results-card {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.results-card h2 {
    text-align: center;
    margin-bottom: 0.25rem;
}

.results-sub {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.results-leaderboard {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.results-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    animation: revealSlide 0.5s ease-out;
    border: 1px solid var(--border-color);
    background: var(--background);
}

.results-entry.rank-1 {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}

.results-entry.rank-2 {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-color: #94a3b8;
}

.results-entry.rank-3 {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    border-color: #f97316;
}

.results-entry.is-my-team {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.results-rank {
    font-size: 1.4rem;
    font-weight: 700;
    min-width: 2.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.results-entry.rank-1 .results-rank { color: #b45309; }
.results-entry.rank-2 .results-rank { color: #475569; }
.results-entry.rank-3 .results-rank { color: #c2410c; }

.results-team-name {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.results-score {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
}

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

/* Host reveal controls */
.reveal-controls-panel {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-top: 1rem;
    border: 2px solid #f59e0b;
}

.reveal-controls-panel h3 {
    margin-bottom: 1rem;
}

.reveal-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.reveal-progress {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
