* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --phone-ratio: 9/16;
    --phone-min-width: 300px;
    --phone-max-width: 693px;
    --taskbar-height: 6%;
    --taskbar-min-height: 30px;
    --taskbar-max-height: 40px;
    --topbar-height: 5%;
    --topbar-min-height: 25px;
    --topbar-max-height: 35px;
}
html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    background: #000;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100vw;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: #00d4ff;
    color: #000;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    border-radius: 0 0 4px 4px;
}
.skip-link:focus {
    left: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.icon:focus,
a:focus,
button:focus,
[tabindex]:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}
.mobile-frame {
    width: 100%;
    max-width: var(--phone-max-width);
    aspect-ratio: var(--phone-ratio);
    min-width: var(--phone-min-width);
    max-height: 95vh;
    max-height: 95dvh;
    background: #000;
    border-radius: 0;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    margin: auto;
}
.mobile-screen {
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: #003264;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    transition: background 1s ease-out;
    overflow: hidden;
}
#top-taskbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    min-height: var(--topbar-min-height);
    max-height: var(--topbar-max-height);
    background: rgba(0, 100, 180, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.6);
    padding: 0 2%;
    z-index: 1005;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}
#loading-screen.hidden ~ #top-taskbar {
    opacity: 1;
}
#top-date {
    position: absolute;
    left: 2%;
    top: 50%;
    transform: translateY(-50%);
    height: 100%;
    display: flex;
    align-items: center;
    font-size: clamp(10px, 2.5vw, 13px);
    color: #fff;
    font-weight: bold;
    user-select: none;
}
#top-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 100%;
    font-size: clamp(11px, 3vw, 14px);
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    user-select: none;
    display: flex;
    align-items: center;
}

#top-taskbar #clock {
    font-size: clamp(10px, 2.5vw, 13px);
    color: #fff;
    padding: 1% 2%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: absolute;
    right: 2%;
    font-weight: bold;
    user-select: none;
    top: 50%;
    transform: translateY(-50%);
}
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #003264;
    z-index: 999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    inset: 0;
}
#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}
#os-logo {
    width: clamp(180px, 50vw, 465px);
    user-select: none;
    pointer-events: none;
    position: absolute;
    top: calc(50% - 10vh);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}
#loading-screen.hidden #os-logo {
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}
#os-logo.as-title {
    top: 10% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    color: #00d4ff !important;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5) !important;
    z-index: 6 !important;
}

#os-logo-text {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(14px, 4vw, 28px);
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    user-select: none;
    pointer-events: none;
    opacity: 0;
    z-index: 1001;
    transition: opacity 0.5s ease-out 1.3s;
}
#loading-screen.hidden ~ #os-logo-text {
    opacity: 1;
    top: 18%;
}
#loading-content {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    width: 80%;
    max-width: 300px;
}
#loading-content.hidden {
    opacity: 0;
    pointer-events: none;
}
#loading-bar-container {
    width: 100%;
    max-width: 250px;
    height: clamp(20px, 6vh, 32px);
    background: #024C8F;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #0055aa;
    margin-top: clamp(10px, 3vh, 75px);
    position: relative;
}
#loading-bar {
    height: 100%;
    background: linear-gradient(90deg, #0F325D, #181B30);
    width: 0%;
    transition: width 0.3s ease;
}
#loading-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFFFFF;
    font-size: clamp(15px, 3.75vw, 20px);
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.8);
    line-height: 1.2;
    pointer-events: none;
}
#loading-text {
    margin-top: clamp(8px, 2vh, 12px);
    color: #00d4ff;
    font-size: clamp(18px, 4.5vw, 23px);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}
#desktop {
    position: absolute;
    top: calc(var(--topbar-height) + 28%);
    bottom: var(--taskbar-height);
    left: 0;
    right: 0;
    padding: 1%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    row-gap: clamp(10px, 3vh, 25px);
    column-gap: 1.5%;
    align-content: start;
    justify-content: center;
    justify-items: center;
    position: relative;
    z-index: 1002;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    overflow-y: auto;
}

#fox-character {
    position: absolute;
    left: 0;
    width: 48px;
    height: 96px;
    z-index: 1004;
    display: none;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
}
#guile-character {
    position: absolute;
    left: 0;
    width: 69px;
    height: 108px;
    z-index: 1004;
    display: none;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
}
#wonder-character {
    position: absolute;
    left: 0;
    width: 66px;
    height: 117px;
    z-index: 1004;
    display: none;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
}
#lemmings-container {
    position: absolute;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 1004;
    display: none;
    pointer-events: none;
    user-select: none;
}
.lemming-character {
    position: absolute;
    width: 12px;
    height: 20px;
    z-index: 1004;
    display: none;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
}
#rick-character {
    position: absolute;
    left: 0;
    width: 50px;
    height: 52px;
    z-index: 1004;
    display: none;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
}
#pckid-character {
    position: absolute;
    left: 0;
    width: 48px;
    height: 64px;
    z-index: 1004;
    display: none;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
}
#mummy-character {
    position: absolute;
    left: 0;
    width: 82px;
    height: 100px;
    z-index: 1004;
    display: none;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
}
#loading-screen.hidden ~ #desktop {
    opacity: 1;
}
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(20px) rotate(-10deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) translateY(-10px) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0);
    }
}
.icon {
    width: clamp(60px, 22vw, 110px);
    aspect-ratio: 1/1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    opacity: 0;
    animation: bounceIn 0.6s cubic-bezier(0.2, 0.8, 0.4, 1.2) forwards;
}
.icon:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}
.icon.selected {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 10px;
}
.icon img {
    width: 64%;
    max-width: 64px;
    aspect-ratio: 1/1;
    object-fit: contain;
    margin-bottom: 10%;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
}
.icon span {
    font-size: clamp(10px, 2vw, 14px);
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
}
#taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-height);
    min-height: var(--taskbar-min-height);
    max-height: var(--taskbar-max-height);
    background: rgba(0, 80, 150, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 212, 255, 0.6);
    display: flex;
    align-items: center;
    padding: 0 1%;
    margin: 0;
    z-index: 1005;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}
