* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    background: #020202;
    color: #f2f2f2;
    font-family: "Courier New", monospace;
    overflow: hidden;
    --window-top: 15vh;
    --taskbar-clearance: 96px;
    --window-header-height: 42px;
}

/* SCRATCHES */
body::before {
    content: "";
    position: fixed;
    inset: 0;

    background:
        linear-gradient(
            105deg,
            transparent 35%,
            rgba(255,255,255,.02) 36%,
            transparent 37%
        ),
        linear-gradient(
            73deg,
            transparent 50%,
            rgba(255,255,255,.015) 51%,
            transparent 52%
        ),
        linear-gradient(
            22deg,
            transparent 72%,
            rgba(255,255,255,.02) 73%,
            transparent 74%
        );

    pointer-events: none;
    z-index: 1000;
}

.crt {
    position: relative;
    width: 100%;
    height: 100%;

    background:
        radial-gradient(
            circle at center,
            rgba(255,255,255,.04),
            transparent 60%
        ),
        linear-gradient(#111,#030303);

    animation: crt-flicker 8s infinite;
}

/* SCANLINES */
.crt::before {
    content: "";
    position: fixed;
    inset: 0;

    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,.08),
            rgba(255,255,255,.08) 1px,
            transparent 2px,
            transparent 4px
        );

    opacity: .30;

    pointer-events: none;
    z-index: 999;
}

/* DIRT / VIGNETTE */
.crt::after {
    content: "";
    position: fixed;
    inset: 0;

    background:
        radial-gradient(
            circle,
            transparent 55%,
            rgba(0,0,0,.82)
        );

    opacity: .9;

    pointer-events: none;
    z-index: 998;
}

.desktop {
    position: relative;

    width: 100%;
    height: 100%;

    padding: 24px;

    border: 2px solid rgba(255,255,255,.25);
}

/* DEAD PIXELS */
.desktop::after {
    content: "";

    position: absolute;
    inset: 0;

    background-image:
        radial-gradient(circle at 15% 25%, white 0, white 1px, transparent 1px),
        radial-gradient(circle at 82% 15%, white 0, white 1px, transparent 1px),
        radial-gradient(circle at 70% 62%, white 0, white 1px, transparent 1px),
        radial-gradient(circle at 32% 85%, white 0, white 1px, transparent 1px);

    opacity: .15;

    pointer-events: none;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    border-bottom: 2px solid rgba(255,255,255,.2);

    padding-bottom: 12px;

    text-transform: uppercase;
    letter-spacing: 2px;
}

.icons {
    position: absolute;
    top: 90px;
    left: 30px;

    display: flex;
    flex-direction: column;
    gap: 22px;
}

.icon {
    width: 90px;
    text-align: center;
    font-size: 12px;
}

.icon-box {
    width: 46px;
    height: 40px;

    border: 2px solid rgba(255,255,255,.6);

    margin: 0 auto 8px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 22px;
}

.window {
    position: absolute;

    left: 50%;
    top: var(--window-top);

    transform: translateX(-50%);

    width: min(900px, 75vw);
    max-height: calc(100vh - var(--window-top) - var(--taskbar-clearance));
    overflow: hidden;

    background: rgba(5,5,5,.9);

    border: 2px solid rgba(255,255,255,.7);

    box-shadow:
        8px 8px 0 rgba(255,255,255,.45),
        inset 0 0 20px rgba(255,255,255,.03);
}

.window-header {
    display: flex;
    justify-content: space-between;
    min-height: var(--window-header-height);

    padding: 10px 14px;

    border-bottom: 2px solid rgba(255,255,255,.2);

    text-transform: uppercase;
    position: relative;
}

.window-header-center {
    position: absolute;
    left: 50%;
    top: 15px;
    transform: translateX(-50%);
    font-family: "Courier New", monospace;
    font-size: 12px;
    color: #888;
    letter-spacing: 1px;
    white-space: nowrap;
    pointer-events: none;
}

