/* Pojedynki 1v1: lista lobby, prośba o walkę i ekran walki (korzysta z klas walki z battle.css). */

#duel-body {
    display: grid;
    gap: 0.75rem;
}

.duel-lobby-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.duel-lobby,
.duel-empty,
.duel-request {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--shop-border-color);
    border-radius: 8px;
    background: var(--shop-info-background);
}

.duel-empty {
    justify-content: center;
    text-align: center;
}

.duel-request {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
}

.duel-lobby-name {
    display: grid;
    min-width: 0;
    gap: 0.125rem;
}

.duel-lobby-name strong {
    overflow-wrap: anywhere;
}

#duel-screen {
    display: grid;
    gap: 0.75rem;
}

#duel-screen.hidden {
    display: none;
}

.duel-score,
.duel-timer {
    text-align: center;
    font-weight: 700;
}

.duel-timer.is-urgent {
    color: var(--bad);
}

.duel-round-box {
    display: grid;
    gap: 0.125rem;
    text-align: right;
}

.duel-round-box .duel-score {
    font-size: 0.8125rem;
    font-weight: 600;
}

.duel-forfeit-row {
    grid-template-columns: 1fr;
}

/* --- Przycisk w menu: Pojedynki zamiast Graj (po ukończeniu 50. poziomu) --- */
#main-buttons #duel-btn.is-main {
    order: -1;
    grid-column: 1 / -1;
    min-height: 3.9rem;
    font-size: 1.4rem;
}

/* --- Okno lobby --- */
.duel-player-card,
.duel-lobby,
.duel-empty,
.duel-request {
    border-radius: 8px;
}

.duel-player-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--shop-border-color);
    background: var(--shop-card-background);
}

.duel-save-info {
    display: grid;
    margin-left: auto;
    gap: 0.125rem;
    text-align: right;
    font-size: 0.75rem;
}

.duel-lobby-icon {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
}

.duel-lobby-name small,
.duel-hint {
    opacity: 0.8;
}

.duel-hint {
    margin: 0;
    font-size: 0.75rem;
    text-align: center;
}

.duel-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.duel-chip {
    padding: 0.0625rem 0.4rem;
    border: 1px solid var(--shop-border-color);
    border-radius: 999px;
    background: var(--shop-card-background);
    font-size: 0.6875rem;
    white-space: nowrap;
}

.duel-lobby > button {
    flex: 0 0 auto;
    min-width: 6.5rem;
    min-height: 2.5rem;
}

.duel-lobby.is-mine {
    border-color: var(--accent);
}

.duel-lobby.is-busy {
    opacity: 0.65;
}

.duel-create {
    display: grid;
    gap: 0.125rem;
    min-height: 3.5rem;
    width: 100%;
}

.duel-create-title {
    font-size: 1.15rem;
}

.duel-create small {
    font-weight: 400;
}

.duel-wide {
    width: 100%;
    min-height: 2.75rem;
}

.duel-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.duel-list-head .menu-section-title {
    margin: 0;
}

.duel-empty {
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.25rem 0.75rem;
}

.duel-empty-icon {
    font-size: 2rem;
}

/* --- Gratulacje po 50. poziomie --- */
.duel-unlock {
    display: grid;
    gap: 0.5rem;
    text-align: center;
}

.duel-unlock h2 {
    margin: 0;
    font-family: var(--font-title);
    font-weight: 400;
    font-size: 1.75rem;
}

.duel-unlock p {
    margin: 0;
}

.duel-unlock-trophy {
    font-size: 3.5rem;
    line-height: 1;
    animation: duel-trophy 1.6s ease-in-out infinite;
}

.duel-unlock-lead {
    font-weight: 700;
    font-size: 1.1rem;
}

.duel-unlock-perks {
    display: grid;
    gap: 0.375rem;
    margin: 0.25rem 0;
    padding: 0.625rem 0.75rem;
    list-style: none;
    border: 1px solid var(--shop-border-color);
    border-radius: 8px;
    background: var(--shop-info-background);
    text-align: left;
    font-size: 0.875rem;
}

.duel-unlock-actions {
    display: grid;
    gap: 0.5rem;
}

.duel-unlock-actions button {
    min-height: 3rem;
}

@keyframes duel-trophy {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-6px) rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
    .duel-unlock-trophy { animation: none; }
}

/* Przyciski akcji w oknie lobby (zamknij lobby, wycofaj prośbę, akceptuj/odrzuć) — wyśrodkowane. */
#duel-body .modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

#duel-body .modal-actions button {
    min-width: 11rem;
}
