* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    background: #000;
}

#desktop {
    width: 100vw;
    height: 100vh;
    background: #1a1a2e;
    position: relative;
    user-select: none;
    overflow: hidden;
}

#desktop.hidden {
    display: none;
}

/* ── Boot Screen ── */
#boot-screen {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.8s ease;
}

#boot-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.boot-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 60px;
}

.boot-wall {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    animation: boot-logo-in 0.8s ease-out both;
    animation-delay: 0.3s;
}

.brick-row {
    display: flex;
    gap: 3px;
    justify-content: center;
}

.brick-row.offset {
    padding: 0 2px;
}

.brick {
    height: 16px;
    border-radius: 2px;
    opacity: 0;
    animation: boot-brick-in 0.3s ease-out forwards;
}

/* Full-width bricks in non-offset rows */
.brick-row:not(.offset) .brick { width: 32px; }
/* Half-offset bricks in offset rows */
.brick-row.offset .brick { width: 24px; }

/* Brick colors — warm terracotta/clay palette with a glow */
.bk-1  { background: #c0392b; animation-delay: 0.3s; }
.bk-2  { background: #e74c3c; animation-delay: 0.4s; }
.bk-3  { background: #d35400; animation-delay: 0.35s; }
.bk-4  { background: #e67e22; animation-delay: 0.5s; }
.bk-5  { background: #c0392b; animation-delay: 0.55s; }
.bk-6  { background: #d35400; animation-delay: 0.6s; }
.bk-7  { background: #e74c3c; animation-delay: 0.65s; }
.bk-8  { background: #d35400; animation-delay: 0.7s; }
.bk-9  { background: #c0392b; animation-delay: 0.75s; }
.bk-10 { background: #e74c3c; animation-delay: 0.8s; }
.bk-11 { background: #c0392b; animation-delay: 0.85s; }
.bk-12 { background: #e74c3c; animation-delay: 0.9s; }
.bk-13 { background: #d35400; animation-delay: 0.95s; }
.bk-14 { background: #e67e22; animation-delay: 1.0s; }

@keyframes boot-brick-in {
    from { opacity: 0; transform: scaleX(0); }
    to   { opacity: 1; transform: scaleX(1); }
}

@keyframes boot-logo-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.boot-title {
    color: #fff;
    font-size: 36px;
    font-weight: 200;
    letter-spacing: 6px;
    text-transform: uppercase;
    opacity: 0;
    animation: boot-text-in 0.6s ease-out forwards;
    animation-delay: 1.2s;
}

.boot-edition {
    font-weight: 600;
    margin-left: 2px;
}

@keyframes boot-text-in {
    from { opacity: 0; letter-spacing: 20px; }
    to   { opacity: 1; letter-spacing: 6px; }
}

/* Spinner — Windows 10 style circling dots */
.boot-spinner {
    position: relative;
    width: 50px;
    height: 50px;
    margin-bottom: 40px;
    opacity: 0;
    animation: boot-text-in 0.3s ease-out forwards;
    animation-delay: 1.6s;
}

.boot-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin: -3px 0 0 -3px;
    animation: boot-spin 2.4s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.boot-dot:nth-child(1) { animation-delay: 0.0s; }
.boot-dot:nth-child(2) { animation-delay: 0.15s; }
.boot-dot:nth-child(3) { animation-delay: 0.30s; }
.boot-dot:nth-child(4) { animation-delay: 0.45s; }
.boot-dot:nth-child(5) { animation-delay: 0.60s; }

@keyframes boot-spin {
    0%   { transform: rotate(0deg) translateY(-18px);   opacity: 0; }
    10%  { opacity: 1; }
    80%  { opacity: 1; }
    90%  { opacity: 0; }
    100% { transform: rotate(720deg) translateY(-18px); opacity: 0; }
}

.boot-subtitle {
    color: #666;
    font-size: 12px;
    letter-spacing: 1px;
    min-height: 18px;
    opacity: 0;
    animation: boot-text-in 0.3s ease-out forwards;
    animation-delay: 2.0s;
}

/* Desktop Icons */
#desktop-icons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 40px; /* above taskbar */
    pointer-events: none;
}

.desktop-icon {
    position: absolute;
    width: 80px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    color: #fff;
    text-align: center;
    pointer-events: auto;
    user-select: none;
    border: 1px solid transparent;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.08);
}

.desktop-icon.selected {
    background: rgba(79, 195, 247, 0.18);
    border-color: rgba(79, 195, 247, 0.35);
}

.desktop-icon.dragging {
    opacity: 0.6;
    z-index: 9999;
}

.desktop-icon .icon-img {
    font-size: 32px;
    margin-bottom: 4px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-svg-icon {
    display: inline-block;
    vertical-align: middle;
    pointer-events: none;
}

.desktop-icon span {
    font-size: 11px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    word-break: break-word;
    line-height: 1.2;
    max-width: 76px;
}

/* Window */
.window {
    position: absolute;
    top: 60px;
    left: 120px;
    width: 720px;
    height: 480px;
    display: flex;
    flex-direction: column;
    border: 1px solid #444;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.window.hidden {
    display: none;
}

.window-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 32px;
    padding: 0 8px;
    background: #2b2b3d;
    cursor: grab;
    flex-shrink: 0;
}

.window-titlebar:active {
    cursor: grabbing;
}

.window-title {
    color: #ccc;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.window-title-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.window-controls {
    display: flex;
    gap: 4px;
}

.win-btn {
    width: 28px;
    height: 22px;
    border: none;
    background: transparent;
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.win-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.win-btn.close:hover {
    background: #e81123;
    color: #fff;
}

.window-body {
    flex: 1;
    overflow: hidden;
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #1f1f30;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    padding: 0;
    z-index: 9999;
}

#start-btn {
    height: 40px;
    padding: 0 12px;
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#start-btn:hover,
#start-btn.active {
    background: rgba(255, 255, 255, 0.08);
}

/* Mini brick wall logo for start button */
.start-wall {
    display: flex;
    flex-direction: column;
    gap: 1.5px;
    pointer-events: none;
}

.sw-row {
    display: flex;
    gap: 1.5px;
    justify-content: center;
}

.sw-row span {
    display: block;
    width: 7px;
    height: 4px;
    border-radius: 0.5px;
    background: #e74c3c;
}

.sw-row:first-child span { background: #c0392b; }
.sw-row:last-child span  { background: #d35400; }

.sw-off span {
    width: 5px;
}

#start-btn:hover .sw-row span {
    background: #ff6b5a;
}

/* Search bar */
#taskbar-search {
    display: flex;
    align-items: center;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0 8px;
    margin: 0 4px;
    flex-shrink: 0;
    width: 200px;
}

#search-icon {
    font-size: 12px;
    color: #888;
    margin-right: 6px;
    flex-shrink: 0;
}

#search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ccc;
    font-family: inherit;
    font-size: 12px;
    width: 100%;
}

#search-input::placeholder {
    color: #666;
}

/* Pinned apps */
#taskbar-pinned {
    display: flex;
    align-items: center;
    gap: 1px;
    margin: 0 2px;
    flex-shrink: 0;
}

.taskbar-pin {
    height: 34px;
    width: 40px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.taskbar-pin:hover {
    background: rgba(255, 255, 255, 0.08);
}

.taskbar-pin.open {
    border-bottom-color: #4fc3f7;
    color: #ccc;
}

.taskbar-pin.focused {
    background: rgba(255, 255, 255, 0.06);
    border-bottom-color: #4fc3f7;
    color: #fff;
}

/* Active windows area */
#taskbar-apps {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 4px;
    gap: 1px;
    overflow: hidden;
}

.taskbar-app {
    height: 34px;
    padding: 0 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid #4fc3f7;
    color: #ccc;
    font-size: 11px;
    cursor: pointer;
    border-radius: 0;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.taskbar-app:hover {
    background: rgba(255, 255, 255, 0.06);
}

.taskbar-app.focused {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.taskbar-app.minimized {
    border-bottom-color: #666;
    color: #888;
}

/* System tray */
#system-tray {
    display: flex;
    align-items: center;
    padding: 0 2px;
    color: #aaa;
    font-size: 12px;
    flex-shrink: 0;
    height: 40px;
}

.tray-btn {
    height: 34px;
    width: 32px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tray-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
}

#notif-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    background: #e81123;
    color: #fff;
    font-size: 8px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

#tray-separator {
    width: 1px;
    height: 20px;
    background: #444;
    margin: 0 4px;
}

#clock-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    cursor: default;
    line-height: 1.2;
}

#clock {
    white-space: nowrap;
    font-size: 11px;
    color: #ccc;
}

#clock-date {
    white-space: nowrap;
    font-size: 10px;
    color: #888;
}

#tray-show-desktop {
    width: 8px;
    height: 40px;
    border-left: 1px solid #444;
    font-size: 0;
    padding: 0;
    cursor: pointer;
}

#tray-show-desktop:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Start Menu */
#start-menu {
    position: fixed;
    bottom: 40px;
    left: 0;
    width: 580px;
    background: #1f1f30;
    border: 1px solid #444;
    border-bottom: none;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    animation: start-slide-up 0.15s ease-out;
}

#start-menu.hidden {
    display: none;
}

@keyframes start-slide-up {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#start-menu-inner {
    display: flex;
    height: 460px;
}

#start-left {
    width: 260px;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#start-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #333;
    cursor: pointer;
}

#start-user:hover {
    background: rgba(255, 255, 255, 0.06);
}

