/* ============ SETTINGS PANEL ============ */
/* Open-space design: structure comes from typography, spacing and
   hairline dividers — not boxes. Groups are unboxed; only rows
   carry hairlines, and only between siblings. */

.settings-panel {
    width: 640px;
    max-height: 820px;
    height: auto;
    display: none;
    flex-direction: column;
    margin: 40px auto;
}

.settings-panel.active {
    display: flex;
}

.settings-window {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.settings-top {
    flex-shrink: 0;
}

.settings-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

.settings-eyebrow::before {
    content: '';
    width: 22px;
    height: 1px;
    background: var(--accent);
}

.settings-top h1 {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--white);
    margin-top: 10px;
}

.settings-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    margin-bottom: 26px;
    max-width: 460px;
    line-height: 1.55;
}

.settings-tabs {
    display: flex;
    gap: 22px;
    border-bottom: 1px solid var(--border);
}

.settings-tabs button {
    height: 36px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    position: relative;
    cursor: pointer;
    transition: color var(--speed) var(--curve);
}

.settings-tabs button:hover {
    color: var(--text);
}

.settings-tabs button.active {
    color: var(--text);
}

.settings-tabs button.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.settings-scroll {
    flex: 1;
    overflow-y: auto;
    padding-top: 30px;
    padding-right: 8px;
    margin-right: -8px;
}

.settings-scroll::-webkit-scrollbar {
    width: 5px;
}

.settings-scroll::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 20px;
}

.settings-page {
    display: none;
    flex-direction: column;
    gap: 24px;
}

.settings-page.active {
    display: flex;
}

/* open groups: mono eyebrow + caption + hairline-divided rows */
.settings-group {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px 20px 8px;
}

.settings-group h3 {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    color: var(--muted-dim);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 12px 0 2px;
}

.settings-group .theme-section-caption {
    padding: 0 0 8px;
}

.setting-row {
    min-height: 52px;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--border);
}

.setting-row:first-of-type {
    border-top: none;
}

.setting-row:last-child {
    padding-bottom: 6px;
}

.setting-row.vertical {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 0;
}

.row-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.row-info span {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
}

.row-info small {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--muted-dim);
}

/* danger zone — quiet, but unmistakably separate */
.settings-group.danger-zone {
    border-color: var(--danger-border);
}

.settings-group.danger-zone h3 {
    color: var(--danger);
}

.row-info span.danger-text {
    color: var(--danger);
}

/* ============ SWITCH ============ */

.switch {
    width: 36px;
    height: 21px;
    border-radius: 50px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: background var(--speed) var(--curve),
               border-color var(--speed) var(--curve);
}

.switch::before {
    content: '';
    width: 15px;
    height: 15px;
    position: absolute;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform var(--speed) var(--curve),
               background var(--speed) var(--curve);
}

.switch.on {
    background: var(--accent-dim);
    border-color: var(--accent);
}

.switch.on::before {
    transform: translateX(15px);
    background: var(--accent);
}

/* ============ SELECT (dropdown pill) ============ */

.select {
    height: 33px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    color: var(--text);
    font-size: 12.5px;
    cursor: pointer;
    transition: background var(--speed) var(--curve),
               border-color var(--speed) var(--curve);
}

.select:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
}

.select svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============ SMALL BUTTON ============ */

.small-button {
    font-size: 12px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
    flex-shrink: 0;
    cursor: pointer;
    transition: background var(--speed) var(--curve),
               border-color var(--speed) var(--curve);
}

.small-button:hover {
    background: var(--surface-3);
    border-color: var(--accent);
}

