/* Base styles for mobile (mobile-first approach) */
body {
    background-color: #008080; /* Windows 95 teal background */
    font-family: 'MS Sans Serif', Arial, sans-serif;
    margin: 0;
    padding: 8px;
    color: #000;
    font-size: 12px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.window {
    background-color: #C0C0C0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    width: 100%;
    max-width: calc(100vw - 16px);
    margin: 10px auto;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.title-bar {
    background-color: #000080;
    color: #fff;
    padding: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: break-word;
}

.title-bar-text {
    flex-grow: 1;
    text-align: center;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.title-bar-controls button {
    width: 18px;
    height: 18px;
    background-color: #C0C0C0;
    border: 1px solid;
    border-color: #fff #000 #000 #fff;
    cursor: pointer;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    touch-action: manipulation;
}

.title-bar-controls button:hover {
    background-color: #D3D3D3;
}

.window-body {
    padding: 6px;
    overflow-x: hidden;
}

.nav-bar {
    background-color: #C0C0C0;
    border: 2px solid;
    border-color: #000 #fff #fff #000;
    padding: 4px;
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    overflow-x: hidden;
}

.nav-button {
    display: inline-block;
    padding: 3px 6px;
    background-color: #C0C0C0;
    border: 1px solid;
    border-color: #fff #000 #000 #fff;
    text-decoration: none;
    color: #000;
    font-size: 12px;
    min-width: 44px;
    text-align: center;
    flex-grow: 1;
    /* Text wrapping for nav buttons */
    white-space: normal;
    overflow-wrap: break-word;
}

.nav-button:hover {
    background-color: #D3D3D3;
    border-color: #000 #fff #fff #000;
}

.content {
    background-color: #fff;
    border: 2px solid;
    border-color: #000 #fff #fff #000;
    padding: 6px;
    font-size: 14px;
    max-width: 100%; /* Ensure content stays within container */
    word-wrap:break-word;
    overflow-x: hidden; /* Prevent horizontal overflow */
    overflow-wrap: break-word; /* Break long words */
    white-space: normal; /* Allow natural wrapping */
    /* Optional: Add hyphens for long words */
    hyphens: auto;
}

.content h1 {
    font-size: 16px;
    margin: 0 0 6px;
    color: #000080;
    overflow-wrap: break-word; /* Ensure heading text wraps */
    white-space: normal;
    text-align: center;
}

.retro-image {
    width: 48px;
    height: auto;
    margin: 6px 0;
    max-width: 100%;
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    body {
        padding: 15px;
        font-size: 16px;
    }

    .window {
        max-width: 800px;
        margin: 30px auto;
        box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    }

    .title-bar {
        font-size: 20px;
    }

    .title-bar-controls button {
        width: 22px;
        height: 22px;
        font-size: 16px;
    }

    .window-body {
        padding: 10px;
    }

    .nav-bar {
        margin-bottom: 10px;
    }

    .nav-button {
        padding: 5px 10px;
        font-size: 18px;
    }

    .content {
        padding: 10px;
        font-size: 24px;
    }

    .content h1 {
        font-size: 22px;
    }

    .retro-image {
        width: 80px;
        height: auto;
    }
}

/* Desktop screens */
@media (min-width: 1024px) {
    body {
        padding: 20px;
        font-size: 18px;
    }

    .window {
        max-width: 1280px;
        margin: 50px auto;
        box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    }

    .title-bar {
        font-size: 24px;
    }

    .title-bar-controls button {
        width: 24px;
        height: 24px;
        font-size: 18px;
    }

    .window-body {
        padding: 10px;
    }

    .nav-button {
        font-size: 24px;
    }

    .content {
        font-size: 18px;
    }

    .content h1 {
        font-size: 24px;
    }

    .retro-image {
        width: 88px;
        height: 31px;
    }
}