.start-avatar {
    font-size: 24px;
}

.start-username {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

#start-recent,
#start-all-apps {
    padding: 4px 0;
    overflow-y: auto;
}

#start-all-apps {
    flex: 1;
}

.start-section-label {
    padding: 6px 16px 4px;
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-app-item {
    padding: 7px 16px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.start-app-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.start-app-item.start-app-disabled {
    color: #666;
    cursor: default;
}

.start-app-item.start-app-disabled:hover {
    background: transparent;
    color: #666;
}

.start-app-item.start-app-unowned {
    color: #555;
    font-style: italic;
}

.start-app-item.start-app-unowned:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #666;
}

.start-app-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.start-separator {
    height: 1px;
    background: #333;
    margin: 4px 12px;
}

#start-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px;
}

#start-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex: 1;
}

.start-tile {
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    cursor: default;
    overflow: hidden;
}

.tile-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.tile-content {
    font-size: 12px;
    color: #fff;
    line-height: 1.4;
    flex: 1;
}

.tile-weather {
    background: #1565c0;
}

.tile-news {
    background: #c62828;
}

.tile-bingtana {
    background: #2e7d32;
}

.tile-defender {
    background: #37474f;
}

#start-power {
    display: flex;
    gap: 4px;
    padding-top: 4px;
}