.window-body {
    padding: 48px;
    max-height: calc(100vh - var(--window-top) - var(--taskbar-clearance) - var(--window-header-height));
    overflow-y: auto;
    overflow-x: hidden;
}

.window-body h1 {
    font-size: clamp(4rem, 8vw, 7rem);
    line-height: .85;

    margin-bottom: 24px;

    letter-spacing: -6px;

    text-transform: uppercase;

    text-shadow:
        -1px 0 rgba(255,255,255,.2),
         1px 0 rgba(255,255,255,.2),
         0 0 8px rgba(255,255,255,.15);
}

.window-body p {
    max-width: 600px;
    line-height: 1.7;
    color: rgba(255,255,255,.8);
}

.buttons {
    display: flex;
    gap: 16px;
    margin-top: 30px;
}

.btn {
    text-decoration: none;
    color: white;

    border: 2px solid rgba(255,255,255,.7);

    padding: 12px 20px;

    text-transform: uppercase;

    transition: .15s ease;
}

.btn:hover {
    background: white;
    color: black;
}

.terminal {
    margin-top: 40px;

    border-top: 1px dashed rgba(255,255,255,.25);

    padding-top: 20px;
}

.terminal p {
    margin-bottom: 8px;
    font-size: 14px;
}

.cursor {
    display: inline-block;

    width: 10px;
    height: 18px;

    background: white;

    vertical-align: middle;

    animation: blink 1s infinite;
}

.taskbar {
    position: absolute;

    left: 24px;
    right: 24px;
    bottom: 24px;

    display: flex;
    justify-content: space-between;

    border-top: 2px solid rgba(255,255,255,.15);

    padding-top: 12px;

    text-transform: uppercase;
}

@keyframes blink {
    0%,50% {
        opacity: 1;
    }
    51%,100% {
        opacity: 0;
    }
}

@keyframes crt-flicker {
    0%,97%,100% {
        opacity: 1;
    }

    98% {
        opacity: .97;
    }

    99% {
        opacity: .985;
    }
}

.terminal-window {
    font-size: 15px;
    line-height: 1.45;
}

.ascii-art {
    margin-bottom: 24px;
    color: white;
    font-size: clamp(10px, 1.6vw, 16px);
    line-height: 1.05;
    white-space: pre;
    text-shadow: 0 0 6px rgba(255,255,255,.18);
}

.terminal-lines p {
    margin-bottom: 6px;
    color: rgba(255,255,255,.82);
}

.prompt {
    color: #fff;
    font-weight: bold;
}

.path {
    color: rgba(255,255,255,.6);
}

.terminal-actions {
    margin-top: 28px;
    margin-bottom: 28px;
}

.terminal-input {
    border-top: 1px dashed rgba(255,255,255,.25);
    padding-top: 18px;
    color: rgba(255,255,255,.85);
}

.discord-icon svg {
    width: 24px;
    height: 24px;
    color: rgba(255,255,255,.85);
}

.icon:hover .discord-icon svg {
    color: white;
}

.hidden {
    display: none;
}

.icon {
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
}

.program-window {
    z-index: 20;
}

.window-close {
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    font-size: 14px;
}

.window-close:hover {
    background: white;
    color: black;
}

.program-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(255,255,255,.25);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.member-list {
    height: 0;
    flex: 1;

    overflow-y: auto;
    overflow-x: auto;

    border: 1px solid rgba(255,255,255,.25);

    margin-bottom: 8px;

    min-height: 0;
}

.member-list::-webkit-scrollbar {
    width: 10px;
}

.member-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,.03);
}

.member-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.25);
    border: 1px solid rgba(255,255,255,.15);
}

.member-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.4);
}

#membersWindow {
    height: calc(100vh - var(--window-top) - var(--taskbar-clearance));
}

.member-row {
    display: grid;
    grid-template-columns: 90px minmax(180px, 1fr) 150px;
    gap: 16px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    text-transform: uppercase;
    min-width: 460px;
}

.member-heading {
    color: white;
    background: rgba(255,255,255,.08);
}

