/* css/host.css — Style Ekranu Prowadzacego / Rzutnika w T_Quiz */

.host-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Górny pasek gry na rzutniku (Nowoczesny, 1-liniowy układ bez łamania) */
/* Górny pasek gry na rzutniku (Nowoczesny, 1-liniowy układ bez wyjeżdżania poza obrys) */
.host-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 7, 38, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 10px 18px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    min-height: 60px;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Lewa strona: Logo */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.topbar-logo {
    font-size: 1.45rem;
    font-weight: 900;
    white-space: nowrap;
    letter-spacing: -0.02em;
    color: #ffffff;
}

/* Środek: Tytuł Quizu wycentrowany na środku paska */
.topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    margin: 0 14px;
}

.topbar-quiz-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    font-size: 1.02rem;
    font-weight: 800;
    color: #ffd166;
    letter-spacing: -0.01em;
    max-width: 540px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
}

.topbar-quiz-badge span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Prawa strona: Przyciski narzędziowe i sesja nauczyciela */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 1;
    min-width: 0;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
    padding: 0 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.topbar-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.topbar-select {
    height: 36px;
    padding: 0 8px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.topbar-select option {
    background: #1e1b4b;
    color: #ffffff;
}

.topbar-teacher-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 5px 0 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.topbar-teacher-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1f5f9;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-btn-logout {
    height: 26px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.topbar-btn-logout:hover {
    background: rgba(239, 68, 68, 0.5);
    border-color: #ef4444;
}

.topbar-btn-exit {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4) !important;
    padding: 0 12px !important;
}

.topbar-btn-exit:hover {
    background: #b91c1c !important;
    transform: translateY(-1px);
}

/* Responsywne dopasowanie, aby elementy nigdy nie wystawały poza pasek */
@media (max-width: 1320px) {
    .topbar-right .btn-text {
        display: none;
    }
    .topbar-btn {
        padding: 0 8px;
    }
    .topbar-quiz-badge {
        max-width: 160px;
    }
}

@media (max-width: 1050px) {
    .topbar-quiz-badge {
        display: none;
    }
    .topbar-teacher-name {
        max-width: 90px;
    }
}

/* ==================== LOBBY ==================== */
.lobby-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    padding: 40px;
    border: 2px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.lobby-qr-section {
    display: flex;
    align-items: center;
    gap: 40px;
    background: rgba(255, 255, 255, 0.08);
    padding: 24px 36px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
}

.lobby-qr-img {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-md);
    background: #ffffff;
    padding: 8px;
}

.lobby-players-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    width: 100%;
    margin-bottom: 32px;
    padding: 10px;
}

.lobby-player-chip {
    background: #ffffff;
    color: #1e1b4b;
    font-weight: 800;
    font-size: 1.15rem;
    padding: 10px 20px;
    border-radius: 9999px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Przycisk usuwania uczestnika z poczekalni */
.lobby-kick-btn {
    margin-left: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #fee2e2;
    color: #dc2626;
    font-weight: 900;
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.lobby-kick-btn:hover {
    background: #dc2626;
    color: #ffffff;
    transform: scale(1.12);
}

/* ==================== SLAJD INFORMACYJNY ==================== */
.slide-card {
    background: #ffffff;
    color: #0f172a;
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.slide-text {
    font-size: clamp(1.4rem, 3.2vw, 2.4rem);
    font-weight: 800;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* ==================== EKRAN PYTANIA ==================== */
.question-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Punkt odniesienia dla odznaki mnożnika punktów (position: absolute). */
    position: relative;
}

.question-header-card {
    background: #ffffff;
    color: #0f172a;
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.question-text {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
}

.question-middle-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 20px;
}

.timer-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--quiz-teal);
    border: 5px solid #ffd166;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(255, 209, 102, 0.4);
}

.answers-counter-box {
    background: rgba(0, 0, 0, 0.35);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    font-weight: 700;
}

/* 4 KAFELKI ODPOWIEDZI QUIZ */
.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1;
}

.answer-card {
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.answer-card.red { background: var(--red); }
.answer-card.blue { background: var(--blue); }
.answer-card.yellow { background: var(--yellow); }
.answer-card.green { background: var(--green); }
.answer-card.purple { background: var(--purple); }

/* Elastyczne układy dla 2, 3, 4 i 5 kafelków */
.answers-grid.count-2 {
    grid-template-columns: 1fr 1fr !important;
}
.answers-grid.count-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}
.answers-grid.count-4 {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr;
}
.answers-grid.count-5 {
    grid-template-columns: repeat(6, 1fr) !important;
}
.answers-grid.count-5 .answer-card:nth-child(1) { grid-column: span 2; }
.answers-grid.count-5 .answer-card:nth-child(2) { grid-column: span 2; }
.answers-grid.count-5 .answer-card:nth-child(3) { grid-column: span 2; }
.answers-grid.count-5 .answer-card:nth-child(4) { grid-column: span 3; }
.answers-grid.count-5 .answer-card:nth-child(5) { grid-column: span 3; }

.answer-shape {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.answer-card.dimmed {
    opacity: 0.3;
    filter: grayscale(80%);
}

.answer-card.correct-glow {
    box-shadow: 0 0 40px #22c55e, 0 0 0 4px #ffffff;
    transform: scale(1.02);
    z-index: 2;
}

/* ==================== WYKRES PO PYTANIU (REVEAL) ==================== */
.chart-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 32px;
    height: 240px;
    margin: 24px 0;
}

.chart-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 120px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    border-radius: 12px 12px 0 0;
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
    font-weight: 800;
    font-size: 1.3rem;
}

.chart-bar.red { background: var(--red); }
.chart-bar.blue { background: var(--blue); }
.chart-bar.yellow { background: var(--yellow); }
.chart-bar.green { background: var(--green); }
.chart-bar.purple { background: var(--purple); }

/* ==================== TABLICA WYNIKÓW (LEADERBOARD) ==================== */
.leaderboard-list {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.leaderboard-item {
    background: #ffffff;
    color: #0f172a;
    border-radius: var(--radius-md);
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    animation: popIn 0.3s ease;
}

.leaderboard-rank {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--quiz-teal);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 16px;
}

/* ==================== PODIUM ==================== */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 24px;
    height: 440px;
    margin-top: 40px;
}

.podium-step {
    width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.podium-avatar {
    font-size: 3.5rem;
    margin-bottom: 8px;
    animation: popIn 0.5s ease;
}

.podium-name {
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 4px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.podium-score {
    font-size: 1.1rem;
    color: #ffd166;
    margin-bottom: 12px;
}

.podium-block {
    width: 100%;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    transition: height 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.podium-first .podium-block {
    height: 280px;
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
}

.podium-second .podium-block {
    height: 200px;
    background: linear-gradient(180deg, #94a3b8 0%, #475569 100%);
}

.podium-third .podium-block {
    height: 140px;
    background: linear-gradient(180deg, #d97706 0%, #78350f 100%);
}