.power-btn {
    flex: 1;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid #444;
    border-radius: 3px;
    color: #ccc;
    font-size: 11px;
    cursor: pointer;
}

.power-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.start-credits {
    font-size: 9px;
    color: #555;
    text-align: center;
    padding: 4px 8px 2px;
}

.start-credits a {
    color: #666;
    text-decoration: none;
}

.start-credits a:hover {
    color: #999;
    text-decoration: underline;
}

/* Search Results */
#search-results {
    position: fixed;
    bottom: 40px;
    left: 56px;
    width: 360px;
    max-height: 320px;
    background: #1f1f30;
    border: 1px solid #444;
    border-bottom: none;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    overflow-y: auto;
    padding: 4px 0;
}

#search-results.hidden {
    display: none;
}

.search-result-item {
    padding: 8px 14px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-item:hover,
.search-result-item.selected {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.search-result-item.selected {
    background: rgba(79, 195, 247, 0.12);
    border-left: 2px solid #4fc3f7;
    padding-left: 12px;
}

.search-result-item .search-unowned {
    color: #666;
    font-size: 10px;
}

.search-result-item .search-match {
    color: #4fc3f7;
    font-weight: 600;
}

.search-result-item .search-sub {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.search-bingtana {
    padding: 10px 14px;
    color: #888;
    font-size: 11px;
    font-style: italic;
    border-top: 1px solid #333;
}

/* Tray popups */
.tray-popup {
    position: fixed;
    bottom: 44px;
    right: 8px;
    width: 300px;
    background: #1f1f30;
    border: 1px solid #444;
    border-radius: 6px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    padding: 12px;
    color: #ccc;
    font-size: 12px;
}

.tray-popup.hidden {
    display: none;
}

.tray-popup-title {
    font-weight: 600;
    color: #fff;
    font-size: 13px;
    margin-bottom: 8px;
}

.tray-popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.tray-popup-row .tray-label {
    color: #aaa;
}

.tray-popup-row .tray-value {
    color: #fff;
}

.notif-item {
    padding: 8px;
    border-bottom: 1px solid #333;
    cursor: default;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item .notif-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.notif-item .notif-body {
    color: #aaa;
    font-size: 11px;
}

.notif-item .notif-time {
    color: #666;
    font-size: 10px;
    margin-top: 3px;
}

.volume-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.volume-slider-row input[type="range"] {
    flex: 1;
    accent-color: #4fc3f7;
}

.volume-slider-row .vol-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.volume-slider-row .vol-pct {
    width: 30px;
    text-align: right;
    color: #aaa;
    font-size: 11px;
}

/* Scrollbar for start menu */
#start-all-apps::-webkit-scrollbar,
#search-results::-webkit-scrollbar {
    width: 6px;
}

#start-all-apps::-webkit-scrollbar-track,
#search-results::-webkit-scrollbar-track {
    background: transparent;
}

#start-all-apps::-webkit-scrollbar-thumb,
#search-results::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

/* Context Menu */
.ctx-menu {
    position: fixed;
    background: #2b2b3d;
    border: 1px solid #444;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    padding: 4px 0;
    z-index: 10000;
    font-size: 12px;
    color: #ccc;
}

.ctx-item {
    padding: 6px 28px 6px 12px;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.ctx-item:hover {
    background: rgba(79, 195, 247, 0.15);
    color: #fff;
}

.ctx-item.disabled {
    color: #666;
    cursor: default;
}

.ctx-item.disabled:hover {
    background: transparent;
    color: #666;
}

.ctx-separator {
    height: 1px;
    background: #444;
    margin: 4px 0;
}

.ctx-item .ctx-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    color: #888;
}

.ctx-item:hover .ctx-arrow {
    color: #ccc;
}

.ctx-item .ctx-shortcut {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #666;
}

/* Submenu */
.ctx-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -4px;
}

.ctx-item:hover > .ctx-submenu {
    display: block;
}

/* Notification toast (for satirical feedback) */
.desktop-toast {
    position: fixed;
    bottom: 52px;
    right: 12px;
    background: #2b2b3d;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 12px 16px;
    color: #ccc;
    font-size: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    max-width: 320px;
    animation: toast-in 0.25s ease-out;
}

.desktop-toast .toast-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

@keyframes toast-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ── Auth Screen ── */
#auth-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #0a0a1a 100%);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: auth-fade-in 0.5s ease-out;
}