.member-row:last-child {
    border-bottom: none;
}

.member-row:hover {
    background: rgba(255,255,255,.08);
}

.member-profile-cell {
    position: sticky;
    right: -14px;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    padding-right: 14px;
    background: transparent;
}

.member-profile-button {
    color: white;
    border: 1px solid rgba(255,255,255,.58);
    padding: 6px 8px;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
}

.member-profile-button:hover {
    background: white;
    color: black;
}

.members-body {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--window-top) - var(--taskbar-clearance) - var(--window-header-height));
    overflow: hidden;
}

.terminal-prompt {
    margin-top: 0;
    padding-top: 0;
    flex-shrink: 0;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;

    color: white;
    caret-color: white;

    font-family: inherit;
    font-size: inherit;

    text-transform: uppercase;

    padding-left: 5px;
}

.terminal-input::selection {
    background: white;
    color: black;
}

#projectWindow {
    height: calc(100vh - var(--window-top) - var(--taskbar-clearance));
    z-index: 25;
}

.project-body {
    height: calc(100vh - var(--window-top) - var(--taskbar-clearance) - var(--window-header-height));
    overflow-y: auto;
    overflow-x: hidden;
}

.project-login,
.project-editor {
    min-height: 100%;
}

.project-login {
    display: grid;
    place-items: center;
}

.project-login-card {
    width: min(420px, 100%);
    display: grid;
    gap: 18px;
    text-align: center;
    border: 1px solid rgba(255,255,255,.24);
    padding: 32px;
    background: rgba(255,255,255,.035);
}

.project-login-kicker {
    color: rgba(255,255,255,.62);
    letter-spacing: 3px;
    font-size: 12px;
}

.project-login-card h2 {
    font-size: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-login-card p {
    color: rgba(255,255,255,.72);
    line-height: 1.6;
}

.project-login-button {
    justify-self: center;
    display: inline-block;
}

.editor-grid {
    display: grid;
    gap: 18px;
}

.editor-grid label {
    display: grid;
    gap: 8px;
    letter-spacing: 2px;
}

.project-input {
    width: 100%;
    border: 1px solid rgba(255,255,255,.35);
    padding: 12px;
}

.project-input::placeholder,
.project-textarea::placeholder {
    color: rgba(255,255,255,.38);
}

.project-color {
    width: 100%;
    height: 46px;
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.03);
    padding: 6px;
}

.profile-link-field {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.03);
}

.profile-link-field span {
    padding-left: 12px;
    color: rgba(255,255,255,.65);
}

.profile-link-field .project-input {
    border: none;
}

.project-textarea {
    width: 100%;
    min-height: 130px;
    resize: vertical;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.35);
    color: white;
    caret-color: white;
    font-family: inherit;
    font-size: inherit;
    padding: 12px;
    outline: none;
}

.project-textarea:focus,
.project-input:focus {
    background: rgba(255,255,255,.08);
}

.upload-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.asset-upload-input {
    min-width: 0;
    color: rgba(255,255,255,.74);
    font-family: inherit;
    font-size: 12px;
}

.asset-upload-input::file-selector-button {
    border: 1px solid rgba(255,255,255,.45);
    background: rgba(255,255,255,.05);
    color: white;
    font-family: inherit;
    padding: 8px 10px;
    margin-right: 10px;
    cursor: pointer;
}

.asset-upload-button {
    padding: 9px 12px;
    white-space: nowrap;
    color: rgba(0, 0, 0, 0.55);
}

.asset-upload-status {
    color: rgba(255,255,255,.55);
    font-size: 12px;
    letter-spacing: 1px;
    overflow-wrap: anywhere;
}

.upload-progress-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0,0,0,.72);
}

.upload-progress-modal.hidden {
    display: none;
}

.upload-progress-box {
    width: min(460px, 100%);
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.62);
    background: #050505;
    box-shadow: 0 0 34px rgba(212,0,0,.24);
}

.upload-progress-body {
    display: grid;
    gap: 14px;
    padding: 18px;
    min-width: 0;
}

