.party-main {
    align-items: flex-start;
    padding: clamp(1rem, 3vh, 2rem) 0;
}

.party-container {
    width: min(960px, calc(100% - 2rem));
    max-width: 960px;
    padding: clamp(1rem, 3vw, 2rem);
    overflow: hidden;
    text-align: left;
    background:
        radial-gradient(ellipse at 95% 0%, rgba(16, 167, 126, 0.12), transparent 36%),
        linear-gradient(145deg, rgba(13, 25, 30, 0.98), rgba(17, 38, 42, 0.97));
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.32),
        inset 0 1px rgba(255, 255, 255, 0.04);
}

.party-lobby-hero,
.party-heading {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

.party-lobby-heading,
.party-heading > div {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.party-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.45rem;
    color: #80ddbd;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.party-eyebrow span {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #5ee6b4;
    box-shadow: 0 0 12px rgba(94, 230, 180, 0.8);
}

.party-lobby-title {
    margin: 0;
    color: #f5fffb;
    font-size: clamp(1.5rem, 2.4vw, 1.85rem);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.12;
    text-shadow: none;
}

.party-lobby-intro,
.party-heading-copy {
    margin: 0.45rem 0 0;
    color: rgba(226, 244, 238, 0.68);
    font-size: 0.88rem;
    line-height: 1.45;
}

.party-lobby-art,
.party-heading-art {
    display: block;
    width: clamp(110px, 17vw, 165px);
    max-width: 28%;
    height: auto;
    flex: 0 0 auto;
    margin: 0;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.2));
}

.party-header {
    display: block;
    margin: 0.75rem 0 1rem;
    font-size: 1rem;
}

.party-code-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(112, 220, 184, 0.2);
    border-radius: 14px;
    background: linear-gradient(105deg, rgba(21, 65, 57, 0.52), rgba(13, 34, 37, 0.62));
}

.party-code-meta {
    min-width: 0;
}

.party-code-label {
    color: rgba(224, 246, 237, 0.66);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.party-code-hint {
    margin-top: 0.25rem;
    color: rgba(220, 240, 231, 0.56);
    font-size: 0.75rem;
    line-height: 1.35;
}

.party-code-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 0 0 auto;
}

#party-code {
    color: #a4f6d7;
    cursor: pointer;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.11em;
}

#copy-party-link-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(183, 244, 220, 0.7);
    border-radius: 10px;
    background: #b7f4dc;
    color: #09251e;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: none;
    white-space: nowrap;
}

#copy-party-link-btn::before {
    content: none;
}

#copy-party-link-btn:hover {
    transform: translateY(-1px);
    border-color: #d6ffed;
    background: #d0ffeb;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.invite-link-icon {
    width: 13px;
    height: 13px;
    display: inline-block;
    position: relative;
    flex: 0 0 13px;
    border: 1.5px solid currentColor;
    border-radius: 4px;
}

.invite-link-icon::after {
    content: "";
    width: 6px;
    height: 6px;
    position: absolute;
    top: -3px;
    right: -4px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    background: #b7f4dc;
}

.party-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
}

.party-container.team-mode .party-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.party-section,
.party-container.ffa-layout .party-section {
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 0;
    padding: 0.9rem;
    border: 1px solid rgba(194, 238, 221, 0.11);
    border-radius: 13px;
    background: rgba(5, 18, 21, 0.45);
    text-align: left;
}

.party-section.players {
    min-height: 0;
}

.party-section:hover {
    transform: none;
    border-color: rgba(116, 226, 190, 0.24);
    background: rgba(7, 24, 26, 0.6);
}

.party-section h3 {
    margin-bottom: 0.65rem;
    color: #e4fff4;
    font-size: 0.85rem;
    font-weight: 750;
    letter-spacing: 0.04em;
}

.party-section h3.blue-team {
    color: #8ccfff;
}

.party-section h3.red-team {
    color: #ff9e9e;
}

.players-loading {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
    min-height: 0;
    gap: 0.45rem;
}

.players-loading .player-skeleton,
.players ul li.player-skeleton {
    height: 38px;
    border: 1px solid rgba(194, 238, 221, 0.06);
    border-radius: 9px;
    background: rgba(123, 255, 200, 0.07);
}

.players ul {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
    gap: 0.45rem;
}

.party-container.ffa-layout .players ul,
.party-container.team-mode .players ul {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
    justify-content: stretch;
    gap: 0.45rem;
}

