body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    color: white;
    font-family: 'Courier New', Courier, monospace;
    touch-action: none;
    user-select: none;
}

canvas {
    display: block;
    cursor: crosshair;
    position: relative;
    z-index: 0;
}

#ui {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    font-size: 20px;
    text-align: center;
    pointer-events: none;
    text-shadow: 0 0 5px #000;
    z-index: 5;
}

#bestTime {
    font-size: 14px;
    color: #aaa;
    margin-top: 5px;
    display: block;
}

.stable {
    color: #0f0;
}

.warning {
    color: #f00;
    animation: blink 0.2s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

#menuScreen,
#settingsScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10;
}

h1 {
    margin: 0 0 10px 0;
    font-size: 40px;
    color: #fff;
    text-shadow: 0 0 10px #0f0;
    text-transform: uppercase;
    text-align: center;
    line-height: 1;
}

h2 {
    color: #0f0;
    text-transform: uppercase;
    margin-bottom: 30px;
}

p {
    margin: 10px 0;
    color: #aaa;
    text-align: center;
    max-width: 600px;
}

.btn {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 24px;
    cursor: pointer;
    background: transparent;
    border: 2px solid #0f0;
    color: #0f0;
    font-family: inherit;
    font-weight: bold;
    transition: 0.2s;
    text-transform: uppercase;
}

.btn:hover {
    background: #0f0;
    color: #000;
    box-shadow: 0 0 20px #0f0;
}

.btn-small {
    padding: 10px 20px;
    font-size: 18px;
    border-color: #666;
    color: #aaa;
}

.btn-small:hover {
    border-color: #fff;
    color: #fff;
    box-shadow: none;
    background: #333;
}

.controls-hint {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    border: 1px solid #333;
    padding: 10px;
    border-radius: 5px;
}

/* Настройки */
.setting-row {
    margin-bottom: 20px;
    width: 300px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

label {
    color: #0f0;
    font-weight: bold;
}

input[type=range] {
    -webkit-appearance: none;
    width: 150px;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #0f0;
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 10px #0f0;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #333;
}

.lang-buttons {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: transparent;
    border: 1px solid #444;
    color: #666;
    padding: 5px 10px;
    cursor: pointer;
    font-family: inherit;
}

.lang-btn.active {
    border-color: #0f0;
    color: #0f0;
    font-weight: bold;
}

#observer-display {
    position: absolute;
    top: 70px;
    width: 100%;
    text-align: center;
    color: #0ff;
    /* Cyan terminal style */
    font-size: 16px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px #0ff;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.typing-fx {
    border-right: 2px solid #0ff;
    animation: blinkCursor 0.7s step-end infinite;
}

@keyframes blinkCursor {
    50% {
        border-color: transparent;
    }
}