/* ========================================
   PROFILE SETTINGS - Firewatch Theme
   Purple/wine/gold palette, dark sheet
   ======================================== */

/* ── Firewatch variables (re-declared for body-level modal) ── */
.ps-backdrop {
    --pf-deep-purple: #30122d;
    --pf-wine: #870734;
    --pf-accent: #ff9f43;
    --pf-accent-gold: #ffd700;
    --pf-ember: #ff6b35;
    --pf-text-primary: #ffffff;
    --pf-text-secondary: #ffd6bf;
    --pf-text-muted: rgba(255, 214, 191, 0.5);
    --pf-card-solid: rgba(48, 18, 45, 0.92);
    --pf-border-subtle: rgba(255, 214, 191, 0.12);
    --pf-border-accent: rgba(255, 159, 67, 0.3);
}

/* ── Backdrop ── */
.ps-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(30, 10, 25, 0.6);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: opacity 0.28s ease;
}

/* ── Bottom Sheet ── */
.ps-sheet {
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(180deg, rgba(48, 18, 45, 0.97) 0%, rgba(30, 12, 28, 0.99) 100%);
    box-shadow:
        0 -6px 40px rgba(135, 7, 52, 0.25),
        0 -2px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 159, 67, 0.15);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    color: var(--pf-text-primary);
}

.ps-sheet.ps-open {
    transform: translateY(0);
}

.ps-sheet.ps-closing {
    transform: translateY(100%);
    transition: transform 0.25s ease-in;
}

/* ── Drag Handle ── */
.ps-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 2px;
    cursor: grab;
}

.ps-handle-bar {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--pf-wine), var(--pf-accent));
    opacity: 0.6;
}

/* ── Header ── */
.ps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 20px 14px;
    border-bottom: 1px solid var(--pf-border-subtle);
}

.ps-header-title {
    font-family: 'Fredoka One', cursive, sans-serif;
    font-size: 22px;
    background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ps-header-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--pf-border-subtle);
    background: rgba(255, 214, 191, 0.08);
    color: var(--pf-accent);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ps-header-close:active {
    background: rgba(255, 159, 67, 0.15);
    transform: scale(0.9);
}

/* ── Scrollable Body ── */
.ps-body {
    overflow-y: auto;
    padding: 4px 0 40px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.ps-body::-webkit-scrollbar { width: 4px; }
.ps-body::-webkit-scrollbar-thumb { background: rgba(255, 159, 67, 0.2); border-radius: 2px; }

/* ── Section Headers ── */
.ps-section {
    font-family: 'Quicksand', sans-serif;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--pf-accent);
    padding: 20px 20px 6px;
    opacity: 0.8;
}

/* ── Row ── */
.ps-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    gap: 12px;
    border-bottom: 1px solid var(--pf-border-subtle);
}

.ps-row-col {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

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

.ps-row-label {
    font-weight: 700;
    font-size: 15px;
    color: var(--pf-text-primary);
}

.ps-row-sub {
    font-size: 12px;
    color: var(--pf-text-muted);
    line-height: 1.3;
}

/* ── Toggle Switch ── */
.ps-tog {
    position: relative;
    width: 48px;
    height: 28px;
    border-radius: 14px;
    border: 2px solid var(--pf-border-subtle);
    background: rgba(255, 214, 191, 0.08);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: all 0.3s ease;
}

.ps-tog-on {
    background: linear-gradient(135deg, var(--pf-wine), var(--pf-accent));
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(255, 159, 67, 0.3);
}

.ps-tog-dot {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ps-tog-on .ps-tog-dot {
    transform: translateX(20px);
}

/* ── Pill Buttons ── */
.ps-pills {
    display: flex;
    background: rgba(255, 214, 191, 0.08);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
    border: 1px solid var(--pf-border-subtle);
}

.ps-pill {
    padding: 6px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--pf-text-muted);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.ps-pill:active { transform: scale(0.94); }

.ps-pill-on {
    background: linear-gradient(135deg, var(--pf-wine), var(--pf-accent));
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 159, 67, 0.3);
}

/* ── Avatar Grid ── */
.ps-avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding-top: 6px;
}

.ps-avatar-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    border: 2.5px solid var(--pf-border-subtle);
    background: rgba(255, 214, 191, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.2s;
    padding: 0;
}

.ps-avatar-cell:active { transform: scale(0.88); }

.ps-avatar-selected {
    border-color: var(--pf-accent-gold) !important;
    background: rgba(255, 215, 0, 0.12);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2), 0 3px 10px rgba(255, 159, 67, 0.25);
}

/* ── Text Input ── */
.ps-text-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--pf-border-subtle);
    background: rgba(255, 214, 191, 0.06);
    color: var(--pf-text-primary);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.ps-text-input:focus {
    border-color: var(--pf-accent);
    box-shadow: 0 0 0 3px rgba(255, 159, 67, 0.12);
}

.ps-text-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Textarea ── */
.ps-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--pf-border-subtle);
    background: rgba(255, 214, 191, 0.06);
    color: var(--pf-text-primary);
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 60px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.ps-textarea:focus {
    border-color: var(--pf-accent);
}

.ps-textarea:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Hero Class Row ── */
.ps-hero-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 214, 191, 0.06);
    border: 1px solid var(--pf-border-subtle);
}

.ps-hero-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.ps-hero-info {
    flex: 1;
    min-width: 0;
}

.ps-hero-name {
    font-weight: 800;
    font-size: 15px;
    color: var(--pf-accent-gold);
}

.ps-hero-desc {
    font-size: 11px;
    color: var(--pf-text-muted);
    line-height: 1.3;
}

.ps-hero-change {
    padding: 6px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--pf-border-accent);
    background: transparent;
    color: var(--pf-accent);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ps-hero-change:active {
    background: rgba(255, 159, 67, 0.15);
    transform: scale(0.94);
}

/* ── Action Buttons ── */
.ps-act {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid var(--pf-border-subtle);
    transition: background 0.15s;
}

.ps-act:active {
    background: rgba(255, 159, 67, 0.06);
}

.ps-act-label {
    font-weight: 700;
    font-size: 15px;
    color: var(--pf-text-primary);
}

.ps-act-sub {
    font-size: 12px;
    color: var(--pf-text-muted);
}

.ps-act-danger .ps-act-label {
    color: #ef4444;
}

.ps-act-danger .ps-act-sub {
    color: rgba(239, 68, 68, 0.5);
}

.ps-act-primary {
    background: linear-gradient(135deg, var(--pf-wine), var(--pf-accent));
    border-radius: 12px;
    margin: 8px 20px;
    padding: 14px 20px;
    text-align: center;
    border-bottom: none;
    width: auto;
}

.ps-act-primary .ps-act-label {
    color: #fff;
    text-align: center;
}

.ps-act-primary .ps-act-sub {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.ps-act-primary:active {
    opacity: 0.85;
    transform: scale(0.98);
}

/* ── Guest Banner ── */
.ps-guest-banner {
    margin: 0 20px 4px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 159, 67, 0.1);
    border: 1px solid var(--pf-border-accent);
    font-size: 12px;
    color: var(--pf-text-secondary);
    text-align: center;
    line-height: 1.4;
}
