* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #cbcaca;
    font-family: 'Roboto', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.text-container {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 0 12px;
}

#game-title {
    font-size: clamp(11px, 1.1vw, 18px);
    font-weight: 700;
    color: #000;
    line-height: 1.5;
}

#game-subtitle {
    font-size: clamp(8px, 0.75vw, 11px);
    color: #555;
    line-height: 1.4;
}

#note {
    font-size: clamp(8px, 0.75vw, 11px);
    color: #282828;
    margin-top: 16px;
    border-top: 1px solid #aaa;
    padding-top: 8px;
    width: 100%;
    text-align: center;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    padding: clamp(6px, 1vh, 14px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

canvas {
    display: block;
    border: 3px solid #fff;
    background-color: #000;
    width: min(
        calc((100vh - 80px) * (9/16)),
        calc(100vw - 220px)
    );
    height: min(
        calc(100vh - 80px),
        calc((100vw - 220px) * (16/9))
    );
}

#controls {
    display: flex;
    gap: 8px;
    justify-content: center;
}

input[type="button"] {
    background-color: #d3d3d3;
    border: 3px solid #a9a9a9;
    color: #000;
    font-size: clamp(10px, 0.9vw, 14px);
    cursor: pointer;
    padding: 5px 14px;
    border-radius: 5px;
    transition: background-color 0.2s, border-color 0.2s;
}

input[type="button"]:hover {
    background-color: #f5f5f5;
    border-color: #000;
}

.github-link a {
    text-decoration: none;
    color: white;
    font-size: clamp(11px, 0.9vw, 14px);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.github-link a:hover {
    color: #00b5cc;
}

.github-icon {
    width: 18px;
}

@media (max-width: 700px) {
    .text-container {
        display: none;
    }

    .container {
        padding: 4px;
        gap: 4px;
    }

    canvas {
        width: min(
            calc((100vh - 40px) * (9/16)),
            100vw
        );
        height: min(
            calc(100vh - 40px),
            calc(100vw * (16/9))
        );
    }

    input[type="button"] {
        display: none;
    }

    .github-link a {
        display: none;
    }
}