/* Settings page */
.brb-explain { margin: 12px 0 4px; }
.brb-explain h3 { margin: 0 0 8px; }
.brb-explain ol { margin: 0 0 14px; padding-left: 1.3em; line-height: 1.6; text-align: left; }
.brb-default-words { display: block; opacity: .85; margin-top: 6px; }
.brb-explain {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

main.brb .be-card {
    background: var(--module-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    padding: 10px 12px 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow: visible;
    margin-bottom: 16px;
}

main.brb .be-card-title {
    letter-spacing: 0.09em;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--input-border);
    color: var(--link-color);
}

main.brb .be-card:has(.choices.is-open) {
    overflow: visible;
    z-index: 5;
    position: relative;
}

main.brb .be-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: start;
    gap: 4px 10px;
    margin-bottom: 10px;
}

main.brb .be-row:last-child {
    margin-bottom: 0;
}

main.brb .be-row > label {
    padding-top: 5px;
    margin: 0;
}

main.brb .be-row > .be-controls {
    display: block;
}

main.brb .be-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

main.brb .be-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

main.brb .be-field-label {
    opacity: 0.85;
    white-space: nowrap;
    font-size: 0.85rem;
    margin: 0;
}

main.brb .be-field input[type=number] {
    width: 90px;
}

main.brb .be-field input[type=text] {
    width: 80px;
}

main.brb .be-field--grow {
    flex: 1 1 200px;
}

main.brb .be-field--grow input[type=text] {
    flex: 1;
    width: auto;
}

main.brb .be-row textarea {
    width: 100%;
    box-sizing: border-box;
}

main.brb .be-row small {
    display: block;
    opacity: 0.7;
    font-size: 0.8rem;
    margin-top: 4px;
    line-height: 1.4;
}

@media (max-width: 700px) {
    main.brb .be-row {
        grid-template-columns: 1fr;
    }
}

main.brb .hw-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

main.brb .hw-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

main.brb .hw-row .hw-word {
    flex: 0 0 160px;
}

main.brb .hw-row .hw-hint {
    flex: 1;
    min-width: 0;
}

main.brb .hw-count {
    flex: 0 0 auto;
    min-width: 3.4em;
    text-align: right;
    opacity: 0.6;
    font-size: 0.75rem;
}

main.brb .hw-del {
    flex: 0 0 auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    opacity: 0.75;
}

main.brb .hw-del:hover {
    opacity: 1;
}

main.brb .hw-total-badge {
    font-weight: normal;
    opacity: 0.6;
    font-size: 0.8em;
}

main.brb .hw-list-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

@media (max-width: 700px) {
    main.brb .hw-row {
        flex-wrap: wrap;
    }

    main.brb .hw-row .hw-word {
        flex: 1 1 100%;
    }
}


:root {
    --brb-accent: #fb7c3c;
    --brb-accent-rgb: 251, 124, 60;
}

#brb-root {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    box-sizing: border-box;
    font-family: 'SalmaProMedium', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--brb-text, #fff);
    overflow: hidden;
}

#brb-stage {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: center;
}

.brb-game {
    width: 100%;
    text-align: center;
    background: rgba(var(--brb-bg-rgb, 15, 13, 20), var(--brb-bg-opacity, 0.72));
    border: 2px solid rgba(var(--brb-border-rgb, 251, 124, 60), 0.5);
    border-radius: var(--brb-radius, 25px);
    padding: clamp(20px, 4vw, 40px);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
    animation: brb-pop 0.35s ease;
}