#auth-screen.hidden {
    display: none;
}

@keyframes auth-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

#auth-setup,
#auth-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#auth-setup.hidden,
#auth-login.hidden,
#auth-profile-pick.hidden,
#auth-manual-login.hidden {
    display: none;
}

.auth-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px 40px;
    max-width: 360px;
    width: 100%;
}

.auth-logo {
    font-size: 64px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.auth-avatar {
    font-size: 72px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.auth-heading {
    color: #fff;
    font-size: 32px;
    font-weight: 200;
    letter-spacing: 2px;
}

.auth-sub {
    color: #888;
    font-size: 13px;
    text-align: center;
}

.auth-login-user {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 4px;
}

.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.auth-fields input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-bottom: 2px solid #444;
    border-radius: 2px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.auth-fields input:focus {
    border-bottom-color: #4fc3f7;
}

.auth-fields input::placeholder {
    color: #666;
}

.auth-error {
    color: #e74c3c;
    font-size: 12px;
    text-align: center;
    min-height: 16px;
}

.auth-error.hidden {
    display: none;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: #0078d7;
    border: none;
    border-radius: 3px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-btn:hover {
    background: #1a8ae6;
}

.auth-btn:active {
    background: #005a9e;
}

.auth-link {
    color: #4fc3f7;
    font-size: 12px;
    text-decoration: none;
    margin-top: 4px;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-links-row {
    display: flex;
    gap: 16px;
    margin-top: 4px;
}

.auth-profile-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 16px 32px;
    border-radius: 8px;
    transition: background 0.2s;
}

.auth-profile-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.auth-profile-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.auth-profile-name {
    color: #fff;
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 1px;
}

.auth-profile-hint {
    color: #666;
    font-size: 12px;
    margin-top: -4px;
}

/* ── Password section animation ── */
.auth-pw-section {
    width: 100%;
    overflow: hidden;
    transition: max-height 350ms ease, opacity 300ms ease;
    max-height: 200px; opacity: 1;
}
.auth-pw-section.collapsed {
    max-height: 0; opacity: 0; pointer-events: none;
}

/* ── Password row with arrow submit ── */
.auth-pw-row {
    display: flex; gap: 8px; width: 100%;
}
.auth-pw-row input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-bottom: 2px solid #444;
    border-radius: 2px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.auth-pw-row input:focus {
    border-bottom-color: #4fc3f7;
}
.auth-pw-row input::placeholder {
    color: #666;
}
.auth-pw-submit {
    width: 42px; background: #0078d7; border: none; border-radius: 3px;
    color: #fff; font-size: 20px; cursor: pointer;
    transition: background 0.2s;
}
.auth-pw-submit:hover { background: #1a8ae6; }

/* ── Fade-out for hint and pick-links ── */
.auth-profile-hint, #pick-links-row {
    transition: opacity 250ms ease, max-height 250ms ease;
    overflow: hidden;
}
.auth-profile-hint.fade-out, #pick-links-row.fade-out {
    max-height: 0; opacity: 0;
}

/* ── Auth power buttons (bottom-right, like Win10 lock screen) ── */
#auth-power-btns {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    gap: 8px;
}
.auth-power-btn {
    width: 40px; height: 40px;
    border-radius: 4px; border: none;
    background: rgba(255,255,255,0.06);
    color: #999; font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.auth-power-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ── BSOD ── */
#bsod-screen {
    position: fixed;
    inset: 0;
    background: #0078d7;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bsod-flash 0.3s ease-out;
}

#bsod-screen.hidden {
    display: none;
}