#loading-screen.hidden ~ #taskbar {
    opacity: 1;
}
#start-button {
    height: 70%;
    max-height: 30px;
    padding: 0 2%;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid #00d4ff;
    border-radius: 5px;
    color: #00d4ff;
    font-size: clamp(10px, 2.5vw, 13px);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1%;
    margin-left: 0;
}
#start-button:hover {
    background: rgba(0, 212, 255, 0.4);
}
#clock {
    margin-left: auto;
    font-size: clamp(10px, 2.5vw, 13px);
    color: #888;
    padding: 1% 2%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.window {
    position: absolute;
    width: clamp(280px, 80vw, 400px);
    height: auto;
    max-height: 70vh;
    background: #2a2a4a;
    border: 1px solid #00d4ff;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    z-index: 100;
    animation: windowOpen 0.3s ease;
    overflow: hidden;
}
.window.visible {
    display: flex;
}
@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.window-header {
    height: auto;
    min-height: 30px;
    max-height: 45px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 1px solid #00d4ff;
    display: flex;
    align-items: center;
    padding: 0 2%;
    cursor: move;
}
.window-header h3 {
    color: #fff;
    font-size: 14px;
    margin-left: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.window-qrcode {
    width: 20px;
    height: 20px;
    margin-left: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 3px;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    cursor: pointer;
}
.window-qrcode:hover {
    opacity: 1;
    transform: scale(1.1);
}
.window-close {
    margin-left: auto;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 22px;
    transition: color 0.2s;
}
.window-close:hover {
    color: #ff5555;
}
.window-body {
    padding: 8px 10px;
    overflow-y: auto;
    position: relative;
}
.qr-container {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.window-qrcode {
    position: relative;
    width: 66px;
    height: 66px;
    background: #fff;
    border: 2px solid #00d4ff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    z-index: 10;
    display: block;
}
.window-qrcode:hover {
    transform: scale(1.05);
}
.window-qrcode.copied {
    border-color: #50fa7b !important;
    box-shadow: 0 0 10px rgba(80, 250, 123, 0.7) !important;
}
.qr-copied-message {
    background: #50fa7b;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    display: none;
    z-index: 11;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    margin-top: 4px;
}
.window-body p {
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    margin-right: 73px;
}
.launch-btn {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(180deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-align: center;
    margin-right: 73px;
}
.launch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}
.launch-btn.copied {
    background: linear-gradient(180deg, #50fa7b 0%, #40c060 100%) !important;
    transform: translateY(0) !important;
    box-shadow: none !important;
}
.explorer-tree {
    color: #ccc;
    font-size: 13px;
    margin-bottom: 10px;
    margin-right: 73px;
    font-family: 'Courier New', monospace;
}
.explorer-item {
    padding: 6px 0;
    border-left: 2px solid #333;
    padding-left: 10px;
    margin-left: 8px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: color 0.2s;
}
.explorer-item.clickable-url:hover {
    color: #00d4ff;
    cursor: pointer;
}
.explorer-item:first-child {
    border-left: 2px solid #00d4ff;
    margin-left: 0;
    padding-left: 8px;
}
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a1a2e;
}
::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #0099cc;
}
.window-resize {
    position: absolute;
    width: 15px;
    height: 15px;
    background: #00d4ff;
    right: 0;
    bottom: 0;
    cursor: nwse-resize;
    z-index: 10;
}
#start-menu {
    position: absolute;
    bottom: 100%;
    left: 1%;
    width: clamp(200px, 40vw, 250px);
    background: #1a1a2e;
    border: 1px solid #00d4ff;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 1000;
    margin-bottom: 1%;
}
#start-menu.visible {
    display: block;
}
.start-menu-content {
    padding: 3%;
}
.start-menu-title {
    color: #fff;
    font-size: clamp(10px, 2vw, 14px);
    margin: 0 0 8px 0;
    line-height: 1.4;
}
.start-menu-text {
    color: #fff;
    font-size: clamp(11px, 2.5vw, 14px);
    margin: 0 0 2% 0;
    line-height: 1.4;
}
.start-menu-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3%;
    padding-top: 2%;
    border-top: 1px solid #00d4ff;
}
.start-menu-footer span {
    color: #888;
    font-size: clamp(9px, 2vw, 11px);
}
#reset-button {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 2%;
}
#reset-button img {
    width: clamp(20px, 4vw, 24px);
    height: clamp(20px, 4vw, 24px);
    opacity: 0.7;
    transition: opacity 0.2s;
}
#reset-button:hover img {
    opacity: 1;
}
#reset-button .tooltip {
    display: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 1%;
    background: #2a2a4a;
    color: #fff;
    padding: 1% 2%;
    border-radius: 4px;
    font-size: clamp(9px, 2vw, 11px);
    white-space: nowrap;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
#reset-button:hover .tooltip {
    display: block;
}

.ship {
    position: absolute;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
    z-index: 1004;
    transform-origin: center;
}