@keyframes brb-pop {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.brb-title {
    margin: 0 0 0.4em;
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    line-height: 1.05;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.7);
    color: var(--brb-accent, #fb7c3c);
}

.brb-sub {
    margin: 0 0 0.8em;
    font-size: clamp(1.1rem, 2.6vw, 1.6rem);
    color: #e7e8ee;
}

.brb-cmd {
    color: var(--brb-accent);
    font-weight: 700;
    padding: 0 0.2em;
}

/* Chat-Rennen: Join-Phase */
.brb-countdown {
    font-size: clamp(2.6rem, 8vw, 5rem);
    font-weight: 700;
    color: var(--brb-accent);
    line-height: 1;
    margin: 0.2em 0 0.4em;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
}

.brb-count-unit {
    font-size: 0.4em;
    opacity: 0.8;
    margin-left: 0.1em;
}

.brb-players {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 12px;
}

.brb-player-chip {
    background: rgba(var(--brb-accent-rgb), 0.18);
    border: 1px solid rgba(var(--brb-accent-rgb), 0.55);
    color: #fff;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: clamp(0.95rem, 2vw, 1.2rem);
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.brb-player-chip.in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Chat-Rennen: Lauf-Phase */
.brb-track-wrap {
    position: relative;
    max-height: 46vh;
    overflow: hidden;
    margin-top: 18px;
    border-radius: 14px;
}

.brb-track-wrap.has-overflow::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 15%;
    min-height: 36px;
    background: linear-gradient(to bottom, transparent, rgba(var(--brb-bg-rgb, 15, 13, 20), 0.92));
    pointer-events: none;
}

.brb-track {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brb-field-count {
    margin: 8px 0 0;
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    color: rgba(255, 255, 255, 0.6);
}

.brb-lane {
    display: grid;
    grid-template-columns: minmax(90px, 22%) 1fr;
    align-items: center;
    gap: 12px;
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.brb-lane-name {
    text-align: right;
    font-size: clamp(0.9rem, 1.9vw, 1.15rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brb-lane-rail {
    position: relative;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.brb-runner {
    position: absolute;
    top: 50%;
    left: 0;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border-radius: 50%;
    background: var(--brb-accent);
    box-shadow: 0 0 12px rgba(var(--brb-accent-rgb), 0.9);
}

.brb-runner.finished {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 1px;
}

/* Platzierungen */
.brb-results .brb-title {
    margin-bottom: 16px;
}

.brb-place-scroll {
    max-height: 56vh;
    overflow: hidden;
}

.brb-place-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brb-place {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    font-size: clamp(1rem, 2.6vw, 1.5rem);
}

.brb-place.first {
    background: rgba(var(--brb-accent-rgb), 0.22);
    border: 1px solid var(--brb-accent);
}

.brb-place-rank {
    min-width: 1.7em;
    text-align: right;
    font-weight: 700;
    color: var(--brb-accent);
}

.brb-place.first .brb-place-rank {
    color: #fff;
}

.brb-place-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

.brb-place-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hangman */
.brb-word {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: calc(8px * var(--brb-word-scale, 1)) calc(12px * var(--brb-word-scale, 1));
    margin: 18px 0;
}

.brb-char {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    min-width: 0.8em;
    font-size: calc(clamp(2rem, 6vw, 3.4rem) * var(--brb-word-scale, 1));
    font-weight: 700;
    line-height: 1;
    border-bottom: 4px solid rgba(255, 255, 255, 0.55);
    padding: 0 4px 6px;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.7);
}

.brb-char.brb-rev {
    color: var(--brb-accent);
    border-bottom-color: var(--brb-accent);
    animation: brb-reveal 0.3s ease;
}

.brb-char.brb-sep {
    border-bottom: none;
}

@keyframes brb-reveal {
    from { transform: translateY(-6px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.brb-lives {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 6px 0;
}

.brb-life {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(80, 200, 120, 0.85);
    box-shadow: 0 0 8px rgba(80, 200, 120, 0.5);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.brb-life.lost {
    background: rgba(229, 70, 70, 0.9);
    box-shadow: none;
}

.brb-wrong {
    min-height: 1.4em;
    margin-top: 8px;
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    letter-spacing: 0.06em;
    color: #ff9a9a;
}

.brb-help {
    margin: 10px 0 0;
    font-size: clamp(0.85rem, 1.8vw, 1.05rem);
    opacity: 0.7;
}

/* Gewinner-/Ergebnis-Banner */
#brb-banner {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#brb-banner.show {
    opacity: 1;
}

.brb-win {
    text-align: center;
    background: rgba(var(--brb-bg-rgb, 15, 13, 20), 0.82);
    border: 3px solid var(--brb-border, #fb7c3c);
    border-radius: var(--brb-radius, 25px);
    padding: clamp(24px, 5vw, 48px) clamp(36px, 8vw, 80px);
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.6);
    animation: brb-pop 0.4s ease;
}

.brb-win-label {
    display: block;
    font-size: clamp(1rem, 2.4vw, 1.4rem);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #c9cbd3;
    margin-bottom: 0.3em;
}

.brb-win-name {
    display: block;
    font-size: clamp(2.2rem, 7vw, 4rem);
    font-weight: 700;
    color: var(--brb-accent);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    word-break: break-word;
}

.brb-win.brb-lose {
    border-color: #e54646;
}

.brb-win.brb-lose .brb-win-name {
    color: #ff8d8d;
}