#dosbox {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: #000;
    overflow: hidden;
}

#jsdos {
    display: block;

    width: 100%;
    height: auto;

    background: #000;

    image-rendering: pixelated;

    cursor: default;
}

#dosbox canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
}

#dosbox .loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #080808;
    color: #f4f4f4;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
}

.page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 18px;
    background: #111;
    border-bottom: 1px solid #292929;
}

.brand {
    font-weight: 900;
    letter-spacing: 2px;
    font-size: 20px;
}

.subtitle {
    margin-top: 3px;
    color: #999;
    font-size: 12px;
}

.actions {
    display: flex;
    gap: 8px;
}

button,
.back {
    appearance: none;
    border: 1px solid #444;
    border-radius: 8px;
    background: #1c1c1c;
    color: #fff;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.back:hover {
    background: #2a2a2a;
}

.launcher,
.player-page {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 28px 18px;
}

.launcher h1,
.game-heading h1 {
    margin: 0 0 8px;
}

.intro,
.game-heading p {
    color: #aaa;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.game-card {
    min-height: 150px;
    padding: 20px;
    border: 1px solid #303030;
    border-radius: 14px;
    background: linear-gradient(145deg, #161616, #0d0d0d);
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform .15s ease, border-color .15s ease;
}

.game-card:hover {
    transform: translateY(-2px);
    border-color: #777;
}

.game-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.game-title {
    font-size: 19px;
    font-weight: 800;
}

.game-description {
    color: #999;
    font-size: 13px;
    margin-top: 7px;
    line-height: 1.4;
}

.notice {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    color: #bbb;
}

.game-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.dosbox {
    width: 100%;
    min-height: 480px;
    background: #000;
    border: 1px solid #333;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.dosbox canvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 170px);
    object-fit: contain;
    image-rendering: pixelated;
    margin: 0 auto;
    background: #000;
}

.loading {
    min-height: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ddd;
}

.loading span {
    color: #888;
    font-size: 13px;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #333;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hint {
    color: #888;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

footer {
    margin-top: auto;
    padding: 18px;
    text-align: center;
    color: #666;
    font-size: 12px;
}

code {
    background: #1a1a1a;
    padding: 2px 5px;
    border-radius: 4px;
}

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
    }

    .game-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dosbox {
        min-height: 300px;
    }

    .loading {
        min-height: 300px;
    }

    .dosbox canvas {
        max-height: none;
    }
}
