/* Quiz App Admin UI - Phase 3 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 0.4rem 0;
    margin-bottom: 0;
}

.navbar .navbar-brand {
    font-size: 1rem;
    padding: 0.25rem 0;
}

.navbar .nav-link {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
}

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

.page-header h1 {
    font-size: 2rem;
    color: #2c3e50;
}

.actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Quiz Cards */
.quiz-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.quiz-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.quiz-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.quiz-header h3 {
    font-size: 1.25rem;
    color: #2c3e50;
}

.quiz-meta {
    background: #ecf0f1;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.quiz-description {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

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

/* Tables */
.session-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.session-table th,
.session-table td {
    padding: 1rem;
    text-align: left;
}

.session-table thead {
    background: #2c3e50;
    color: white;
}

.session-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.session-table tbody tr:hover {
    background: #e9ecef;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-lobby {
    background: #3498db;
    color: white;
}

.badge-running {
    background: #2ecc71;
    color: white;
}

.badge-reveal {
    background: #f39c12;
    color: white;
}

.badge-finished {
    background: #95a5a6;
    color: white;
}

/* Modal - REMOVED: Bootstrap handles modals now */

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Empty State */
.empty-state {
    background: white;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    color: #7f8c8d;
}

/* Phase 6: Player UI Styles */

/* Player Card - Centered in base_player container */
.player-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.player-card h1 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 2rem;
    text-align: center;
}

.player-card .subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

/* Player Form */
.player-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.player-form input {
    font-size: 1.1rem;
    padding: 1rem;
    text-align: center;
}

.player-form input#joinCode {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: bold;
    font-size: 1.5rem;
}

