.header-spacer {
    height: 8px
}

.players {
    margin-top: var(--gap-lg)
}

.hint {
    margin-top: 8px
}

/* Room title row */

.room-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.room-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-title-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.copied-tag {
    margin: 0;
    white-space: nowrap;
}

/* Icon buttons */

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--bd);
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    line-height: 1;
    font-size: 20px;
    cursor: pointer;
}

.icon-btn:hover {
    filter: none;
    background: rgba(255, 255, 255, .05);
}

.icon-btn.danger {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, .4);
    font-size: 22px;
    font-weight: 700;
}

.icon-btn.danger:hover {
    background: rgba(255, 107, 107, .12);
}

/* Participant row */

.player-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: grid;
    gap: 12px;
}

.player-list .player-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--panel);
    border: 1px solid var(--bd);
    border-radius: 12px;
    cursor: default;
    transition: border-color .2s, background .2s;
}

.player-pass {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
}

.player-pass:hover {
    filter: none;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.player-pass .name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-email {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.chip {
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--bd);
    background: transparent;
    color: var(--ink);
    font-weight: 700;
    font-size: var(--fs-sm);
    box-shadow: none;
    cursor: pointer;
}

.chip:hover {
    filter: none;
    background: rgba(255, 255, 255, .05);
}

.chip.active-me {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: transparent;
}

.chip.active-me:hover {
    background: var(--accent);
}

/* Add participant */

.add-player-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px dashed var(--bd);
    background: transparent;
    color: var(--ink);
    font-weight: 700;
    box-shadow: none;
    cursor: pointer;
}

.add-player-btn:hover {
    filter: none;
    border-color: var(--accent);
    color: var(--accent);
}

.add-player-btn .plus {
    font-size: 20px;
    line-height: 1;
}

.you-tag {
    color: var(--muted);
    font-weight: 600;
    font-size: var(--fs-sm);
    margin-left: 6px;
}

/* Avatars */

.avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: hsl(var(--h, 220) 55% 45%);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: .3px;
    text-transform: uppercase;
    user-select: none;
}

.avatar-lg {
    width: 52px;
    height: 52px;
    font-size: 19px;
}

/* Ball holder banner */

.ball-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: var(--gap);
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--bd);
    background: var(--panel);
    transition: border-color .2s, background .2s;
}

.ball-banner.has-holder {
    border-color: rgba(255, 122, 0, .55);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255, 122, 0, .14), transparent 60%),
        var(--panel);
    box-shadow: 0 0 0 1px rgba(255, 122, 0, .12) inset;
}

.ball-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.ball-banner-label {
    color: var(--muted);
    font-size: var(--fs-sm);
    line-height: 1.3;
}

.ball-banner-name {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-size: var(--fs-lg);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ball-banner-name.muted {
    color: var(--muted);
    font-weight: 700;
}

.banner-ball {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%, #fff 0 12%, transparent 13%),
        var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 122, 0, .16), 0 6px 14px rgba(255, 122, 0, .3);
    animation: ball-bob 1.6s ease-in-out infinite;
}

.banner-ball.idle {
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .5) 0 12%, transparent 13%),
        #2a3340;
    box-shadow: none;
    animation: none;
}

@keyframes ball-bob {
    0%, 100% { transform: translateY(0) }
    50% { transform: translateY(-6px) }
}

/* List item states */

.player-list .player-item.is-holder {
    border-color: rgba(255, 122, 0, .55);
    background:
        radial-gradient(140% 120% at 0% 50%, rgba(255, 122, 0, .12), transparent 55%),
        var(--panel);
}

.player-list .player-item.is-me .avatar {
    box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px rgba(255, 255, 255, .25);
}

/* Ball in list rows */

.ball-slot {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.rest-ball {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%, #fff 0 12%, transparent 13%),
        var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, .18);
}

.rest-ball.pop {
    animation: ball-pop .5s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes ball-pop {
    0% { transform: scale(0); opacity: 0 }
    60% { transform: scale(1.35) }
    100% { transform: scale(1); opacity: 1 }
}

/* Flying ball during a pass */

.fly {
    position: fixed;
    z-index: 60;
    width: 0;
    height: 0;
    pointer-events: none;
    transition: transform var(--fly-dur, 650ms) cubic-bezier(.4, 0, .2, 1);
}

.fly-ball {
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%, #fff 0 12%, transparent 13%),
        var(--accent);
    box-shadow: 0 6px 14px rgba(255, 122, 0, .4);
    transform: translate(-50%, -50%);
    animation:
        fly-hop var(--fly-dur, 650ms) ease-in-out,
        fly-spin var(--fly-dur, 650ms) linear;
}

@keyframes fly-hop {
    0% { transform: translate(-50%, -50%) }
    50% { transform: translate(-50%, calc(-50% - 46px)) }
    100% { transform: translate(-50%, -50%) }
}

@keyframes fly-spin {
    to { rotate: 540deg }
}

@media (prefers-reduced-motion: reduce) {
    .banner-ball,
    .rest-ball.pop,
    .fly,
    .fly-ball {
        animation: none;
        transition: none;
    }
}

/* Modal */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .6);
    animation: modal-fade .15s ease-out;
}

.modal-card {
    width: 100%;
    max-width: 440px;
    background: var(--panel);
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    animation: modal-pop .18s cubic-bezier(.34, 1.4, .64, 1);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-title {
    margin: 0;
    font-size: var(--fs-h2);
}

.modal-player {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    font-weight: 700;
}

.modal-confirm-text {
    margin: 12px 0 4px;
    color: var(--muted);
    font-size: var(--fs-sm);
    line-height: 1.45;
}

.btn-danger {
    background: #d64545;
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(1.08);
}

@keyframes modal-fade {
    from { opacity: 0 }
    to { opacity: 1 }
}

@keyframes modal-pop {
    from { opacity: 0; transform: translateY(8px) scale(.98) }
    to { opacity: 1; transform: none }
}

@media (max-width: 560px) {
    .player-item {
        flex-wrap: wrap;
    }

    .player-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