.players ul li {
    min-width: 0;
    padding: 0.6rem 0.65rem;
    border: 1px solid rgba(202, 237, 224, 0.08);
    border-radius: 9px;
    background: rgba(229, 255, 244, 0.045);
    font-family: inherit;
    font-size: 0.84rem;
    cursor: default;
}

.players ul li:hover {
    transform: none;
    background: rgba(229, 255, 244, 0.08);
}

.players ul li.host {
    border-color: rgba(255, 209, 116, 0.3);
    background: rgba(255, 209, 116, 0.055);
    box-shadow: none;
}

.players ul li .left {
    min-width: 0;
    gap: 0.45rem;
}

.players ul li .username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.players ul li .points {
    flex: 0 0 auto;
    color: rgba(225, 243, 235, 0.55);
    font-size: 0.72rem;
}

.player-avatar-button {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.player-avatar {
    width: 34px;
    height: 34px;
    display: block;
    flex: 0 0 34px;
    border: 2px solid #55d7a7;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(4, 15, 16, 0.9);
    transition:
        filter 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.player-avatar.offline {
    border-color: #899496;
    filter: grayscale(1) brightness(0.82) contrast(1.1);
    box-shadow:
        0 0 0 2px #05090a,
        0 0 0 3px rgba(227, 235, 232, 0.85);
}

.player-avatar-button:hover .player-avatar {
    box-shadow:
        0 0 0 2px rgba(4, 15, 16, 0.9),
        0 0 0 4px rgba(85, 215, 167, 0.25);
}

.party-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.party-footer button {
    width: auto;
    min-height: 34px;
    padding: 0.45rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}

.party-footer button:hover {
    transform: translateY(-1px);
}

.party-footer .secondary {
    border-color: rgba(197, 220, 211, 0.16);
    background: rgba(197, 220, 211, 0.08);
    color: #d4e2dd;
}

.party-footer .secondary:hover {
    border-color: rgba(197, 220, 211, 0.3);
    background: rgba(197, 220, 211, 0.14);
}

.party-footer .primary {
    border-color: #55d7a7;
    background: #55d7a7;
    color: #08251c;
}

.party-footer .primary:hover {
    border-color: #76e8bb;
    background: #76e8bb;
}

.party-footer .rejoin {
    border-color: #6caae9;
    background: #6caae9;
    color: #071b30;
    box-shadow: none;
}

.party-footer .rejoin:hover {
    border-color: #8bc2f5;
    background: #8bc2f5;
}

.party-footer .danger {
    border-color: rgba(237, 115, 115, 0.34);
    background: rgba(130, 39, 45, 0.22);
    color: #f2b5b5;
    box-shadow: none;
}

.party-footer .danger:hover {
    border-color: rgba(237, 115, 115, 0.6);
    background: rgba(160, 48, 55, 0.34);
}

.party-footer #kick-offline-btn {
    border-color: rgba(229, 183, 101, 0.32);
    background: rgba(130, 91, 35, 0.2);
    color: #e9ca91;
}

.party-footer #kick-offline-btn:hover {
    border-color: rgba(229, 183, 101, 0.56);
    background: rgba(150, 104, 38, 0.3);
}

.party-footer #kick-all-btn {
    border-color: rgba(236, 139, 91, 0.38);
    background: rgba(140, 65, 37, 0.24);
    color: #f0b394;
}

.party-footer #kick-all-btn:hover {
    border-color: rgba(236, 139, 91, 0.65);
    background: rgba(162, 74, 42, 0.36);
}

.party-dashboard-actions {
    display: flex;
}

.party-dashboard-actions button {
    width: auto;
    margin: 0;
}

.party-dashboard-actions #disband-btn {
    margin-left: auto;
}

@media (max-width: 700px) {
    .party-main {
        padding: 0.75rem 0 1rem;
    }

    .party-container {
        width: calc(100% - 1.25rem);
        padding: 1rem;
    }

    .party-lobby-title {
        font-size: clamp(1.35rem, 5vw, 1.55rem);
    }

    .party-heading-art,
    .party-lobby-art {
        display: block;
        width: 25%;
        max-width: 110px;
    }

    .party-code-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.65rem;
        padding: 0.75rem;
    }

    .party-code-actions {
        width: 100%;
        justify-content: space-between;
    }

    .party-footer button {
        width: auto;
    }
}