.btn-large {
    padding: 1.2rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Lobby */
.lobby-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.join-code-display {
    background: #ecf0f1;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    margin-top: 1rem;
}

.join-code-display strong {
    font-size: 1.8rem;
    color: #3498db;
    letter-spacing: 0.2em;
    display: block;
    margin-top: 0.5rem;
}

.player-info {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #7f8c8d;
    font-size: 1rem;
}

.lobby-status {
    text-align: center;
    margin: 2rem 0;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.lobby-status h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.status-text {
    color: #7f8c8d;
}

.participants-section {
    margin-top: 1.5rem;
}

.participants-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.participants-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #ecf0f1;
    border-radius: 8px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.participants-list li {
    padding: 0.5rem;
    border-bottom: 1px solid #bdc3c7;
}

.participants-list li:last-child {
    border-bottom: none;
}

/* Question Page */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.round-indicator {
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}

.timer {
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
    transition: background-color 0.3s, transform 0.3s;
}

.timer.timer-warning {
    background: #f39c12;
    animation: pulse 1s ease-in-out infinite;
}

.timer.timer-critical {
    background: #e74c3c;
    animation: pulse 0.5s ease-in-out infinite;
}

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

/* Host timer styles */
.question-header-host {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.question-header-host h2 {
    margin: 0;
    flex: 1;
}

.host-timer {
    font-size: 1.5rem;
    padding: 0.75rem 1.5rem;
    min-width: 80px;
    text-align: center;
}

.question-content {
    margin: 1.5rem 0 2rem 0;
    text-align: center;
}

.question-content h2 {
    color: #2c3e50;
    font-size: 1.4rem;
    line-height: 1.4;
}

/* Slider */
.slider-section {
    margin: 2rem 0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.answer-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ecf0f1;
    outline: none;
    -webkit-appearance: none;
}

.answer-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.answer-slider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.slider-value {
    text-align: center;
    margin-top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}

/* Results/Reveal Page */
.reveal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.question-recap {
    background: #ecf0f1;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.question-text {
    color: #2c3e50;
    font-weight: 500;
}

.answer-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.answer-box {
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.answer-box.correct-answer {
    background: #d5f4e6;
    border: 2px solid #27ae60;
}

.answer-box.your-answer {
    background: #e3f2fd;
    border: 2px solid #3498db;
}

.answer-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.answer-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.answer-unit {
    font-size: 1rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.answer-points {
    font-size: 1.2rem;
    color: #3498db;
    font-weight: bold;
    margin-top: 0.5rem;
}

/* Leaderboard */
.leaderboard-section {
    margin-top: 1.5rem;
}

.leaderboard-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-table thead {
    background: #34495e;
    color: white;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.75rem;
    text-align: left;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

.leaderboard-table tbody tr:hover {
    background: #f8f9fa;
}

.leaderboard-table .highlight-row {
    background: #e3f2fd;
    font-weight: bold;
}

/* Round Results Table */
.round-results-table th,
.round-results-table td {
    text-align: center;
    padding: 0.6rem 0.4rem;
    font-size: 0.9rem;
}

.round-results-table th:nth-child(2),
.round-results-table td:nth-child(2) {
    text-align: left;
}

/* Deviation color coding */
.deviation-good {
    color: #27ae60;
    font-weight: bold;
}

.deviation-ok {
    color: #f39c12;
    font-weight: bold;
}

.deviation-bad {
    color: #e74c3c;
}

/* Round points styling */
.round-points {
    color: #27ae60;
    font-weight: bold;
}

/* No answer styling */
.no-answer {
    color: #95a5a6;
    font-style: italic;
}

/* Points earned styling on player reveal page */
.points-earned {
    display: block;
    font-size: 1rem;
    color: #27ae60;
    font-weight: bold;
    margin-top: 0.25rem;
}

/* Finished Page */
.finished-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.rank-badge {
    text-align: center;
    padding: 2rem;
    margin: 1.5rem 0;
    border-radius: 12px;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: white;
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #c7cad1 0%, #a1a8b0 100%);
    color: white;
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #d4a574 0%, #c9904b 100%);
    color: white;
}

.rank-number {
    font-size: 3rem;
    font-weight: bold;
}

.rank-label {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.final-points {
    font-size: 1.5rem;
    font-weight: bold;
}

.game-actions {
    text-align: center;
    margin-top: 1.5rem;
}

.waiting-message {
    text-align: center;
    margin-top: 1.5rem;
    color: #7f8c8d;
    font-style: italic;
}

/* Messages */
.success-message {
    background: #d5f4e6;
    color: #27ae60;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 1rem;
    font-weight: bold;
}

.error-message {
    background: #fadbd8;
    color: #e74c3c;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 1rem;
}

/* Phase 6: Host UI Styles */

.host-container {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Compact host info panel (at the bottom once game started) */
.host-header {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.host-header.compact {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
    margin-top: 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.host-header.compact h1 {
    display: none;
}

.host-header.compact .session-info {
    gap: 0.5rem;
}

.host-header.compact .info-badge {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.host-header.compact .join-code-large {
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.host-header.compact .state-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
}

/* Collapsible panel */
.host-header.collapsed .session-info,
.host-header.collapsed .qr-code-container {
    display: none !important;
}

.host-header.collapsed {
    cursor: pointer;
}

.host-header-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin-left: auto;
    transition: color 0.2s;
}

.host-header-toggle:hover {
    color: #495057;
}

.host-header.compact .host-header-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.host-header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compact-info-line {
    display: none;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: #495057;
}

.host-header.compact.collapsed .compact-info-line {
    display: flex;
}

.host-header h1 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.session-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.info-badge {
    background: #ecf0f1;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.join-code-large {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
    letter-spacing: 0.15em;
    margin-left: 0.5rem;
}

.state-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    background: #3498db;
    color: white;
    font-weight: bold;
    margin-left: 0.5rem;
    font-size: 0.85rem;
}

.host-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.game-view {
    min-height: 400px;
}

.participants-panel h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.participant-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #ecf0f1;
    border-radius: 6px;
}

.participant-name {
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.host-actions {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #ecf0f1;
}

.host-actions .hint {
    color: #7f8c8d;
    margin-top: 1rem;
}

.question-display {
    background: #ecf0f1;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.question-display h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.question-details {
    color: #7f8c8d;
}

.answer-status {
    margin: 2rem 0;
}

.answer-status h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 30px;
    background: #ecf0f1;
    border-radius: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0;
    transition: width 0.3s ease;
}

.reveal-info {
    text-align: center;
    margin-bottom: 2rem;
}

.correct-answer-display {
    background: #d5f4e6;
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid #27ae60;
}

.correct-answer-display h3 {
    color: #27ae60;
    margin-bottom: 1rem;
}

.answer-big {
    font-size: 3rem;
    font-weight: bold;
    color: #27ae60;
}

.leaderboard-panel {
    margin: 2rem 0;
}

.leaderboard-panel h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .player-card {
        padding: 1rem;
    }

    .player-card h1 {
        font-size: 1.5rem;
    }

    .answer-comparison {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .answer-value {
        font-size: 1.5rem;
    }

    .rank-number {
        font-size: 2.5rem;
    }

    .rank-badge {
        padding: 1.5rem;
        margin: 1rem 0;
    }

    .host-container {
        padding: 1rem;
    }

    .join-code-large {
        font-size: 1.5rem;
    }

    .session-info {
        flex-direction: column;
    }

    .participants-grid {
        grid-template-columns: 1fr;
    }

    .answer-big {
        font-size: 2rem;
    }

    .participants-list {
        max-height: 150px;
    }

    .question-content h2 {
        font-size: 1.2rem;
    }

    .lobby-status h2 {
        font-size: 1.3rem;
    }

    .status-icon {
        font-size: 2.5rem;
    }

    /* Round results table - tighter on mobile */
    .round-results-table th,
    .round-results-table td {
        padding: 0.4rem 0.25rem;
        font-size: 0.8rem;
    }

    .round-results-table th:nth-child(1),
    .round-results-table td:nth-child(1) {
        width: 2rem;
    }
}

.empty-state p {
    font-size: 1.125rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
}

.filters select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

/* Utility */
code {
    background: #ecf0f1;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* ========================================
   Player Base Template Styles
   ======================================== */

/* Full-viewport vibrant gradient background */
.player-base-container {
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #46178F 0%, #C63B68 50%, #FFA602 100%);
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem 4rem 1rem; /* Reduced padding, extra bottom for footer */
}

/* Player Footer with Admin Link */
.player-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.player-footer a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.3s;
}

.player-footer a:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Enhanced player card for vibrant aesthetic - white card on gradient */
.player-base-container .player-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

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

/* QR scanner button - mobile only */
.qr-scanner-btn {
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .qr-scanner-btn {
        display: none !important;
    }
}

/* QR scanner modal */
#qr-reader {
    width: 100%;
    max-width: 500px;
    min-height: 300px;
    margin: 0 auto;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

#qr-reader video {
    border-radius: 8px;
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
}

#qr-reader-results {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Ensure modal displays properly on mobile */
#qrScannerModal .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
}

#qrScannerModal .modal-body {
    padding: 1rem;
}

/* Fix html5-qrcode library button styling on mobile */
#qr-reader button {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* Scanner status messages */
#qr-reader__status_span {
    display: block;
    padding: 0.5rem;
    color: #fff;
    font-size: 0.85rem;
}

/* ========================================
   Q&A Party Game Styles (Phase 2)
   ======================================== */

/* Setup Card */
.qa-setup-card {
    max-width: 500px;
    width: 100%;
}

.qa-setup-card h1 {
    font-size: 1.8rem;
    text-align: center;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.qa-setup-step {
    width: 100%;
}

.qa-step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.qa-step-header h1 {
    flex: 1;
    margin: 0;
    font-size: 1.4rem;
}

/* Player Name Input */
.qa-player-input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.qa-player-input-row input {
    flex: 1;
    padding: 0.75rem;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.qa-player-input-row input:focus {
    border-color: #3498db;
}

.qa-player-input-row .btn {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    border-radius: 8px;
}

/* Player Chips */
.qa-chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2.5rem;
    margin-bottom: 1rem;
}

.qa-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #3498db;
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    animation: slideUp 0.2s ease-out;
}

.qa-chip-remove {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

.qa-chip-remove:hover {
    opacity: 1;
}

.qa-player-count {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Deck Selection Cards */
.qa-deck-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.qa-deck-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.qa-deck-card:hover {
    border-color: #3498db;
    background: #eaf4fd;
    transform: translateY(-1px);
}

.qa-deck-card:active {
    transform: translateY(0);
}

.qa-deck-card h3 {
    font-size: 1.15rem;
    color: #2c3e50;
    margin: 0 0 0.25rem 0;
}

.qa-deck-card p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
}

.qa-deck-meta {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* Q&A Game Play Screen */
.qa-game-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

/* Top bar: round counter pill with mute button inside */
.qa-top-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(4px);
    padding: 0.3rem 0.5rem 0.3rem 1rem;
    margin-bottom: 0.75rem;
}

/* Mute Toggle Button */
.qa-mute-btn {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 30px;
    text-align: center;
    padding: 0;
}

.qa-mute-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.qa-view {
    width: 100%;
}

/* Wheel */
.qa-wheel-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    aspect-ratio: 1;
}

.qa-wheel-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.qa-tap-hint {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-top: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

/* Done List (players who already had their turn) */
.qa-done-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.qa-done-list:empty {
    display: none;
}

.qa-done-list li {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.qa-done-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Winner Announcement */
.qa-announce-overlay {
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

.qa-announce-label {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.qa-announce-name {
    font-size: 3rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0.5rem 0 2rem 0;
}

/* Category Selection */
.qa-cat-header {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.qa-category-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.qa-category-btn {
    display: block;
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    background: white;
    color: #2c3e50;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.qa-category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.qa-category-btn:active {
    transform: translateY(0);
}

/* Prompt Display */
.qa-prompt-display {
    background: white;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

.qa-prompt-category {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.qa-prompt-text {
    font-size: 1.6rem;
    line-height: 1.4;
    color: #2c3e50;
    font-weight: 500;
    margin: 0;
}

/* Mobile adjustments for game screens */
@media (max-width: 480px) {
    .qa-announce-name {
        font-size: 2.2rem;
    }

    .qa-prompt-text {
        font-size: 1.3rem;
    }

    .qa-wheel-wrapper {
        max-width: 320px;
    }

    .qa-category-btn {
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
    }
}

/* Skip Player Button */
.qa-skip-btn {
    margin-top: 1rem;
    background: transparent;
    color: #95a5a6;
    border: 2px solid #95a5a6;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.qa-skip-btn:hover {
    color: #7f8c8d;
    border-color: #7f8c8d;
}

/* Pass / New Prompt Button */
.qa-pass-btn {
    margin-bottom: 1rem;
    width: 100%;
    background: transparent;
    color: #e67e22;
    border: 2px solid #e67e22;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.qa-pass-btn:hover {
    color: #d35400;
    border-color: #d35400;
}

.qa-pass-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #ccc;
}

/* Round Counter */
.qa-round-counter {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ========================================
   Confetti Animation (Phase 3)
   ======================================== */

.qa-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.qa-confetti-piece {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: qa-confetti-fall var(--duration, 2.5s) ease-in forwards;
}

@keyframes qa-confetti-fall {
    0% {
        transform: translateY(-10vh) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) translateX(var(--drift, 0px)) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   Landing Page (Phase 4)
   ======================================== */

.landing-container {
    text-align: center;
    max-width: 500px;
    width: 100%;
    padding: 2rem 1rem;
}

.landing-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

.landing-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.landing-tiles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.landing-tile {
    display: block;
    text-decoration: none;
    color: #2c3e50;
    background: white;
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 160px;
    text-align: center;
}

.landing-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    color: #2c3e50;
    text-decoration: none;
}

.landing-tile:active {
    transform: translateY(0);
}

.landing-tile-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.landing-tile-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.landing-tile-desc {
    font-size: 0.95rem;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.4;
}

.landing-tile-guesstimate {
    border-left: 5px solid #667eea;
}

.landing-tile-qa {
    border-left: 5px solid #e67e22;
}

@media (min-width: 600px) {
    .landing-container {
        max-width: 650px;
    }
    .landing-tiles {
        flex-direction: row;
    }
    .landing-tile {
        flex: 1;
    }
}

/* ========================================
   Q&A Mobile & Responsive Polish (Phase 4)
   ======================================== */

/* Enhanced mobile portrait */
@media (max-width: 480px) {
    /* Setup screen polish */
    .qa-setup-card {
        padding: 1.25rem;
        margin: 0 0.5rem;
    }

    .qa-setup-card h1 {
        font-size: 1.5rem;
    }

    /* Game container - reduce top padding for small screens */
    .qa-game-container {
        padding: 0 0.5rem;
    }

    /* Prompt display - tighter padding on small screens */
    .qa-prompt-display {
        padding: 1.75rem 1.25rem;
    }

    /* Category buttons - ensure minimum 48px tap target */
    .qa-category-btn {
        min-height: 48px;
    }

    /* Announce overlay - less padding on small screens */
    .qa-announce-overlay {
        padding: 2rem 1.5rem;
    }

    /* Deck cards - ensure easy tapping */
    .qa-deck-card {
        padding: 1rem;
        min-height: 48px;
    }
}

/* Landscape orientation - phone held sideways */
@media (orientation: landscape) and (max-height: 500px) {
    /* In landscape on a phone, vertical space is precious */
    .qa-game-container {
        max-width: 90vw;
    }

    /* Smaller wheel to fit landscape viewport */
    .qa-wheel-wrapper {
        max-width: min(50vh, 350px);
        margin: 0 auto;
    }

    /* Compact announcement in landscape */
    .qa-announce-overlay {
        padding: 1.5rem;
    }

    .qa-announce-name {
        font-size: 2rem;
        margin: 0.25rem 0 1rem 0;
    }

    .qa-announce-label {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    /* Prompt - more compact */
    .qa-prompt-display {
        padding: 1.5rem 1.25rem;
        margin-bottom: 1rem;
    }

    .qa-prompt-text {
        font-size: 1.3rem;
    }

    /* Category grid - 2 columns in landscape to use horizontal space */
    .qa-category-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .qa-category-btn {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }

    /* Top bar - smaller in landscape */
    .qa-top-bar {
        padding: 0.2rem 0.4rem 0.2rem 0.75rem;
        margin-bottom: 0.5rem;
    }

    .qa-round-counter {
        font-size: 0.85rem;
    }

    /* Tap hint */
    .qa-tap-hint {
        margin-top: 0.5rem;
        font-size: 0.95rem;
    }

    /* Skip/pass buttons - more compact */
    .qa-skip-btn, .qa-pass-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Setup card in landscape */
    .qa-setup-card {
        max-width: 80vw;
    }

}

/* Large viewport - TV cast / desktop */
@media (min-width: 1024px) {
    /* Scale up the game container for big screens */
    .qa-game-container {
        max-width: 800px;
    }

    /* Larger wheel on big screens */
    .qa-wheel-wrapper {
        max-width: 500px;
    }

    /* Bigger text for TV readability */
    .qa-announce-name {
        font-size: 4rem;
    }

    .qa-announce-label {
        font-size: 1.4rem;
    }

    .qa-prompt-text {
        font-size: 2rem;
    }

    .qa-prompt-category {
        font-size: 1.1rem;
    }

    .qa-cat-header {
        font-size: 1.6rem;
    }

    .qa-category-btn {
        font-size: 1.4rem;
        padding: 1.5rem 2rem;
    }

    /* Category grid - 2 columns on large screens */
    .qa-category-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .qa-round-counter {
        font-size: 1.1rem;
    }

    .qa-tap-hint {
        font-size: 1.3rem;
    }

    /* Setup - wider card on big screens */
    .qa-setup-card {
        max-width: 600px;
    }
}

/* Extra-large TV screens */
@media (min-width: 1600px) {
    .qa-game-container {
        max-width: 1000px;
    }

    .qa-wheel-wrapper {
        max-width: 600px;
    }

    .qa-announce-name {
        font-size: 5rem;
    }

    .qa-prompt-text {
        font-size: 2.5rem;
    }

    .qa-prompt-display {
        padding: 3.5rem 3rem;
    }

    .qa-category-btn {
        font-size: 1.6rem;
        padding: 1.75rem 2.5rem;
    }
}
