* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tahoma', 'MS Sans Serif', sans-serif;
    background: linear-gradient(135deg, #1f4037, #99f2c8);
    height: 100vh;
    overflow: hidden;
    touch-action: none;
    -webkit-text-size-adjust: none; /* Prevent font scaling */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.screen {
    width: 100vw;
    min-height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

/* Login Screen */
#loginScreen {
   background: linear-gradient(135deg, #667eea, #764ba2);
   display: flex;
   align-items: center;
   justify-content: center;
   touch-action: none;
}

.login-container {
   background: #f0f0f0;
   border: 3px solid #0054e3;
   border-radius: 8px;
   padding: 30px;
   box-shadow: 4px 4px 10px rgba(0,0,0,0.3);
   text-align: center;
   width: 320px;
   max-width: 90vw;
   margin: 0 auto;
   
   /* Fixed positioning approach */
   position: relative;
   height: 280px;
   display: flex;
   flex-direction: column;
   justify-content: center;
   box-sizing: border-box;
}

/* Make both containers occupy the same position */
#loginMessage, #hintContainer {
   position: absolute;
   top: 100%;  /* Same position for both */
   left: 0;
   right: 0;
   margin-top: 5px;
   height: 40px;
   z-index: 10;
}

/* Smooth transitions for message appearance */
#loginMessage, #hintContainer {
    transition: none !important;
}

.user-icon {
    font-size: 48px;
    margin-bottom: 10px;
    touch-action: none;
    -webkit-touch-callout: none;
}

.login-container h2 {
    color: #0054e3;
    margin-bottom: 20px;
    font-size: 18px;
}

.password-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

#passwordInput {
    padding: 8px;
    border: 2px inset #c0c0c0;
    font-size: 16px;
    width: 200px;
    font-family: 'Tahoma', sans-serif;
    touch-action: manipulation;
    -webkit-user-select: text;
}

#loginBtn {
    padding: 8px 15px;
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f1f1f1 50%, 
        #dfdfdf 51%, 
        #f6f6f6 100%);
    border-width: 1px;
    border-style: solid;
    border-color: #dfdfdf #9a9a9a #9a9a9a #dfdfdf;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    min-width: 44px;
    touch-action: none;
    -webkit-touch-callout: none;
}

#loginBtn:active {
    background: linear-gradient(to bottom, 
        #dfdfdf 0%, 
        #f1f1f1 50%, 
        #ffffff 51%, 
        #f6f6f6 100%);
    border-color: #9a9a9a #dfdfdf #dfdfdf #9a9a9a;
}

.login-message {
    margin-top: 10px;
    min-height: 15px;
}

.hint-container {
    margin-top: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Desktop Screen */
#desktopScreen {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="%23ffffff" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="%2358a558"/><rect width="100" height="100" fill="url(%23grid)"/></svg>') center/cover;
    width: 100vw;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    touch-action: none;
    -webkit-touch-callout: none;
}

.desktop {
    min-height: calc(100vh - 40px);
    position: relative;
    padding: 20px;
    padding-top: calc(env(safe-area-inset-top, 30px) + 30px);
    touch-action: none;
    -webkit-touch-callout: none;
}

.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, #3168d5, #1941a5);
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-top: 1px solid #92c1f7;
    z-index: 200;
}