@media (max-width: 520px) {
    .party-container.team-mode .party-body {
        grid-template-columns: 1fr;
    }

    .party-container.ffa-layout .players ul,
    .party-container.team-mode .players ul,
    .players ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.app-modal-panel.settings-modal {
    width: min(96vw, 64rem);
    max-height: min(88vh, 52rem);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 0.7rem;
    padding: clamp(1.25rem, 2.5vw, 2rem);
    overflow-y: auto;
    border-color: rgba(112, 220, 184, 0.22);
    border-radius: 16px;
    background:
        radial-gradient(ellipse at 95% 0%, rgba(16, 167, 126, 0.1), transparent 36%),
        linear-gradient(145deg, #101d21, #14282b);
    text-align: left;
    scrollbar-color: rgba(94, 230, 180, 0.55) rgba(255, 255, 255, 0.06);
}

.app-modal-panel.settings-modal h2 {
    grid-column: 1 / -1;
    margin: 0 2rem 0.2rem 0;
    color: #f2fff9;
    font-size: 1.35rem;
    text-align: left;
}

.app-modal-panel.settings-modal .setting-group {
    min-width: 0;
    min-height: 5.1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(194, 238, 221, 0.1);
    border-radius: 11px;
    background: rgba(5, 18, 21, 0.48);
}

.app-modal-panel.settings-modal .setting-group#map-setting {
    grid-column: span 2;
}

.app-modal-panel.settings-modal .setting-group:hover {
    border-color: rgba(116, 226, 190, 0.24);
    background: rgba(7, 24, 26, 0.64);
}

.app-modal-panel.settings-modal .setting-group.disabled,
.app-modal-panel.settings-modal .setting-group.disabled:hover {
    border-color: rgba(194, 238, 221, 0.07);
    background: rgba(5, 18, 21, 0.32);
}

.app-modal-panel.settings-modal .setting-group label {
    flex: 0 0 auto;
    margin: 0;
    color: #a8dbc8;
    font-size: 0.78rem;
    line-height: 1.3;
    white-space: normal;
}

.app-modal-panel.settings-modal .setting-group.disabled label {
    color: rgba(168, 219, 200, 0.42);
}

.app-modal-panel.settings-modal .custom-dropdown,
.app-modal-panel.settings-modal .map-selection-control {
    width: 100%;
    min-width: 0;
    flex: 1;
}

.app-modal-panel.settings-modal .dropdown-selected,
.app-modal-panel.settings-modal input[type="number"] {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 2.4rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(159, 255, 220, 0.16);
    border-radius: 8px;
    background: rgba(5, 14, 18, 0.72);
    color: #f4fff9;
    font: inherit;
    font-size: 0.86rem;
}

.app-modal-panel.settings-modal .dropdown-selected:hover {
    border-color: rgba(94, 230, 180, 0.55);
    background: rgba(8, 22, 25, 0.92);
    box-shadow: none;
}

.app-modal-panel.settings-modal .map-selection-control {
    gap: 0.55rem;
}

.app-modal-panel.settings-modal .map-selection-summary {
    flex: 1 1 auto;
}

.app-modal-panel.settings-modal .map-picker-trigger {
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: rgba(94, 230, 180, 0.1);
    color: #b8edd7;
    font-size: 0.75rem;
    white-space: nowrap;
}

.app-modal-panel.settings-modal .toggle-setting {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.app-modal-panel.settings-modal .toggle-setting label {
    flex: 1 1 auto;
}

.app-modal-panel.settings-modal .toggle-setting input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0;
    accent-color: #55d7a7;
}

.app-modal-panel.settings-modal #save-settings-btn {
    grid-column: 3;
    justify-self: end;
    align-self: end;
    width: 100%;
    min-height: 2.6rem;
    height: auto;
    margin: 0;
    padding: 0.55rem 1rem;
    border: 1px solid #55d7a7;
    border-radius: 9px;
    background: #55d7a7;
    color: #08251c;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: none;
}

.app-modal-panel.settings-modal #save-settings-btn:hover {
    transform: translateY(-1px);
    border-color: #76e8bb;
    background: #76e8bb;
    box-shadow: none;
}

@media (max-width: 800px) {
    .app-modal-panel.settings-modal {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-modal-panel.settings-modal .setting-group#map-setting {
        grid-column: 1 / -1;
    }

    .app-modal-panel.settings-modal #save-settings-btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .app-modal-panel.settings-modal {
        width: min(96vw, 32rem);
        max-height: 90vh;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.55rem;
        padding: 1.1rem;
    }

    .app-modal-panel.settings-modal h2,
    .app-modal-panel.settings-modal .setting-group#map-setting,
    .app-modal-panel.settings-modal #save-settings-btn {
        grid-column: 1;
    }

    .app-modal-panel.settings-modal .setting-group {
        min-height: 4.6rem;
    }
}