@keyframes bsod-flash {
    0% { opacity: 0; }
    30% { opacity: 1; background: #fff; }
    60% { background: #0078d7; }
    100% { background: #0078d7; }
}

.bsod-content {
    max-width: 600px;
    padding: 40px;
}

.bsod-face {
    font-size: 120px;
    color: #fff;
    font-weight: 200;
    line-height: 1;
    margin-bottom: 24px;
}

.bsod-title {
    color: #fff;
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 16px;
}

.bsod-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.bsod-detail {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-bottom: 16px;
}

.bsod-progress {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

/* ── Password Change Dialog ── */
.pw-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: auth-fade-in 0.15s ease-out;
}

.pw-dialog {
    background: #1f1f30;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 24px;
    width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.pw-dialog-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.pw-dialog-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.pw-dialog-fields input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-bottom: 2px solid #444;
    border-radius: 2px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.pw-dialog-fields input:focus {
    border-bottom-color: #4fc3f7;
}

.pw-dialog-fields input::placeholder {
    color: #666;
}

.pw-dialog-error {
    color: #e74c3c;
    font-size: 12px;
    margin-bottom: 10px;
    min-height: 16px;
}

.pw-dialog-error.hidden {
    display: none;
}

.pw-dialog-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.pw-dialog-btn {
    padding: 7px 18px;
    border: none;
    border-radius: 3px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.pw-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
}

.pw-cancel:hover {
    background: rgba(255, 255, 255, 0.14);
}

.pw-save {
    background: #0078d7;
    color: #fff;
}

.pw-save:hover {
    background: #1a8ae6;
}

/* ── Fullscreen Terminal Mode ── */
#fullscreen-terminal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0a;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
}

.fs-terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #111;
    border-bottom: 1px solid #222;
    flex-shrink: 0;
}

.fs-terminal-title {
    color: #3fb950;
    font-size: 13px;
    font-weight: bold;
}

.fs-terminal-hint {
    color: #445;
    font-size: 11px;
}

.fs-terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #c9d1d9;
}

.fs-terminal-body .terminal-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.fs-terminal-body .terminal-line.error { color: #f85149; }
.fs-terminal-body .terminal-line.warning { color: #d29922; }
.fs-terminal-body .terminal-line.system { color: #3fb950; }
.fs-terminal-body .terminal-line.info { color: #c9d1d9; }
.fs-terminal-body .terminal-line.input-echo { color: #666; }

.fs-terminal-input-row {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #111;
    border-top: 1px solid #222;
    flex-shrink: 0;
}

.fs-terminal-prompt {
    color: #3fb950;
    margin-right: 8px;
    font-size: 13px;
    flex-shrink: 0;
}

.fs-terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #c9d1d9;
    font-family: inherit;
    font-size: 13px;
    caret-color: #3fb950;
}

/* Scanline effect for immersion */
#fullscreen-terminal::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.05) 0px,
        rgba(0, 0, 0, 0.05) 1px,
        transparent 1px,
        transparent 3px
    );
    z-index: 1;
}

/* Scrollbar for fullscreen terminal body */
.fs-terminal-body::-webkit-scrollbar {
    width: 8px;
}

.fs-terminal-body::-webkit-scrollbar-track {
    background: #111;
}

.fs-terminal-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