.upload-progress-body p {
    margin: 0;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.upload-progress-track {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 18px;
    border: 1px solid rgba(255,255,255,.55);
    background: rgba(255,255,255,.06);
    overflow: hidden;
}

.upload-progress-fill {
    width: 0%;
    height: 100%;
    background: #d40000;
    transition: width .12s linear;
}

.image-crop-modal {
    position: fixed;
    inset: 0;
    z-index: 19000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0,0,0,.78);
}

.image-crop-modal.hidden {
    display: none;
}

.image-crop-box {
    width: min(760px, 100%);
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.62);
    background: #050505;
    box-shadow: 0 0 34px rgba(212,0,0,.24);
}

.image-crop-body {
    display: grid;
    gap: 14px;
    padding: 18px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.image-crop-stage {
    width: 100%;
    height: min(56vh, 440px);
    border: 1px solid rgba(255,255,255,.38);
    background: rgba(255,255,255,.04);
}

.image-crop-stage img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.cropper-view-box,
.cropper-face {
    outline-color: rgba(212,0,0,.9);
}

.checkbox-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: "Courier New", monospace;
    font-size: 13px;
    color: rgba(255,255,255,.75);
    letter-spacing: 1px;
    user-select: none;
    width: fit-content;
}

/* Hide the real checkbox input */
.checkbox-label input[type="checkbox"] {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* Custom visual box */
.checkbox-custom {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255,255,255,.45);
    background: rgba(255,255,255,.03);
    flex-shrink: 0;
    position: relative;
    transition: border-color .15s, background .15s;
}

/* Checked state — red border + fill (driven by .checked class) */
.checkbox-label.checked .checkbox-custom {
    border-color: #d40000;
    background: rgba(212,0,0,.18);
}

/* Keep text span inline within flex row */
.checkbox-label > span:not(.checkbox-custom) {
    display: inline;
}

/* Checkmark via pseudo-element */
.checkbox-custom::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 4px;
    width: 8px;
    height: 5px;
    border: 2px solid transparent;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    transition: border-color .15s;
}

/* Show checkmark when checked */
.checkbox-label.checked .checkbox-custom::after {
    border-color: #d40000;
}

.link-editor {
    display: grid;
    gap: 10px;
}

.link-list {
    display: grid;
    gap: 10px;
}

.link-row {
    display: grid;
    grid-template-columns: minmax(120px, .45fr) minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.save-status {
    color: rgba(255,255,255,.65);
    margin-top: 8px;
}

.project-submit,
.project-logout {
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}


.error-window {
    z-index: 60;
    width: min(520px, calc(100% - 48px));
    top: 30%;
    box-shadow:
        8px 8px 0 rgba(255,255,255,.35),
        inset 0 0 18px rgba(255,255,255,.04);
}

.error-body {
    padding: 24px;
    display: grid;
    gap: 14px;
}

.error-body strong {
    letter-spacing: 2px;
}

.error-body p {
    color: rgba(255,255,255,.78);
    line-height: 1.6;
}

.error-body code {
    width: fit-content;
    border: 1px solid rgba(255,255,255,.25);
    padding: 8px 10px;
    color: rgba(255,255,255,.75);
    font-family: inherit;
}

.profile-page {
    overflow: auto;
}

.profile-page::before {
    display: none;
}

.profile-shell {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    padding: 40px;
    background: var(--profile-bg-color);
}

.profile-shell.has-video-background {
    overflow: hidden;
    background: var(--profile-bg-color);
}

.profile-shell.has-video-background::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(rgba(0,0,0,.22), rgba(0,0,0,.68));
}

.profile-bg-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.window.profile-card {
    position: relative;
    z-index: 2;
    left: auto;
    top: auto;
    transform: none;
    box-shadow: none;
}

.profile-body {
    display: grid;
    gap: 18px;
    justify-items: start;
}

.public-avatar {
    width: 116px;
    height: 116px;
    border: 2px solid rgba(255,255,255,.75);
    object-fit: cover;
    background: rgba(255,255,255,.08);
}

