:root {
    --bg-dark: #0a0d14;
    --bg-card: rgba(22, 28, 45, 0.85);
    --bg-card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    
    /* Il Professorone Option Colors */
    --color-a: #f1c40f; /* Yellow */
    --color-b: #3498db; /* Blue */
    --color-c: #e67e22; /* Orange */
    --color-d: #2ecc71; /* Green */
    --color-e: #9b59b6; /* Purple */

    --color-correct: #00ff88;
    --color-wrong: #ff3366;
    
    --glow-a: rgba(241, 196, 15, 0.45);
    --glow-b: rgba(52, 152, 219, 0.45);
    --glow-c: rgba(230, 126, 34, 0.45);
    --glow-d: rgba(46, 204, 113, 0.45);
    --glow-e: rgba(155, 89, 182, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.theme-pub {
    background: radial-gradient(circle at 50% 20%, #171d2d 0%, #0a0d14 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.screen-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.2rem 2rem;
}

/* TOP NAV */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.8rem;
    background: rgba(18, 24, 38, 0.85);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    margin-bottom: 1.2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 10px #f1c40f);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.logo-text .highlight {
    color: #00f2fe;
    text-shadow: 0 0 12px rgba(0, 242, 254, 0.6);
}

.badge-edition {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(135deg, #e74c3c, #f39c12);
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    letter-spacing: 1px;
}

.room-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
}

.room-pill .lbl {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.room-pill .code {
    font-family: 'Russo One', sans-serif;
    font-size: 1.5rem;
    color: #f1c40f;
    letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.6);
}

.btn-room-edit {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    margin-left: 0.3rem;
}

.btn-room-edit:hover {
    background: rgba(0, 242, 254, 0.2);
    border-color: #00f2fe;
    transform: scale(1.1);
}

.btn-tool.btn-logout {
    border-color: rgba(255, 51, 102, 0.4);
    color: #ff3366;
}

.btn-tool.btn-logout:hover {
    background: rgba(255, 51, 102, 0.2);
    border-color: #ff3366;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

.btn-change-room-lobby {
    width: 100%;
    margin-top: 0.8rem;
    background: rgba(0, 242, 254, 0.1);
    border: 1.5px solid rgba(0, 242, 254, 0.35);
    border-radius: 14px;
    padding: 0.65rem 1rem;
    color: #00f2fe;
    font-family: 'Russo One', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-change-room-lobby:hover {
    background: rgba(0, 242, 254, 0.2);
    border-color: #00f2fe;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
    transform: translateY(-1px);
}

/* ROOM MODAL STYLES */
.room-modal-content {
    background: rgba(22, 28, 45, 0.96);
    border: 2px solid rgba(0, 242, 254, 0.4);
    border-radius: 28px;
    width: 90%;
    max-width: 520px;
    padding: 2.2rem 2.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 242, 254, 0.25);
    animation: zoomIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.room-modal-body .modal-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.room-modal-body .modal-desc strong {
    color: #f1c40f;
}

.room-input-row {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.4rem;
}

.room-input-row .input-styled {
    flex: 1;
    font-size: 1.4rem;
    letter-spacing: 3px;
    padding: 0.6rem 1rem;
}

.room-input-row .btn-mini {
    padding: 0 1.2rem;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}

.room-input-row .btn-mini:hover {
    background: rgba(241, 196, 15, 0.2);
    border-color: #f1c40f;
    color: #f1c40f;
}

.status-tools {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.players-badge {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-tool {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-tool:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* VIEWPORT & VIEWS */
.viewport {
    flex: 1;
    position: relative;
    display: flex;
}

.game-view {
    display: none !important;
    width: 100%;
    height: 100%;
    animation: fadeIn 0.35s ease;
}

.game-view.active {
    display: flex !important;
    flex-direction: column;
}

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

.card-glow {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
}

/* LOBBY VIEW */
.lobby-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    height: 100%;
}

.connect-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    text-align: center;
}

.connect-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.pulse-dot {
    width: 14px;
    height: 14px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 12px #00ff88;
    animation: pulse 1.5s infinite;
}

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

.connect-header h2 {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.connect-instructions {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

.qr-wrapper {
    background: #ffffff;
    padding: 1rem;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-image {
    width: 220px;
    height: 220px;
    display: block;
}

.qr-scan-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.url-badge {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 14px;
    width: 100%;
}

.url-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.url-text {
    font-family: monospace;
    font-size: 0.95rem;
    color: #00f2fe;
    font-weight: 700;
    word-break: break-all;
}

.lobby-right {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    height: 100%;
}

.teams-panel {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

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

.panel-header h3 {
    font-size: 1.3rem;
    font-weight: 800;
}

.panel-header .subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.teams-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    align-content: start;
}

.team-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: popIn 0.3s ease;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.team-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.team-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.team-info .team-name {
    font-weight: 800;
    font-size: 1.1rem;
}

.team-info .team-status {
    font-size: 0.75rem;
    color: #00ff88;
    font-weight: 600;
}

.empty-teams-msg {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 600;
}

.start-controls {
    padding: 1.2rem 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.controls-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 1rem;
}

.ctrl-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
}

.select-styled {
    width: 100%;
    background: rgba(10, 14, 24, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.btn-giant-start {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    border: none;
    color: #fff;
    padding: 1.2rem 2rem;
    border-radius: 16px;
    font-size: 1.4rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 176, 155, 0.4);
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.btn-giant-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 176, 155, 0.6);
}

.btn-setup-trigger {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #00f2fe;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-setup-trigger:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: #00f2fe;
    transform: translateY(-1px);
}

/* MODALE SETUP AVANZATO */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 18, 0.88);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
    animation: fadeIn 0.25s ease;
}

.modal-overlay.hidden {
    display: none !important;
}

.setup-modal-content {
    width: 950px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 1.8rem 2.2rem;
    background: #131929;
    border: 2px solid rgba(0, 242, 254, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 242, 254, 0.2);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.title-with-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-with-badge h2 {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.badge-setup {
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    color: #0b0e14;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.25rem 0.7rem;
    border-radius: 8px;
    text-transform: uppercase;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: #ff3366;
    border-color: #ff3366;
}

.setup-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.setup-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.2rem 1.4rem;
}

.setup-section .section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.setup-section h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 0.8rem;
}

.cat-quick-actions {
    display: flex;
    gap: 0.6rem;
}

.btn-mini {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-mini:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Category Chips Grid */
.categories-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.6rem;
}

.cat-chip-label {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.cat-chip-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.15s ease;
}

.cat-chip-label input:checked + .chip-content {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--cat-color, #00f2fe);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.setup-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 0.4rem;
}

.input-with-hint {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.hint-text {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

/* TOGGLE SLIDER */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.3rem;
}

.toggle-wrapper input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.25s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: transform 0.25s;
}

.toggle-wrapper input:checked + .toggle-slider {
    background: #00ff88;
}

.toggle-wrapper input:checked + .toggle-slider::after {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e2e8f0;
}

.modal-footer {
    margin-top: 1.2rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
}

/* ABSTAIN BADGE ROUND */
.abstain-badge-round {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.abstain-badge-round.safe {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

.abstain-badge-round.danger {
    background: rgba(255, 51, 102, 0.18);
    border: 1px solid #ff3366;
    color: #ff3366;
    animation: pulse 1.5s infinite;
}

/* DIFFICULTY BADGE */
.difficulty-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.difficulty-badge.facile {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

.difficulty-badge.media {
    background: rgba(241, 196, 15, 0.15);
    border: 1px solid #f1c40f;
    color: #f1c40f;
}

.difficulty-badge.difficile {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

/* KEYBOARD SHORTCUT HINTS */
.kbd-hint {
    display: inline-block;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 700;
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-left: 0.4rem;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

.kbd-hint-inline {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 600;
    margin-left: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* QUESTION VIEW */
#view-question {
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

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

.category-tag {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    font-weight: 800;
    font-size: 1.2rem;
}

.q-progress-badge {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.q-progress-badge span {
    color: #fff;
}

.timer-box {
    display: flex;
    align-items: center;
}

.timer-clock {
    font-family: 'Russo One', sans-serif;
    font-size: 3rem;
    color: #00ff88;
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    transition: color 0.3s ease;
}

.timer-clock.warning {
    color: #f1c40f;
    text-shadow: 0 0 15px rgba(241, 196, 15, 0.6);
}

.timer-clock.danger {
    color: #ff3366;
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.8);
    animation: timerPulse 0.5s infinite alternate;
}

@keyframes timerPulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.timer-unit {
    font-size: 1.4rem;
    opacity: 0.7;
}

.timer-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
}

.timer-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ff88, #f1c40f, #ff3366);
    transition: width 0.2s linear;
}

/* QUESTION TITLE CARD */
.question-box {
    padding: 1.8rem 2.5rem;
    text-align: center;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-title {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

/* 5 OPTIONS CARDS */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
}

/* READING PHASE TIMER & BANNER STYLES */
.timer-clock.reading {
    color: #00f2fe;
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.6);
}

.timer-bar-fill.reading {
    background: linear-gradient(90deg, #00f2fe, #3498db) !important;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.5);
}

.reading-banner {
    display: flex;
    justify-content: center;
    margin: -0.2rem 0 0.5rem 0;
    animation: fadeInSlideDown 0.3s ease;
}

.reading-banner.hidden {
    display: none;
}

.reading-banner-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0, 242, 254, 0.12);
    border: 1.5px solid rgba(0, 242, 254, 0.35);
    border-radius: 30px;
    padding: 0.45rem 1.4rem;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.25);
    backdrop-filter: blur(8px);
}

.reading-icon {
    font-size: 1.4rem;
    animation: bounceSlow 1.5s infinite;
}

.reading-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e0f2fe;
    letter-spacing: 0.3px;
}

.reading-countdown-badge {
    background: #00f2fe;
    color: #0a0d14;
    font-family: 'Russo One', sans-serif;
    font-size: 1.1rem;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
}

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

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

/* Options container in reading phase: options are dimmed with text hidden */
.options-container.reading-phase .option-card {
    opacity: 0.25;
    filter: blur(1.5px);
    transform: scale(0.985);
    pointer-events: none;
    transition: all 0.3s ease;
}

.options-container.reading-phase .opt-text {
    visibility: hidden;
}

/* Staggered popping animation when options are revealed */
@keyframes optionRevealPop {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
        filter: blur(4px);
    }
    70% {
        opacity: 1;
        transform: translateY(-2px) scale(1.015);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.options-container.reveal-stagger .option-card:nth-child(1) { animation: optionRevealPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 0.00s both; }
.options-container.reveal-stagger .option-card:nth-child(2) { animation: optionRevealPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s both; }
.options-container.reveal-stagger .option-card:nth-child(3) { animation: optionRevealPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 0.16s both; }
.options-container.reveal-stagger .option-card:nth-child(4) { animation: optionRevealPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 0.24s both; }
.options-container.reveal-stagger .option-card:nth-child(5) { animation: optionRevealPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 0.32s both; }

.option-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 0.8rem 1.4rem;
    gap: 1.2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.key-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Russo One', sans-serif;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.opt-a .key-badge { background: var(--color-a); color: #000; }
.opt-b .key-badge { background: var(--color-b); }
.opt-c .key-badge { background: var(--color-c); }
.opt-d .key-badge { background: var(--color-d); }
.opt-e .key-badge { background: var(--color-e); }

.opt-content {
    flex: 1;
    padding-right: 5rem;
}

.opt-text {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.25;
}

.stat-bar-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: none;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    width: 0%;
    background: #00f2fe;
    transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.option-card.correct .stat-bar {
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}

.stat-percent {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Russo One', sans-serif;
    font-size: 1.4rem;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.85rem;
    background: rgba(10, 15, 28, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 3;
    letter-spacing: 0.5px;
    color: #e2e8f0;
}

.option-card.correct .stat-percent {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

/* REVEAL HIGHLIGHT STYLES */
.option-card.correct {
    background: rgba(0, 255, 136, 0.18) !important;
    border-color: #00ff88 !important;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6) !important;
    transform: scale(1.02);
}

.option-card.correct .key-badge {
    background: #00ff88 !important;
    color: #000 !important;
    box-shadow: 0 0 20px #00ff88 !important;
}

.option-card.dimmed {
    opacity: 0.35;
    transform: scale(0.98);
}

.stat-bar-wrapper.show {
    display: block;
}

.stat-percent.show {
    display: flex;
}

/* EXPLANATION BOX */
.explanation-box {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-color: rgba(0, 242, 254, 0.3);
    background: rgba(0, 242, 254, 0.08);
}

.exp-icon {
    font-size: 2rem;
}

.exp-text {
    font-size: 1.15rem;
    line-height: 1.4;
    color: #e2e8f0;
}

.explanation-box.hidden, .reveal-actions.hidden {
    display: none;
}

/* BUZZER FOOTER */
.buzzer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.8rem 1.4rem;
    background: rgba(18, 24, 38, 0.85);
    border: 1px solid var(--bg-card-border);
    border-radius: 18px;
}

.buzzer-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.pulse-icon {
    font-size: 1.3rem;
    animation: pulse 1s infinite;
}

.buzzer-stream {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.2rem;
}

.buzz-tag {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    animation: popIn 0.25s ease;
}

.buzz-tag.correct-tag {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
    color: #00ff88;
}

.buzz-tag.wrong-tag {
    background: rgba(255, 51, 102, 0.2);
    border-color: #ff3366;
    color: #ff3366;
}

.reveal-actions {
    display: flex;
    gap: 0.8rem;
}

.btn-action {
    padding: 0.7rem 1.4rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-action.next {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    color: #fff;
}

.btn-action.rank {
    background: linear-gradient(135deg, #8a2387, #e94057, #f27121);
    color: #fff;
}

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

/* LEADERBOARD VIEW */
#view-leaderboard {
    height: 100%;
    align-items: center;
    justify-content: center;
}

.leaderboard-container {
    width: 900px;
    max-width: 95%;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.lb-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 0.3rem;
}

.btn-skip-anim {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-skip-anim:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: scale(1.06);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.rank-row.hidden-reveal {
    display: none !important;
}

.rank-row.reveal-in {
    display: grid !important;
    animation: rankPopIn 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes rankPopIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
        filter: brightness(2.5);
    }
    60% {
        transform: translateY(-4px) scale(1.03);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
}

.rank-row.reveal-highlight {
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.8) !important;
    border-color: #00f2fe !important;
}

.leaderboard-header h2 {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.leaderboard-header .sub {
    color: var(--text-secondary);
    font-size: 1rem;
}

.leaderboard-table {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.rank-row {
    display: grid;
    grid-template-columns: 60px 50px 1fr 140px 120px;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.8rem 1.2rem;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.rank-row.pos-1 {
    background: linear-gradient(90deg, rgba(241, 196, 15, 0.2), rgba(255, 255, 255, 0.05));
    border-color: #f1c40f;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.25);
}

.rank-row.pos-2 {
    background: linear-gradient(90deg, rgba(189, 195, 199, 0.15), rgba(255, 255, 255, 0.05));
    border-color: #bdc3c7;
}

.rank-row.pos-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.15), rgba(255, 255, 255, 0.05));
    border-color: #cd7f32;
}

.rank-num {
    font-family: 'Russo One', sans-serif;
    font-size: 1.4rem;
}

.rank-avatar {
    font-size: 1.8rem;
}

.rank-name {
    font-weight: 800;
}

.rank-streak {
    font-size: 0.9rem;
    color: #ff9900;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.rank-score {
    font-family: 'Russo One', sans-serif;
    font-size: 1.5rem;
    text-align: right;
    color: #00f2fe;
}

.rank-delta {
    font-size: 0.95rem;
    font-weight: 800;
    text-align: right;
}

.rank-delta.plus { color: #00ff88; }
.rank-delta.minus { color: #ff3366; }

.leaderboard-actions {
    display: flex;
    justify-content: center;
}

/* PODIUM VIEW */
#view-podium {
    height: 100%;
    align-items: center;
    justify-content: center;
}

.podium-container {
    width: 1000px;
    max-width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.podium-title {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

.podium-sub {
    font-size: 1.3rem;
    color: var(--text-secondary);
}

/* PODIUM SUSPENSE BANNER */
.podium-suspense-banner {
    background: rgba(10, 15, 30, 0.9);
    border: 1.5px solid rgba(241, 196, 15, 0.45);
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.2);
    border-radius: 30px;
    padding: 0.6rem 1.6rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.announcer-badge {
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    padding: 0.35rem 0.9rem;
    border-radius: 12px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    white-space: nowrap;
}

.announcer-text {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    min-width: 320px;
    letter-spacing: 0.5px;
}

/* Winner Card Mystery State */
.winner-card.mystery {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.25);
}

.winner-card.mystery .winner-avatar,
.winner-card.mystery .winner-name,
.winner-card.mystery .winner-score {
    opacity: 0.12;
    filter: blur(8px);
    transition: all 0.4s ease;
}

.mystery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border-radius: 18px;
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(5px);
    z-index: 5;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.mystery-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
}

.mystery-icon {
    font-size: 2.8rem;
    animation: mysteryFloat 1.4s ease-in-out infinite alternate;
}

@keyframes mysteryFloat {
    from { transform: scale(0.9) rotate(-6deg); }
    to { transform: scale(1.15) rotate(6deg); }
}

.mystery-label {
    font-size: 1rem;
    font-weight: 900;
    color: #cbd5e1;
    letter-spacing: 1px;
}

/* Step suspense drumroll aura */
.podium-col.suspense-active .podium-step {
    animation: stepDrumroll 0.25s infinite alternate !important;
}

@keyframes stepDrumroll {
    from {
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.4), inset 0 0 15px rgba(255, 255, 255, 0.3);
        transform: translateY(-2px);
    }
    to {
        box-shadow: 0 0 45px rgba(255, 255, 255, 0.8), inset 0 0 30px rgba(255, 255, 255, 0.6);
        transform: translateY(2px);
    }
}

.podium-col.suspense-active.rank-1 .podium-step {
    animation: stepDrumrollGold 0.18s infinite alternate !important;
}

@keyframes stepDrumrollGold {
    from {
        box-shadow: 0 0 35px rgba(241, 196, 15, 0.7), inset 0 0 20px rgba(241, 196, 15, 0.5);
        transform: translateY(-3px);
    }
    to {
        box-shadow: 0 0 65px rgba(241, 196, 15, 1), inset 0 0 40px rgba(255, 255, 255, 0.8);
        transform: translateY(3px);
    }
}

/* Winner Card Reveal Burst */
.winner-card.reveal-burst {
    animation: winnerCardBurst 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}

@keyframes winnerCardBurst {
    0% {
        transform: scale(0.7);
        opacity: 0;
        filter: brightness(2.5);
    }
    60% {
        transform: scale(1.1);
        filter: brightness(1.3);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1);
    }
}

.champion-card.reveal-burst {
    animation: champCardBurst 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}

@keyframes champCardBurst {
    0% {
        transform: scale(0.6) rotate(-5deg);
        opacity: 0;
        filter: brightness(3);
    }
    50% {
        transform: scale(1.2) rotate(2deg);
        filter: brightness(1.6);
    }
    100% {
        transform: scale(1.08) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }
}

.podium-stage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
    min-height: 340px;
}

.podium-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 250px;
}

.winner-card {
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 1.2rem;
    width: 100%;
    text-align: center;
    margin-bottom: 0.8rem;
    position: relative;
    backdrop-filter: blur(10px);
}

.winner-medal {
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
}

.winner-avatar {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.winner-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.winner-score {
    font-family: 'Russo One', sans-serif;
    font-size: 1.4rem;
    color: #00f2fe;
}

.champion-card {
    border-color: #f1c40f;
    box-shadow: 0 0 35px rgba(241, 196, 15, 0.45);
    background: rgba(241, 196, 15, 0.15);
    transform: scale(1.08);
}

.winner-crown {
    font-size: 3rem;
    animation: crownFloat 2s ease-in-out infinite alternate;
}

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

.podium-step {
    width: 100%;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Russo One', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 1px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.step-1 {
    height: 180px;
    background: linear-gradient(180deg, #f1c40f, #b78a05);
    color: #000;
}

.step-2 {
    height: 130px;
    background: linear-gradient(180deg, #bdc3c7, #7f8c8d);
    color: #000;
}

.step-3 {
    height: 90px;
    background: linear-gradient(180deg, #cd7f32, #8b5a2b);
    color: #fff;
}

.podium-table-wrapper {
    width: 100%;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.podium-actions {
    display: flex;
    justify-content: center;
}
