:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #050812;
}

body {
    display: grid;
    place-items: center;
}

button,
a {
    font: inherit;
}

.game-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 0%, rgba(80, 70, 255, 0.2), transparent 48%),
        #050812;
    user-select: none;
    touch-action: none;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    background: #070b18;
    image-rendering: auto;
}

.sound-toggle {
    position: absolute;
    z-index: 8;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #f8fbff;
    background: rgba(8, 13, 29, 0.76);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
    border-color: rgba(100, 228, 255, 0.72);
    background: rgba(12, 24, 45, 0.9);
}

.sound-toggle:focus-visible {
    outline: 2px solid rgba(100, 228, 255, 0.9);
    outline-offset: 2px;
}

.game-overlay {
    position: absolute;
    z-index: 7;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(3, 7, 18, 0.12), rgba(3, 7, 18, 0.64));
    transition: opacity 180ms ease, visibility 180ms ease;
}

.game-overlay[hidden] {
    display: none;
}

.overlay-card {
    width: min(520px, 88vw);
    padding: 30px 34px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    text-align: center;
    color: #fff;
    background: linear-gradient(145deg, rgba(10, 16, 34, 0.9), rgba(13, 23, 47, 0.78));
    box-shadow: 0 28px 75px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(12px);
}

.overlay-kicker {
    display: block;
    margin-bottom: 10px;
    color: #65e4ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.22em;
}

.overlay-card strong {
    display: block;
    font-size: clamp(26px, 4vw, 46px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.overlay-card p {
    margin: 14px 0 0;
    color: rgba(235, 242, 255, 0.78);
    font-size: clamp(13px, 1.7vw, 17px);
    line-height: 1.55;
}

.control-hint {
    position: absolute;
    z-index: 5;
    left: 14px;
    bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    max-width: calc(100% - 260px);
    color: rgba(231, 239, 255, 0.62);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.01em;
    pointer-events: none;
}

.control-hint span {
    padding: 4px 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(3, 8, 20, 0.45);
}

.powered-by {
    position: absolute;
    z-index: 6;
    right: 15px;
    bottom: 14px;
    color: rgba(230, 239, 255, 0.45);
    font-size: 10px;
    text-decoration: none;
}

.powered-by:hover,
.powered-by:focus-visible {
    color: rgba(101, 228, 255, 0.9);
}

@media (max-width: 720px), (max-height: 480px) {
    .sound-toggle {
        top: 8px;
        right: 8px;
        min-height: 32px;
        padding: 6px 10px;
        font-size: 11px;
    }

    .control-hint,
    .powered-by {
        display: none;
    }

    .overlay-card {
        padding: 20px 22px;
        border-radius: 18px;
    }
}