.public-avatar-fallback {
    display: grid;
    place-items: center;
    font-size: 52px;
    text-transform: uppercase;
}

.profile-body h1 {
    margin: 0;
}

.profile-ascii-logo {
    max-width: 100%;
    margin: 0;
    overflow-x: auto;
    color: #fff;
    font-family: "Courier New", Courier, monospace;
    font-size: clamp(5px, .8vw, 10px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
    white-space: pre;
}

.public-profile-bio {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.55;
}

.profile-body small {
    color: rgba(255,255,255,.55);
    overflow-wrap: anywhere;
}

.public-profile-links {
    width: min(560px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.public-profile-link {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.38);
    padding: 12px 14px;
    text-transform: uppercase;
}

.public-profile-link:hover {
    background: white;
    color: black;
}

.public-profile-link .bi {
    width: 20px;
    color: currentColor;
    font-size: 18px;
    line-height: 1;
    text-align: center;
}

#volumeIcon {
    color: currentColor;
    font-size: 18px;
    line-height: 1;
}

.profile-music {
    display: none;
}

.profile-mute-button {
    border: 2px solid rgba(255,255,255,.72);
    background: rgba(5,5,5,.92);
    color: white;
    font-family: inherit;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.profile-mute-button:hover {
    background: white;
    color: black;
}

.profile-volume-control {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid rgba(255,255,255,.72);
    background: rgba(5,5,5,.92);
    padding: 6px 12px 6px 10px;
    box-shadow: none;
}

.profile-volume-slider {
    width: 100px;
    height: 24px;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    outline: 0;
    background: transparent;
    cursor: pointer;
}

.profile-volume-slider::-webkit-slider-runnable-track {
    height: 4px;
    border: 1px solid rgba(255,255,255,.7);
    background: rgba(255,255,255,.18);
}

.profile-volume-slider::-webkit-slider-thumb {
    width: 14px;
    height: 18px;
    margin-top: -8px;
    -webkit-appearance: none;
    border: 1px solid #050505;
    border-radius: 0;
    background: #fff;
}

.profile-volume-slider::-moz-range-track {
    height: 2px;
    border: 1px solid rgba(255,255,255,.7);
    background: rgba(255,255,255,.18);
}

.profile-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 18px;
    border: 1px solid #050505;
    border-radius: 0;
    background: #fff;
}

.profile-volume-slider:focus-visible {
    outline: 1px solid #fff;
    outline-offset: 3px;
}

@media (max-width: 768px) {
    #projectWindow {
        height: calc(100vh - var(--window-top) - var(--taskbar-clearance));
    }

    .project-body {
        height: calc(100vh - var(--window-top) - var(--taskbar-clearance) - var(--window-header-height));
    }

    .link-row {
        grid-template-columns: 1fr;
    }

    .profile-shell {
        padding: 20px;
    }

    .profile-mute-button {
        right: 14px;
        bottom: 14px;
    }
}

/* ─── Admin Panel ─────────────────────────────────────────────────────────── */

.admin-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px;
    background: radial-gradient(circle at center, rgba(255,255,255,.04), transparent 55%), linear-gradient(#111,#030303);
}

.admin-shell .window {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: min(1100px, 95vw);
    max-height: 90vh;
}

.admin-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid rgba(255,255,255,.3);
    color: rgba(255,255,255,.7);
    font-weight: normal;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table tr:hover td {
    background: rgba(255,255,255,.06);
}

.admin-table .actions {
    white-space: nowrap;
}

.btn-small {
    background: transparent;
    border: 1px solid rgba(255,255,255,.45);
    color: white;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 5px 10px;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-small:hover {
    background: white;
    color: black;
}

#adminEditWindow {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    width: min(700px, 95vw);
    max-height: 88vh;
}

#adminEditWindow .window-body {
    max-height: calc(88vh - var(--window-header-height));
    overflow-y: auto;
}