.start-button {
    background: linear-gradient(180deg, #4a9eff, #0061ff);
    color: white;
    padding: 6px 15px;
    border-radius: 3px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #1941a5;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    min-width: 80px;
    touch-action: none;
    -webkit-touch-callout: none;
    line-height: normal;
}

.taskbar-time {
    margin-left: auto;
    color: white;
    font-size: 12px;
    margin-right: 10px;
    font-family: 'Tahoma', sans-serif;
}

.logout-btn {
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f1f1f1 47%, 
        #dfdfdf 48%, 
        #f6f6f6 100%);
    border: 1px solid transparent;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #9a9a9a;
    border-bottom-color: #9a9a9a;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 11px;
    color: #000;
    font-family: 'Tahoma', sans-serif;
    font-weight: normal;
    border-radius: 0;
    box-shadow: none;
    text-shadow: none;
    outline: none;
    line-height: normal;
    min-width: 80px;
    touch-action: none;
    -webkit-touch-callout: none;
}

.logout-btn:hover {
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f8f8f8 47%, 
        #e6e6e6 48%, 
        #fdfdfd 100%);
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
}

.logout-btn:active {
    background: linear-gradient(to bottom, 
        #dfdfdf 0%, 
        #f1f1f1 47%, 
        #ffffff 48%, 
        #f6f6f6 100%);
    border-top-color: #9a9a9a;
    border-left-color: #9a9a9a;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
    box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
}

.desktop-icon {
    position: absolute;
    width: 80px;
    text-align: center;
    cursor: pointer;
    padding: 12px;
    border-radius: 4px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -webkit-touch-callout: none;
    min-height: 80px;
}

.desktop-icon:hover {
    background: rgba(255,255,255,0.2);
}

.desktop-icon.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.desktop-icon.disabled:hover {
    background: none;
}

.desktop-icon.enabled {
    opacity: 1;
    cursor: pointer;
}

.desktop-icon.enabled:hover {
    background: rgba(255,255,255,0.2);
}

.desktop-icon .icon {
    font-size: 32px;
    margin-bottom: 5px;
    touch-action: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -webkit-touch-callout: none;
}

.desktop-icon span {
    color: white;
    font-size: 11px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    display: block;
    font-family: 'Tahoma', sans-serif;
    touch-action: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -webkit-touch-callout: none;
}

#mediaPlayerIcon { top: 30px; left: 20px; }
#aimIcon { top: 30px; left: 120px; }
#decoderIcon { top: 140px; left: 20px; }
#videoIcon { top: 140px; left: 120px; }
#videoFileIcon { top: 250px; left: 20px; }

/* Windows */
.window {
    position: absolute;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    min-width: 400px;
    min-height: 300px;
    top: 50px;
    left: 50px;
    z-index: 100;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: none;
    transform: translateZ(0); /* Force hardware acceleration */
    overflow: hidden;
}

.window-header {
    background: linear-gradient(180deg, #0997ff, #0053ee);
    color: white;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    cursor: move;
    user-select: none;
    font-family: 'Tahoma', sans-serif;
    touch-action: none;
    -webkit-touch-callout: none;
    position: relative;
}

.window-header .window-title {
    flex: 1;
    text-align: left;
    margin-right: 30px;
}

.close-btn {
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f1f1f1 50%, 
        #dfdfdf 51%, 
        #f6f6f6 100%);
    border: 1px solid;
    border-color: #ffffff #9a9a9a #9a9a9a #ffffff;
    width: 20px;
    height: 18px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
    color: #000;
    font-family: 'Tahoma', sans-serif;
    min-width: 20px;
    touch-action: none;
    -webkit-touch-callout: none;
    padding: 0;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.close-btn:hover {
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f8f8f8 50%, 
        #e6e6e6 51%, 
        #fdfdfd 100%);
}

.close-btn:active {
    background: linear-gradient(to bottom, 
        #dfdfdf 0%, 
        #f1f1f1 50%, 
        #ffffff 51%, 
        #f6f6f6 100%);
    border-color: #9a9a9a #ffffff #ffffff #9a9a9a;
}

.window-content {
    padding: 15px;
    background: #c0c0c0;
    font-family: 'Tahoma', sans-serif;
    overflow: auto;
}

/* Media Player */
.song-list {
    border: 2px inset #c0c0c0;
    background: white;
    padding: 10px;
    margin: 15px 0;
    min-height: 200px;
    touch-action: manipulation;
}

.song-item {
    background: #f0f0f0;
    border: 1px solid #808080;
    padding: 8px;
    margin: 5px 0;
    cursor: move;
    user-select: none;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    min-height: 40px;
    line-height: 1.5;
}

.song-item:hover {
    background: #e0e0e0;
}

.song-item.dragging {
    opacity: 0.5;
    background: transparent !important;
    border: none !important;
}

.song-item.drag-over {
    border: 2px dashed #0066cc !important;
    background: transparent !important;
}

.submit-btn, .decode-btn, .unlock-btn {
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f1f1f1 50%, 
        #dfdfdf 51%, 
        #f6f6f6 100%);
    border-width: 1px;
    border-style: solid;
    border-color: #ffffff #9a9a9a #9a9a9a #ffffff;
    padding: 6px 12px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 11px;
    font-family: 'Tahoma', sans-serif;
    color: #000;
    min-width: 80px;
    touch-action: none;
    -webkit-touch-callout: none;
}

.submit-btn:hover, .decode-btn:hover, .unlock-btn:hover {
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f8f8f8 50%, 
        #e6e6e6 51%, 
        #fdfdfd 100%);
}

.submit-btn:active, .decode-btn:active, .unlock-btn:active {
    background: linear-gradient(to bottom, 
        #dfdfdf 0%, 
        #f1f1f1 50%, 
        #ffffff 51%, 
        #f6f6f6 100%);
    border-color: #9a9a9a #ffffff #ffffff #9a9a9a;
}

/* AUTHENTIC XP MESSAGE BOXES */
.xp-error-box, .xp-warning-box, .xp-success-box, .xp-hint-box {
    background: #f0f0f0;
    border: 2px outset #c0c0c0;
    margin: 5px 0;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    position: relative;
    touch-action: none;
    -webkit-touch-callout: none;
    overflow: hidden;
}

.xp-error-box {
    border-left: 4px solid #cc0000;
}

.xp-warning-box {
    border-left: 4px solid #ff9900;
}

.xp-success-box {
    border-left: 4px solid #00aa00;
}

.xp-hint-box {
    border-left: 4px solid #0066cc;
}

.xp-dialog-header {
    background: linear-gradient(to bottom, #e6e6fa, #d0d0d0);
    padding: 4px 8px;
    border-bottom: 1px solid #9a9a9a;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    touch-action: none;
    -webkit-touch-callout: none;
}

.xp-dialog-header .xp-title {
    flex: 1;
    text-align: left;
    margin-right: 30px;
}

.xp-close-btn {
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f1f1f1 50%, 
        #dfdfdf 51%, 
        #f6f6f6 100%);
    border: 1px solid;
    border-color: #ffffff #9a9a9a #9a9a9a #ffffff;
    width: 20px;
    height: 18px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    color: #000;
    font-family: 'Tahoma', sans-serif;
    min-width: 20px;
    touch-action: none;
    -webkit-touch-callout: none;
    padding: 0;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.xp-close-btn:hover {
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f8f8f8 50%, 
        #e6e6e6 51%, 
        #fdfdfd 100%);
}

.xp-close-btn:active {
    background: linear-gradient(to bottom, 
        #dfdfdf 0%, 
        #f1f1f1 50%, 
        #ffffff 51%, 
        #f6f6f6 100%);
    border-color: #9a9a9a #ffffff #ffffff #9a9a9a;
}

.xp-icon {
    font-size: 14px;
}

.xp-title {
    font-weight: bold;
    font-size: 11px;
}

.xp-dialog-content {
    padding: 10px;
    background: #f0f0f0;
    overflow: auto;
}

.xp-dialog-content p {
    margin: 4px 0;
    color: #000;
}

.xp-code-container {
    display: flex;
    gap: 6px;
    margin: 8px 0;
    align-items: center;
}

.xp-textbox {
    flex: 1;
    padding: 3px;
    border: 2px inset #c0c0c0;
    background: white;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #000;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    touch-action: manipulation;
}

.xp-button {
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f1f1f1 50%, 
        #dfdfdf 51%, 
        #f6f6f6 100%);
    border-width: 1px;
    border-style: solid;
    border-color: #ffffff #9a9a9a #9a9a9a #ffffff;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 11px;
    font-family: 'Tahoma', sans-serif;
    color: #000;
    min-width: 80px;
    touch-action: none;
    -webkit-touch-callout: none;
}

.xp-button:hover {
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f8f8f8 50%, 
        #e6e6e6 51%, 
        #fdfdfd 100%);
}

.xp-button:active {
    background: linear-gradient(to bottom, 
        #dfdfdf 0%, 
        #f1f1f1 50%, 
        #ffffff 51%, 
        #f6f6f6 100%);
    border-color: #9a9a9a #ffffff #ffffff #9a9a9a;
}

.xp-status-text {
    color: #006600;
    font-weight: bold;
    font-size: 10px;
    margin-top: 4px;
}

.xp-info-box {
    background: #ffffcc;
    border: 1px solid #cccc00;
    margin: 8px 0 0 0;
    padding: 6px;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.xp-info-icon {
    font-size: 16px;
    margin-top: 1px;
}

.xp-info-text {
    font-size: 11px;
    line-height: 1.3;
}

.xp-info-text strong {
    color: #0066cc;
}

/* AIM Window */
.aim-content {
    display: flex;
    gap: 10px;
}

.buddy-list {
    width: 150px;
    border: 2px inset #c0c0c0;
    background: white;
    padding: 5px;
    height: 200px;
    overflow-y: auto;
    touch-action: manipulation;
}

.buddy-item {
    padding: 3px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Tahoma', sans-serif;
}

.status-icon {
    font-size: 8px;
}

.chat-window {
    flex: 1;
    border: 2px inset #c0c0c0;
    background: white;
    height: 200px;
    overflow-y: auto;
}

.chat-messages {
    padding: 10px;
    font-size: 12px;
    height: 100%;
    overflow-y: auto;
    font-family: 'Tahoma', sans-serif;
}

.chat-msg {
    margin-bottom: 5px;
    word-wrap: break-word;
}

/* Base64 Decoder */
#base64Input {
    width: 100%;
    height: 80px;
    border: 2px inset #c0c0c0;
    padding: 5px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    background: white;
    font-size: 11px;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    touch-action: manipulation;
}

.decode-result {
    margin-top: 10px;
    min-height: 40px;
}

/* Video Window */
#videoPassword {
    width: 200px;
    padding: 5px;
    border: 2px inset #c0c0c0;
    margin-right: 10px;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    background: white;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    touch-action: manipulation;
}

.result-message {
    margin-top: 10px;
    min-height: 25px;
}

/* Video Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    touch-action: none;
    -webkit-touch-callout: none;
    overflow: hidden;
}

.video-modal-content {
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: #f0f0f0;
    border: 3px outset #c0c0c0;
    padding: 0;
    font-family: 'Tahoma', sans-serif;
    touch-action: none;
    -webkit-touch-callout: none;
}

.modal-header {
    background: linear-gradient(180deg, #0997ff, #0053ee);
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Tahoma', sans-serif;
    border-bottom: 2px inset #c0c0c0;
    position: relative;
    touch-action: none;
    -webkit-touch-callout: none;
}

.modal-header h2 {
    margin: 0;
    font-size: 12px;
    flex: 1;
    text-align: left;
    margin-right: 30px;
}

.close-video-btn {
    background: linear-gradient(to bottom, #ffffff 0%, #f1f1f1 50%, #dfdfdf 51%, #f6f6f6 100%);
    border: 1px solid;
    border-color: #ffffff #9a9a9a #9a9a9a #ffffff;
    width: 20px;
    height: 18px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    color: #000;
    font-family: 'Tahoma', sans-serif;
    min-width: 20px;
    touch-action: none;
    -webkit-touch-callout: none;
    padding: 0;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.close-video-btn:hover {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 50%, #e6e6e6 51%, #fdfdfd 100%);
}

.close-video-btn:active {
    background: linear-gradient(to bottom, #dfdfdf 0%, #f1f1f1 50%, #ffffff 51%, #f6f6f6 100%);
    border-color: #9a9a9a #ffffff #ffffff #9a9a9a;
}

.modal-body {
    padding: 20px;
    text-align: center;
    font-family: 'Tahoma', sans-serif;
    overflow: auto;
}

.modal-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

#rewardVideo {
    border: 2px inset #c0c0c0;
    background: #000;
    margin: 10px 0;
    max-width: 100%;
    height: auto;
}

/* Responsive Adjustments */
@media (max-width: 768px) { /* Mobile */
    .login-container {
        width: 300px;
        max-width: 95vw;
        padding: 20px;
    }

    .user-icon {
        font-size: 40px;
    }

    .login-container h2 {
        font-size: 16px;
    }

    .password-container {
        flex-direction: row;
        align-items: center;
    }

    #passwordInput {
        width: 180px;
        font-size: 14px;
    }

    #loginBtn {
        padding: 6px 12px;
        font-size: 10px;
        min-width: 40px;
    }

    .desktop {
        padding: 15px;
        padding-top: calc(env(safe-area-inset-top, 40px) + 50px);
        min-height: calc(100vh - 40px);
        touch-action: none;
        -webkit-touch-callout: none;
        overflow: hidden;
    }

    .desktop-icon {
        width: 50px;
        padding: 8px;
        min-height: 50px;
        touch-action: none;
        -webkit-touch-callout: none;
    }

    .desktop-icon .icon {
        font-size: 20px;
    }

    .desktop-icon span {
        font-size: 9px;
    }

    #mediaPlayerIcon { top: calc(env(safe-area-inset-top, 40px) + 50px); left: 10px; } /* ~90px */
    #aimIcon { top: calc(env(safe-area-inset-top, 40px) + 50px); left: 90px; } /* ~90px */
    #decoderIcon { top: calc(env(safe-area-inset-top, 40px) + 120px); left: 10px; } /* ~160px, approximates 180px */
    #videoIcon { top: calc(env(safe-area-inset-top, 40px) + 120px); left: 90px; } /* ~160px, approximates 180px */
    #videoFileIcon { top: calc(env(safe-area-inset-top, 40px) + 190px); left: 10px; } /* ~230px, approximates 270px */

    .window {
        width: calc(90vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
        max-width: calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
        max-height: calc(100vh - env(safe-area-inset-top, 40px) - env(safe-area-inset-bottom, 0px) - 80px);
        position: fixed;
        top: calc(env(safe-area-inset-top, 40px) + 20px);
        left: 0;
        right: 0;
        margin: 0 auto;
        min-width: unset;
        min-height: 200px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        z-index: 150;
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-text-size-adjust: none;
        transform: translateZ(0);
        box-sizing: border-box;
    }

    .window-header {
        padding: 8px 10px;
        min-height: 32px;
        pointer-events: none;
        touch-action: none;
        -webkit-touch-callout: none;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

    .window-header .window-title {
        margin: 0;
        padding: 0 30px;
        text-align: center;
        flex: 1;
        font-size: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .close-btn {
        min-width: 20px;
        width: 20px;
        height: 28px;
        font-size: 14px;
        line-height: 28px;
        padding: 0;
        pointer-events: auto;
        z-index: 200;
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
    }

    .window-content {
        padding: 15px;
        width: 100%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow: auto;
        box-sizing: border-box;
    }

    /* Media Player Window */
    .song-list {
        min-height: 120px;
        width: 90%;
        max-width: 300px;
        margin: 15px auto;
        background: white;
        border: 2px inset #c0c0c0;
        touch-action: manipulation;
    }

    .song-item {
        font-size: 10px;
        padding: 6px;
        min-height: 30px;
        line-height: 1.4;
        width: 100%;
        margin: 5px 0;
    }

    .submit-btn {
        display: block;
        margin: 10px auto 0;
        min-width: 80px;
    }

    /* Success Dialog */
    .xp-success-box.mobile-centered,
    .xp-error-box.mobile-centered,
    .xp-warning-box.mobile-centered,
    .xp-hint-box.mobile-centered {
        position: fixed;
        width: calc(90vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
        max-height: calc(100vh - env(safe-area-inset-top, 40px) - env(safe-area-inset-bottom, 0px) - 80px);
        top: calc(env(safe-area-inset-top, 40px) + 20px);
        left: 0;
        right: 0;
        margin: 0 auto;
        overflow: hidden;
        z-index: 160;
        background: #f0f0f0;
        border: 2px outset #c0c0c0;
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-text-size-adjust: none;
        transform: translateZ(0);
        box-sizing: border-box;
    }

    .xp-dialog-header {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 100%;
        box-sizing: border-box;
    }

    .xp-dialog-header .xp-title {
        margin: 0;
        padding: 0 30px;
        text-align: center;
        flex: 1;
        width: 100%;
        box-sizing: border-box;
    }

    .xp-close-btn {
        min-width: 20px;
        width: 20px;
        height: 28px;
        font-size: 14px;
        line-height: 28px;
        pointer-events: auto;
        z-index: 200;
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
    }

    .xp-dialog-content {
        text-align: center;
        padding: 10px;
        overflow: auto;
        box-sizing: border-box;
    }

    .xp-code-container {
        flex-direction: column;
        align-items: center;
        margin: 8px auto;
        width: 90%;
        max-width: 300px;
    }

    .xp-textbox {
        width: 100%;
        margin-bottom: 8px;
        user-select: text;
        -webkit-user-select: text;
        -moz-user-select: text;
        touch-action: manipulation;
    }

    .xp-button {
        margin: 0 auto;
        min-width: 80px;
    }

    .xp-status-text {
        text-align: center;
        width: 100%;
    }

    .xp-info-box {
        width: 90%;
        max-width: 300px;
        margin: 8px auto;
    }

    /* AIM Window */
    .aim-content {
        flex-direction: column;
        width: 90%;
        max-width: 300px;
        margin: 0 auto 10px;
    }

    .buddy-list {
        width: 100%;
        height: 80px;
        margin-bottom: 10px;
        touch-action: manipulation;
    }

    .chat-window {
        width: 100%;
        height: 120px;
        overflow-y: auto;
    }

    /* Base64 Decoder Window */
    #base64Input {
        width: 90%;
        max-width: 300px;
        height: 80px;
        margin: 0 auto 10px;
        display: block;
        user-select: text;
        -webkit-user-select: text;
        -moz-user-select: text;
        touch-action: manipulation;
    }

    .decode-btn {
        display: block;
        margin: 10px auto 0;
        min-width: 80px;
    }

    .decode-result {
        width: 90%;
        max-width: 300px;
        margin: 10px auto;
    }

    /* Video Window */
    #videoPassword {
        width: 90%;
        max-width: 200px;
        margin: 0 auto 10px;
        display: block;
        user-select: text;
        -webkit-user-select: text;
        -moz-user-select: text;
        touch-action: manipulation;
    }

    .unlock-btn {
        display: block;
        margin: 10px auto 0;
        min-width: 80px;
    }

    .result-message {
        width: 90%;
        max-width: 300px;
        margin: 10px auto;
    }

    .logout-btn {
        font-size: 9px;
        padding: 5px 10px;
        min-width: 70px;
    }

    .modal {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        top: env(safe-area-inset-top, 40px);
        left: 0;
        width: 100%;
        height: calc(100vh - env(safe-area-inset-top, 40px));
        overflow: hidden;
        touch-action: none;
        -webkit-touch-callout: none;
    }

    .video-modal-content {
        width: 90%;
        max-height: calc(80vh - env(safe-area-inset-top, 40px));
        overflow-y: auto;
        box-sizing: border-box;
    }

    #rewardVideo {
        width: 100%;
        height: auto;
        max-height: calc(80vh - 60px - env(safe-area-inset-top, 40px));
    }
}

@media (min-width: 769px) and (max-width: 1024px) { /* Tablet */
    .login-container {
        width: 350px;
        max-width: 90vw;
    }

    .user-icon {
        font-size: 48px;
    }

    .login-container h2 {
        font-size: 18px;
    }

    .password-container input {
        width: 200px;
        font-size: 16px;
    }

    #loginBtn {
        padding: 8px 15px;
        font-size: 11px;
    }

    .desktop {
        padding: 20px;
        padding-top: calc(env(safe-area-inset-top, 30px) + 10px);
        min-height: calc(100vh - 40px);
        touch-action: none;
        -webkit-touch-callout: none;
    }

    .desktop-icon {
        width: 70px;
        padding: 10px;
        min-height: 70px;
    }

    .desktop-icon .icon {
        font-size: 28px;
    }

    .desktop-icon span {
        font-size: 10px;
    }

    #mediaPlayerIcon { top: calc(env(safe-area-inset-top, 30px) + 5px); left: 20px; }
    #aimIcon { top: calc(env(safe-area-inset-top, 30px) + 5px); left: 120px; }
    #decoderIcon { top: calc(env(safe-area-inset-top, 30px) + 65px); left: 20px; }
    #videoIcon { top: calc(env(safe-area-inset-top, 30px) + 65px); left: 120px; }
    #videoFileIcon { top: calc(env(safe-area-inset-top, 30px) + 125px); left: 20px; }

    .window {
        min-width: 350px;
        min-height: 250px;
        max-width: 90vw;
        max-height: 80vh;
        top: calc(env(safe-area-inset-top, 30px) + 30px);
        left: 50%;
        transform: translateX(-50%);
        overflow: auto;
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-text-size-adjust: none;
    }

    .window-header {
        padding: 6px 10px;
    }

    .window-content {
        padding: 15px;
    }

    .song-list {
        min-height: 150px;
    }

    .buddy-list {
        width: 120px;
        height: 180px;
    }

    .chat-window {
        height: 180px;
    }

    .chat-messages {
        font-size: 11px;
    }

    #base64Input {
        height: 70px;
        font-size: 11px;
    }

    #videoPassword {
        width: 180px;
        font-size: 11px;
    }

    .modal {
        padding: 15px;
    }

    .video-modal-content {
        width: 80%;
        max-height: 85vh;
    }

    #rewardVideo {
        width: 100%;
        height: auto;
        max-height: calc(85vh - 60px);
    }
	.xp-text-display {
    flex: 1;
    padding: 3px;
    border: 2px inset #c0c0c0;
    background: white;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #000;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    touch-action: manipulation;
    pointer-events: auto;
    word-break: break-all;
    line-height: 1.3;
}
.xp-copy-status {
    margin-top: 10px;
    font-size: 11px;
    color: #000;
    text-align: center;
}
}