* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    background: #101010;
    color: #fff;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 24px;
}

header h1 {
    margin: 0;
    font-size: 32px;
}

header p {
    margin-top: 8px;
    color: #999;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.library {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(160px, 1fr));

    gap: 24px;
}

.game-card {
    display: block;

    overflow: hidden;

    color: #fff;
    text-decoration: none;

    background: #1c1c1c;

    border-radius: 16px;

    transition:
        transform 0.15s ease,
        background 0.15s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    background: #252525;
}

.game-card img {
    display: block;

    width: 100%;
    aspect-ratio: 3 / 4;

    object-fit: cover;

    background: #292929;
}

.game-info {
    padding: 14px;
}

.game-info h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.game-info span {
    color: #999;
}

/* Player */

.player-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #000;
}

.player-header {
    height: 56px;

    display: flex;
    align-items: center;
    gap: 20px;

    padding:
        env(safe-area-inset-top)
        18px
        0;

    background: #151515;

    position: relative;
    z-index: 10;
}

.back-button {
    color: #aaa;
    text-decoration: none;
    white-space: nowrap;
}

.back-button:hover {
    color: white;
}

#game-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-weight: 600;
}

.emulator-container {
    width: 100%;

    height: calc(
        100dvh
        - 56px
        - env(safe-area-inset-top)
    );

    padding: 0;
    margin: 0;
}

#game {
    width: 100%;
    height: 100%;
}

.player-error {
    position: fixed;

    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);

    padding: 20px;

    background: #311;
    border-radius: 12px;

    color: #ffb5b5;
}