@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("./fonts/inter-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("./fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
        U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --tmg-bg: #ffffff;
    --tmg-layout: #e6ecf1;
    --tmg-primary: #0000df;
    --tmg-primary-active: #0000de;
    --tmg-text-secondary: #555555;
    --tmg-border: #dedede;
    --tmg-road: #555566;
    --tmg-warning: #fbb323;
    --tmg-error: #ff4d4f;
    --tmg-success: #52c41a;
    --tmg-yellow-accent: #c9900e;
    --tmg-red-accent: #d9363d;
    --tmg-dark-accent: #333333;
    --tmg-wheel: #2d3436;
    --tmg-rim: #b2bec3;
    --tmg-pink: #ffb6c1;
    --tmg-font-sans: "Inter", Arial, sans-serif;
    --tmg-font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

body.tuner-game-page {
    margin: 0;
    background: var(--tmg-bg);
    font-family: var(--tmg-font-sans);
}

#tuner-maintenance-game,
#tuner-maintenance-game * {
    box-sizing: border-box;
}

#tuner-maintenance-game {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    overflow-x: clip;
    padding: clamp(12px, 3vw, 20px);
    background: var(--tmg-bg);
    color: var(--tmg-text-secondary);
    font-family: var(--tmg-font-sans);
    text-align: center;
}

#tuner-maintenance-game .tuner-game__container {
    width: min(100%, 900px);
}

#tuner-maintenance-game .tuner-game__logo-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

#tuner-maintenance-game .tuner-game__logo-icon {
    width: 56px;
    height: 56px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: var(--tmg-primary);
    color: var(--tmg-bg);
    font-size: 28px;
    font-weight: 800;
}

#tuner-maintenance-game .tuner-game__logo-text {
    color: var(--tmg-primary);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

#tuner-maintenance-game .tuner-game__title {
    margin: 0 0 8px;
    color: var(--tmg-primary);
    font-family: var(--tmg-font-sans);
    font-size: clamp(1.6rem, 5vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
    text-wrap: balance;
}

#tuner-maintenance-game .tuner-game__title--standalone {
    max-width: 27ch;
    margin-right: auto;
    margin-bottom: 24px;
    margin-left: auto;
}

#tuner-maintenance-game .tuner-game__subtitle {
    max-width: 56ch;
    margin: 0 auto 24px;
    color: var(--tmg-text-secondary);
    font-size: 1rem;
    line-height: 1.57;
    text-wrap: pretty;
}

#tuner-maintenance-game .tuner-game__wrapper {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--tmg-border);
    border-radius: 15px;
    background: var(--tmg-bg);
    box-shadow: 0 4px 24px rgb(0 0 223 / 8%), 0 1px 3px rgb(0 0 223 / 4%);
    outline: none;
}

#tuner-maintenance-game .tuner-game__wrapper:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--tmg-primary) 55%, transparent);
    outline-offset: 3px;
}

#tuner-maintenance-game .tuner-game__canvas {
    display: block;
    width: 100%;
    height: clamp(200px, 38vh, 320px);
    cursor: pointer;
    touch-action: manipulation;
}

#tuner-maintenance-game .tuner-game__instructions {
    min-height: 46px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px 16px;
    flex-wrap: wrap;
    border-top: 1px solid var(--tmg-border);
    background: var(--tmg-layout);
    color: var(--tmg-text-secondary);
    font-size: 0.85rem;
}

#tuner-maintenance-game .tuner-game__instructions kbd {
    padding: 3px 8px;
    border: 1px solid var(--tmg-border);
    border-radius: 3px;
    background: var(--tmg-bg);
    color: var(--tmg-primary);
    font-family: var(--tmg-font-mono);
    font-size: 0.8rem;
    font-weight: 600;
}

#tuner-maintenance-game .tuner-game__actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#tuner-maintenance-game .tuner-game__action {
    min-width: 168px;
    min-height: 48px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tmg-primary);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
}

#tuner-maintenance-game .tuner-game__action--primary {
    background: var(--tmg-primary);
    color: var(--tmg-bg);
}

#tuner-maintenance-game .tuner-game__action--primary:hover {
    background: var(--tmg-primary-active);
}

#tuner-maintenance-game .tuner-game__action--secondary {
    background: var(--tmg-bg);
    color: var(--tmg-primary);
}

#tuner-maintenance-game .tuner-game__action--secondary:hover {
    background: var(--tmg-layout);
}

#tuner-maintenance-game .tuner-game__action:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--tmg-primary) 55%, transparent);
    outline-offset: 3px;
}

#tuner-maintenance-game .tuner-game__action:active {
    border-color: var(--tmg-primary-active);
    background: var(--tmg-primary-active);
    color: var(--tmg-bg);
}

#tuner-maintenance-game .tuner-game__score,
#tuner-maintenance-game .tuner-game__high-score {
    position: absolute;
    top: 12px;
    z-index: 1;
    padding: 4px 10px;
    border: 1px solid var(--tmg-border);
    border-radius: 5px;
    background: rgb(255 255 255 / 90%);
    font-family: var(--tmg-font-mono);
}

#tuner-maintenance-game .tuner-game__score {
    right: 16px;
    color: var(--tmg-primary);
    font-size: 1.1rem;
    font-weight: 800;
}

#tuner-maintenance-game .tuner-game__high-score {
    left: 16px;
    color: var(--tmg-text-secondary);
    font-size: 0.85rem;
}

#tuner-maintenance-game .tuner-game__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 600px) {
    #tuner-maintenance-game .tuner-game__logo-bar {
        margin-bottom: 10px;
    }

    #tuner-maintenance-game .tuner-game__logo-icon {
        width: 46px;
        height: 46px;
        font-size: 24px;
    }

    #tuner-maintenance-game .tuner-game__logo-text {
        font-size: 1.65rem;
    }

    #tuner-maintenance-game .tuner-game__subtitle {
        margin-bottom: 14px;
        font-size: 0.9rem;
    }

    #tuner-maintenance-game .tuner-game__title--standalone {
        margin-bottom: 14px;
    }

    #tuner-maintenance-game .tuner-game__canvas {
        height: clamp(190px, 38vh, 260px);
    }

    #tuner-maintenance-game .tuner-game__instructions {
        padding-inline: 10px;
        font-size: 0.75rem;
    }

    #tuner-maintenance-game .tuner-game__actions {
        margin-top: 14px;
    }

    #tuner-maintenance-game .tuner-game__action {
        flex: 1 1 160px;
        max-width: 210px;
    }
}

@media (max-height: 540px) and (orientation: landscape) {
    #tuner-maintenance-game {
        place-items: start center;
    }

    #tuner-maintenance-game .tuner-game__logo-bar {
        margin-bottom: 6px;
    }

    #tuner-maintenance-game .tuner-game__logo-icon {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    #tuner-maintenance-game .tuner-game__logo-text {
        font-size: 1.4rem;
    }

    #tuner-maintenance-game .tuner-game__title {
        font-size: 1.35rem;
    }

    #tuner-maintenance-game .tuner-game__subtitle {
        margin-bottom: 8px;
        font-size: 0.82rem;
    }

    #tuner-maintenance-game .tuner-game__canvas {
        height: 190px;
    }
}