.small-button.danger {
    background: var(--surface-2);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.small-button.danger:hover {
    background: var(--danger-dim);
    border-color: var(--danger-border);
}

/* ============ BADGE ============ */

.badge {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px 9px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 960px) {
    .settings-panel {
        width: 100%;
        height: auto;
        margin: 20px auto;
    }
}

@media (max-width: 560px) {
    .settings-panel {
        margin: 12px auto;
    }

    .settings-scroll {
        padding-right: 0;
        margin-right: 0;
    }

    .settings-tabs {
        gap: 16px;
    }

    .setting-row {
        flex-wrap: wrap;
    }

    .panic-input {
        width: 100%;
    }
}

.hide-scrollbars * {
    scrollbar-width: none;
}

.hide-scrollbars *::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* small credit card */

.credit-mini {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: calc(100% - 24px);
    margin: 10px auto;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    border: 1px solid var(--border);
    box-sizing: border-box;
    overflow: hidden;
}

.credit-mini-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.credit-mini-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.credit-mini-info strong {
    font-size: 14px;
    font-weight: 600;
}

.credit-mini-info span {
    font-size: 11.5px;
    color: var(--muted-dim);
}

.credit-mini-role {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted-dim);
    white-space: nowrap;
}

/* footer */

.about-footer {
    text-align: center;
    color: var(--muted-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 14px 0 4px;
}

.dev-link {
    cursor: pointer;
    transition: color var(--speed) var(--curve);
}

.dev-link:hover {
    color: var(--muted);
}

.cloak-select {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 9px 13px;
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    transition: border-color var(--speed) var(--curve);
}

.cloak-select:hover {
    border-color: var(--border-strong);
}

.cloak-select:focus {
    border-color: var(--accent);
}

.cloak-select option {
    background: var(--sidebar);
    color: var(--text);
}

.panic-input {
    width: 216px;
    height: 40px;
    padding: 0 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    outline: none;
    font-family: var(--font-body);
    font-size: 13.5px;
    transition: border-color var(--speed) var(--curve);
}

.panic-input:focus {
    border-color: var(--accent);
}

.panic-key-button {
    width: 216px;
    height: 40px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background var(--speed) var(--curve),
               border-color var(--speed) var(--curve);
}

.panic-key-button:hover {
    background: var(--surface-3);
    border-color: var(--accent);
}

#screen-privacy-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--speed) var(--curve);
}

#screen-privacy-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#screen-privacy-overlay.black {
    background: #000;
}

#screen-privacy-overlay.blur {
    backdrop-filter: blur(25px);
    background: rgba(6, 6, 5, .7);
}

#screen-privacy-overlay.blank {
    background: #fff;
}

.performance-mode {
    --speed: .001s;
    --speed-slow: .001s;
}

.performance-mode * {
    animation-duration: .001s !important;
    transition-duration: .001s !important;
}

.performance-mode .background-effect,
.performance-mode canvas {
    display: none !important;
}

/* blur/backdrop-filter is one of the most expensive effects —
   disable it everywhere under Performance Mode */
.performance-mode * ,
.performance-mode *::before,
.performance-mode *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* large decorative shadows are composited every frame while
   animated elements move — flatten them (focus rings survive:
   they are outline/box-shadow on :focus-visible, kept below) */
.performance-mode .modal-card,
.performance-mode .acct-modal,
.performance-mode .acct-popover,
.performance-mode .games-collect-popover,
.performance-mode .mention-popover,
.performance-mode .reaction-popover,
.performance-mode .changelog-modal,
.performance-mode .player-modal,
.performance-mode .details-poster,
.performance-mode .ui-error,
.performance-mode .watch-hero,
.performance-mode .game-thumb img,
.performance-mode .movie-card img,
.performance-mode .details-poster {
    box-shadow: none !important;
    text-shadow: none !important;
}

.reset-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 6, 5, .7);
    backdrop-filter: blur(8px);
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--speed) var(--curve);
}

.reset-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.reset-card {
    width: 360px;
    padding: 26px;
    border-radius: 14px;
    background: var(--sidebar);
    border: 1px solid var(--border-strong);
}

.reset-card h2 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--white);
}

.reset-card p {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.55;
}

.reset-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.ai-personality-input {
    width: 100%;
    min-height: 112px;
    resize: vertical;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 13px;
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color var(--speed) var(--curve);
}

.ai-personality-input:focus {
    border-color: var(--accent);
}