.g-container {
    text-align: center;
    width: 100%;
    max-width: 500px;
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: 50px;
}

.game-container {
    border: 2px solid #4CAF50;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.game-description {
    padding: 15px 0;
    text-align: left;
    border-radius: 10px;
    color: #3f2e2b;
}

.game-description ol {
    margin: 10px 0;
    padding-left: 20px;
}

.game-description li {
    margin-bottom: 5px;
}

.feedback-area {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.gbtn {
    padding: 12px 24px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    transition: background-color 0.3s, opacity 0.3s;
    touch-action: manipulation;
    display: inline-block;
    text-decoration: none;
}

.btn-game-start,
.btn-next-step {
    background-color: #45a049;
    color: white;
    font-family: "SONGER Grotesque", sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 100%;
}

.btn-game-start:hover,
.btn-next-step:hover {
    background-color: #317234;
}

.btn-demo-start {
    background-color: var(--orange-mustard);
    width: 60%;
    max-width: 60%;
    color: white;
    font-family: "SONGER Grotesque", sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-demo-start:hover {
    background-color: var(--orange-mustard-alt);
}

.btn-over-circle:active,
.btn-over-circle:hover {
    transform: translate(-50%, -50%) !important;
}

.btn-repeat {
    background-color: #b51e02;
    font-family: "SONGER Grotesque", sans-serif;
    color: white;
    width: 100%;
}

/* .btn-next-step {
    background-color: #b51e02;
    color: white;
} */

.btn-over-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background-color: #b51e02;
    width: 60%;
    font-family: "SONGER Grotesque", sans-serif;
}

.results-over-circle {
    position: absolute;
    top: 50%;
    /* left: 50%; */
    transform: translate(0, -50%);
    z-index: 15;
    background-color: rgba(255, 255, 255, 0.9);
    color: #222;
    width: 85%;
    max-width: 320px;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.results-over-circle h2 {
    color: #333 !important;
    margin-top: 0;
}

.results-over-circle p {
    color: #444 !important;
}

.btn-over-circle.btn {
    margin-top: 0px !important;
    width: auto !important;
}

.btn-prev-step {
    font-size: 14px;
    background-color: #666;
    color: white;
    width: 100%;
}

.btn-game {
    background-color: #b51e02;
    color: white;
    min-width: 140px;
    height: 60px;
    user-select: none;
    touch-action: none;
    font-size: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    line-height: 1.1;
}

.btn-game-title,
.btn-game-key-hint {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-game-key-hint {
    font-size: 60%;
    opacity: 0.65;
}

.btn-game.row-0 {
    grid-row: 1;
}

.btn-game.row-1 {
    grid-row: 2;
}

.btn-game.align-left {
    grid-column: 1;
    justify-self: end;
    width: 100%;
}

.btn-game.align-right {
    grid-column: 2;
    justify-self: start;
    width: 100%;
}

.btn-game.align-center {
    grid-column: 1 / span 2;
    justify-self: center;
}

.btn-game:disabled {
    background-color: #555;
    cursor: not-allowed;
    /* opacity: 0.6; */
}

.btn-game:active:not(:disabled),
.btn-game.active:not(:disabled) {
    transform: scale(0.95);
}

.btn-game {
    position: relative;
}

.btn-color-hint {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.circle-wrapper {
    position: relative;
    /* width: 90vw;
    height: 90vw; */
    max-width: 400px;
    max-height: 400px;
    /* margin: 0 auto 30px; */
}

#game-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    /* Чтобы 12 часов были сверху */
}

.sector {
    stroke: #333;
    stroke-width: 2;
    /* transition: fill 0.1s; */
}

.sector.active {
    fill: #fff !important;
    filter: brightness(1.5);
}

.countdown {
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: bold;
    pointer-events: none;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 12px;
}

.game-message {
    font-size: 24px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.message-error {
    color: #ff4444;
}

.message-success {
    color: #00C851;
}

.progress-wrapper {
    width: 100%;
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: flex-start;
}

.progress-bar {
    width: 100%;
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.05s linear;
}

.game-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
    padding: 0 10px;
    width: 100%;
}

#music-muter {
    padding: 0 10px;
}

.stop-btn-container {
    margin: 20px 0;
    text-align: center;
}

.btn-sounds-toggle-container {
    margin: -10px 0 15px;
    text-align: center;
}

.btn-sounds-toggle {
    background-color: #555;
    color: #fff;
    font-size: 16px;
    padding: 8px 20px;
    opacity: 0.9;
}

.btn-stop-game {
    background-color: #f44336;
    color: white;
    font-size: 16px;
    padding: 8px 20px;
    opacity: 0.9;
}

@media (hover: hover) {
    .btn-sounds-toggle:hover {
        background-color: #444;
        opacity: 1;
    }

    .btn-stop-game:hover {
        background-color: #d32f2f;
        opacity: 1;
    }
}

.results {
    /* background-color: #333; */
    padding: 10px;
    border-radius: 12px;
    margin-top: 10px;
    text-align: center;
}

#accuracy {
    font-size: 32px;
    color: #4CAF50;
}

.level-name {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 20px;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.btn-back {
    background-color: #555;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    display: inline-block;
}

@media (hover: hover) {
    .btn-back:hover {
        background-color: #666;
    }
}

/* Плавающие иконки обратной связи */
.floating-feedback {
    position: fixed;
    /* Используем fixed для независимости от контейнеров */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: white;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    animation: floatUpFade 0.8s ease-out forwards;
}

.feedback-hit {
    background-color: #00C851;
}

.feedback-miss {
    background-color: #ff4444;
}

@keyframes floatUpFade {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -75px);
        opacity: 0;
    }
}

/* ============ Dual-circles mode ============ */

/* Два круга в строку */
.dual-circles-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* Колонка с кругом */
.circle-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* SVG в dual-режиме: заполняет ширину колонки */
.dual-circle-svg {
    width: 100%;
    aspect-ratio: 1;
    transform: rotate(-90deg);
    /* Чтобы 12 часов были сверху */
    display: block;
}

/* circle-wrapper в dual-режиме: убираем ограничение высоты */
.circle-wrapper.has-dual-circles {
    max-height: none;
}

/* ============ /Dual-circles mode ============ */

/* Адаптивность для мобильных устройств */
@media (max-width: 480px) {
    .level-name {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .btn-game {
        min-width: 90px;
        height: 55px;
        font-size: 15px;
        padding: 12px 12px;
    }

    .countdown {
        font-size: 28px;
        padding: 8px 16px;
    }

    .game-message {
        font-size: 20px;
    }

    .results h2 {
        font-size: 24px;
    }

    .results p {
        font-size: 18px;
    }

    #accuracy {
        font-size: 28px;
    }
}

.game-mute-music-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.game-mute-music-button input[type=checkbox] {
    width: 20px;
    height: 20px;
}

@media (max-height: 600px) {
    .circle-wrapper {
        margin-bottom: 15px;
    }

    .game-buttons {
        margin-bottom: 15px;
    }
}