/* ================== РАСЫ / GALLERY ================== */
.gallery {
    position: relative;
    margin-top: 0;
    padding: 110px 24px 120px;
    background: transparent;
    border-top: none;
    box-shadow: none;
    text-align: left;
    overflow: visible;
    z-index: 3;
    clip-path: none;
    isolation: isolate;
}

.gallery::after {
    display: none;
}

.gallery::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 90%);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-2), transparent);
    display: block;
}

.gallery .section-head {
    max-width: 1180px;
    margin: 0 auto 48px;
    padding: 0 24px;
}

.gallery .gallery-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: #fff;
    text-shadow: none;
    text-align: left;
    position: relative;
    padding-top: 0;
}

/* ================== КРУГОВОЙ СЕЛЕКТОР РАС ================== */
.races-wheel-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.races-wheel {
    position: relative;
    width: min(720px, 92vw);
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Внешнее декоративное кольцо */
.races-wheel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px dashed var(--line);
    pointer-events: none;
}

.races-wheel::after {
    content: "";
    position: absolute;
    top: 6%;
    left: 6%;
    width: 88%;
    height: 88%;
    border-radius: 50%;
    border: 1px solid var(--line);
    pointer-events: none;
}

.wheel-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Веточки - линии от центра к кнопкам */
.wheel-branches {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.wheel-branches svg {
    width: 100%;
    height: 100%;
    display: block;
}

.wheel-branch {
    stroke: var(--line-2);
    stroke-width: 1;
    fill: none;
    transition: all 0.4s ease;
}

.wheel-branch.active {
    stroke: var(--accent);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5));
}

.wheel-branch-leaf {
    fill: var(--line-2);
    transition: all 0.4s ease;
}

.wheel-branch-leaf.active {
    fill: var(--accent);
    filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.6));
}

.wheel-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(130px, 17vw, 165px);
    min-height: clamp(46px, 5.5vw, 60px);
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(20, 18, 14, 0.92) 0%, rgba(12, 10, 8, 0.95) 100%);
    border: 1px solid var(--line-2);
    border-radius: 4px;
    color: var(--accent-3);
    font-family: var(--font-display);
    font-size: clamp(11px, 1.25vw, 15px);
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-align: center;
    transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
    backdrop-filter: blur(6px);
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(212, 175, 55, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transform:
        translate(-50%, -50%)
        rotate(var(--angle))
        translateY(calc(min(720px, 92vw) * -0.42))
        rotate(calc(var(--angle) * -1));
}

.wheel-item span {
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.wheel-item:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: linear-gradient(135deg, rgba(40, 32, 18, 0.95) 0%, rgba(25, 20, 12, 0.98) 100%);
    box-shadow:
        0 4px 20px rgba(212, 175, 55, 0.25),
        0 0 30px rgba(212, 175, 55, 0.12),
        inset 0 1px 0 rgba(212, 175, 55, 0.15);
}

.wheel-item.active {
    background: linear-gradient(135deg, rgba(60, 48, 24, 0.95) 0%, rgba(40, 32, 16, 0.98) 100%);
    border-color: var(--accent);
    color: var(--accent-3);
    box-shadow:
        0 4px 24px rgba(212, 175, 55, 0.35),
        0 0 40px rgba(212, 175, 55, 0.18),
        inset 0 1px 0 rgba(212, 175, 55, 0.2);
}

.wheel-center {
    position: relative;
    width: 52%;
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at center,
            rgba(25, 22, 16, 0.96) 0%,
            rgba(12, 10, 8, 0.99) 100%);
    border: 1px solid var(--line-2);
    box-shadow:
        0 0 60px rgba(212, 175, 55, 0.1),
        inset 0 0 50px rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 3;
}

.wheel-center::before {
    content: "";
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    border-radius: 50%;
    border: 1px solid var(--line);
    pointer-events: none;
}

.race-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 14% 12%;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.race-display.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.race-display-default .race-display-hint {
    font-family: var(--font-display);
    color: var(--accent);
    font-size: clamp(20px, 2.5vw, 30px);
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.race-display-default .race-display-subhint {
    color: var(--accent-3);
    font-family: var(--font-sans);
    font-style: italic;
    font-size: clamp(13px, 1.4vw, 17px);
    line-height: 1.5;
    max-width: 80%;
    margin: 0 auto;
    opacity: 0.7;
}

.race-display-name {
    font-family: var(--font-display);
    font-size: clamp(20px, 2.4vw, 30px);
    color: var(--accent);
    font-weight: 700;
    margin-bottom: clamp(12px, 1.8vw, 20px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    padding-bottom: clamp(10px, 1.2vw, 16px);
}

.race-display-name::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.race-display-desc {
    font-family: var(--font-sans);
    font-size: clamp(13px, 1.35vw, 17px);
    color: var(--accent-3);
    line-height: 1.6;
    max-width: 90%;
    font-style: italic;
    opacity: 0.9;
}

@media (max-width: 600px) {
    .races-wheel {
        width: 94vw;
    }

    .wheel-item {
        width: clamp(90px, 24vw, 115px);
        min-height: 38px;
        padding: 6px 8px;
        font-size: 10px;
        letter-spacing: 0.02em;
        transform:
            translate(-50%, -50%)
            rotate(var(--angle))
            translateY(calc(94vw * -0.42))
            rotate(calc(var(--angle) * -1));
    }

    .wheel-center {
        width: 50%;
    }

    .race-display {
        padding: 16% 12%;
    }

    .race-display-desc {
        font-size: 11px;
        line-height: 1.4;
    }
}