@media (max-width: 900px) {
    body {
        --window-top: 118px;
        --taskbar-clearance: 70px;
        --window-header-height: 42px;
        --mobile-window-margin: 14px;
        --mobile-window-width: calc(100vw - (var(--mobile-window-margin) * 2) - 8px);
        --mobile-window-height: calc(100dvh - var(--window-top) - var(--taskbar-clearance));
        overflow: hidden;
        min-height: 100dvh;
    }

    body::before,
    .crt::before,
    .crt::after,
    .desktop::after {
        pointer-events: none;
    }

    .crt {
        min-height: 100dvh;
        height: 100dvh;
    }

    .desktop {
        min-height: 100dvh;
        height: 100dvh;
        padding: 14px;
        padding-bottom: 86px;
        border-width: 1px;
        overflow: hidden;
    }

    .topbar {
        gap: 12px;
        padding-bottom: 10px;
        font-size: 12px;
        letter-spacing: 1px;
    }

    .topbar span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .icons {
        position: relative;
        top: auto;
        left: auto;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-top: 14px;
        margin-bottom: 14px;
    }

    .icon {
        width: 100%;
        min-width: 0;
        padding: 8px 6px;
        border: 1px solid rgba(255,255,255,.18);
        background: rgba(255,255,255,.03);
        font-size: 10px;
        overflow-wrap: anywhere;
    }

    .icon-box {
        width: 38px;
        height: 34px;
        margin-bottom: 6px;
        font-size: 18px;
    }

    .window {
        position: absolute;
        left: var(--mobile-window-margin);
        right: auto;
        top: var(--window-top);
        transform: none;
        width: var(--mobile-window-width);
        max-width: var(--mobile-window-width);
        height: auto;
        max-height: var(--mobile-window-height);
        margin-top: 0;
        box-shadow:
            4px 4px 0 rgba(255,255,255,.32),
            inset 0 0 20px rgba(255,255,255,.03);
    }

    .window.hidden {
        display: none;
    }

    .window-header {
        gap: 10px;
        align-items: center;
        padding: 9px 10px;
        font-size: 12px;
        letter-spacing: 1px;
    }

    .window-header > span,
    .window-header > button {
        min-width: 0;
    }

    .window-header > span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .window-header-center {
        display: none;
    }

    .window-body {
        padding: 18px;
        max-height: calc(var(--mobile-window-height) - var(--window-header-height));
        overflow-y: auto;
        overflow-x: hidden;
    }

    .window-body h1 {
        font-size: clamp(2.4rem, 14vw, 4.2rem);
        line-height: .92;
        letter-spacing: 0;
        margin-bottom: 18px;
    }

    .window-body p {
        max-width: none;
    }

    .buttons,
    .editor-actions,
    .admin-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .btn,
    .btn-small,
    .window-close {
        min-height: 42px;
    }

    .btn,
    .project-submit,
    .project-logout,
    .member-profile-button,
    .btn-small {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .ascii-art {
        font-size: clamp(8px, 2.5vw, 12px);
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .terminal-actions {
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .taskbar {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: 12px;
        z-index: 900;
        gap: 8px;
        padding-top: 9px;
        background: rgba(2,2,2,.9);
        font-size: 11px;
        letter-spacing: 0;
    }

    .taskbar span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #terminalWindow,
    #projectWindow,
    #membersWindow {
        height: var(--mobile-window-height);
    }

    .project-body,
    .members-body {
        height: calc(var(--mobile-window-height) - var(--window-header-height));
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .project-login,
    .project-editor {
        min-height: 100%;
    }

    .project-login-card {
        padding: 20px;
    }

    .project-login-card h2 {
        font-size: 24px;
    }

    .program-title {
        gap: 8px;
        align-items: start;
        font-size: 12px;
        letter-spacing: 1px;
    }

    .program-title span:last-child {
        text-align: right;
        overflow-wrap: anywhere;
    }

    .profile-link-field {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .upload-row {
        grid-template-columns: 1fr;
    }

    .asset-upload-input {
        width: 100%;
        font-size: 11px;
    }

    .asset-upload-input::file-selector-button {
        display: block;
        width: 100%;
        margin: 0 0 8px;
    }

    .asset-upload-button {
        width: 100%;
        color: white;
    }

    .link-row {
        grid-template-columns: 1fr;
    }

    .member-list {
        height: 0;
        max-height: none;
        overflow: auto;
    }

    .member-row {
        grid-template-columns: 52px minmax(120px, 1fr) minmax(104px, auto);
        gap: 8px;
        min-width: 330px;
        padding: 10px;
        font-size: 12px;
    }

    .member-profile-cell {
        right: -10px;
        padding-right: 10px;
    }

    .terminal-prompt {
        display: grid;
        gap: 8px;
    }

    .terminal-prompt label {
        overflow-wrap: anywhere;
    }

    .terminal-prompt .terminal-input {
        width: 100%;
        border: 1px solid rgba(255,255,255,.25);
        padding: 12px;
    }

    .error-window {
        width: min(var(--mobile-window-width), 520px);
        top: max(96px, 18vh);
    }

    .error-body {
        padding: 20px;
    }

    .upload-progress-modal,
    .image-crop-modal {
        padding: 12px;
        align-items: center;
    }

    .upload-progress-box,
    .image-crop-box {
        width: 100%;
        max-height: calc(100dvh - 24px);
    }

    .image-crop-body {
        padding: 12px;
    }

    .image-crop-stage {
        height: min(48vh, 360px);
    }

    .profile-shell {
        min-height: 100dvh;
        padding: 18px;
        background-attachment: scroll;
    }

    .profile-card {
        width: 100%;
    }

    .profile-body {
        justify-items: stretch;
        text-align: left;
    }

    .public-avatar,
    .public-avatar-fallback {
        width: 96px;
        height: 96px;
    }

    .profile-body h1 {
        font-size: clamp(2rem, 13vw, 3.8rem);
        overflow-wrap: anywhere;
    }

    .public-profile-links {
        width: 100%;
    }

    .profile-volume-control {
        right: 12px;
        bottom: 12px;
        max-width: calc(100vw - 24px);
    }

    .admin-shell {
        display: block;
        padding: 14px;
        min-height: 100dvh;
        overflow: auto;
    }

    .admin-shell .window {
        width: 100%;
        max-height: none;
    }

    .admin-shell .window-body {
        max-height: none;
        overflow-x: auto;
    }

    .admin-table {
        min-width: 760px;
    }

    #adminEditWindow {
        position: fixed;
        inset: 12px;
        left: 12px;
        top: 12px;
        width: auto;
        max-height: calc(100dvh - 24px);
        transform: none;
    }

    #adminEditWindow .window-body {
        max-height: calc(100dvh - 24px - var(--window-header-height));
    }
}

@media (max-width: 520px) {
    body {
        --taskbar-clearance: 74px;
        --mobile-window-margin: 10px;
        --mobile-window-width: calc(100vw - (var(--mobile-window-margin) * 2) - 6px);
    }

    .desktop {
        padding: 10px;
        padding-bottom: 88px;
    }

    .icons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .window {
        border-width: 1px;
        box-shadow:
            3px 3px 0 rgba(255,255,255,.28),
            inset 0 0 20px rgba(255,255,255,.03);
    }

    .window-body {
        padding: 16px;
    }

    .window-header {
        font-size: 11px;
    }

    .program-title {
        display: grid;
    }

    .program-title span:last-child {
        text-align: left;
    }

    .member-row {
        grid-template-columns: 42px minmax(110px, 1fr) 96px;
        min-width: 300px;
        font-size: 11px;
    }

    .member-profile-button {
        padding: 6px;
        font-size: 10px;
    }

    .taskbar {
        left: 10px;
        right: 10px;
        grid-template-columns: 1fr;
        display: grid;
        font-size: 10px;
    }

    .profile-volume-control {
        padding: 5px 8px;
    }

    .profile-volume-slider {
        width: 82px;
    }

    .public-profile-links {
        grid-template-columns: 1fr;
    }
}
