/* ปาร์ตี้ + คำชวนเข้าปาร์ตี้ */
.party-invite-root {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
        max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.party-invite-root.open {
    pointer-events: auto;
    opacity: 1;
}

.party-invite-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, rgba(20, 28, 36, 0.72) 0%, rgba(0, 0, 0, 0.78) 70%);
}

.party-invite-sheet {
    position: relative;
    width: min(92vw, 320px);
    padding: 16px;
    border-radius: 10px;
    background: linear-gradient(180deg, #3a2e24 0%, #1e1612 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.party-invite-title {
    margin: 0 0 8px;
    font-size: var(--text-lg);
    font-weight: bold;
    color: var(--px-gold);
}

.party-invite-text {
    margin: 0 0 14px;
    font-size: var(--text-sm);
    color: #f5e6d3;
    line-height: 1.4;
}

.party-invite-actions {
    display: flex;
    gap: 8px;
}

.party-invite-actions .pixel-btn {
    flex: 1;
}

.party-root {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
        max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.party-root.open {
    pointer-events: auto;
    opacity: 1;
}

.party-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.party-panel {
    position: relative;
    width: min(94vw, 380px);
    max-height: min(80vh, 560px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(180deg, #3a2e24 0%, #1e1612 40%, #120e0a 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.party-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px 8px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.35);
}

.party-title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: bold;
    color: var(--px-gold);
}

.party-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 8px 10px 12px;
}

.party-empty {
    margin: 16px 8px;
    text-align: center;
    color: rgba(245, 230, 211, 0.65);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.party-bonus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(141, 110, 99, 0.35);
    background: rgba(0, 0, 0, 0.28);
}

.party-bonus-label {
    font-size: var(--text-xs);
    color: rgba(245, 230, 211, 0.7);
}

.party-bonus-value {
    font-size: var(--text-sm);
    font-weight: bold;
    color: rgba(245, 230, 211, 0.55);
    white-space: nowrap;
}

.party-bonus.is-active .party-bonus-value {
    color: #81c784;
}

.party-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.party-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(141, 110, 99, 0.35);
    background: rgba(0, 0, 0, 0.28);
    color: #f5e6d3;
    cursor: pointer;
}

.party-row:hover:not(:disabled),
.party-row:focus-visible:not(:disabled) {
    border-color: rgba(255, 213, 79, 0.45);
    background: rgba(255, 213, 79, 0.08);
}

.party-row.is-static,
.party-row:disabled {
    cursor: default;
    opacity: 1;
}

.party-row-name {
    grid-column: 1;
    font-weight: bold;
    font-size: var(--text-sm);
}

.party-row-meta {
    grid-column: 2;
    grid-row: 1;
    font-size: var(--text-xs);
    color: var(--px-gold);
}

.party-row-loc {
    grid-column: 1;
    grid-row: 2;
    font-size: var(--text-xs);
    color: rgba(245, 230, 211, 0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.party-row-role {
    grid-column: 2;
    grid-row: 2;
    font-size: var(--text-xs);
    font-weight: bold;
    color: rgba(245, 230, 211, 0.7);
    text-align: right;
}

.party-row.is-leader .party-row-role {
    color: #81c784;
}

.party-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px 12px;
    border-top: 2px solid rgba(0, 0, 0, 0.35);
}

.party-action-root {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.party-action-root.open {
    pointer-events: auto;
    opacity: 1;
}

.party-action-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.party-action-sheet {
    position: relative;
    z-index: 1;
    width: min(86vw, 280px);
    padding: 14px;
    border-radius: 10px;
    background: linear-gradient(180deg, #3a2e24 0%, #1e1612 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.party-action-title {
    margin: 0 0 12px;
    font-size: var(--text-md);
    font-weight: bold;
    color: var(--px-gold);
}

.party-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
