/* Интерактивная автомойка */

.car-wash {
    margin: 12px 0 4px;
    user-select: none;
    -webkit-user-select: none;
}

.car-wash__hint {
    margin: 0 0 8px;
    font-size: 13px;
    color: #9aa3b5;
    text-align: center;
    line-height: 1.35;
    transition: color 0.25s ease, opacity 0.25s ease;
}

.car-wash.is-done .car-wash__hint {
    color: #fcd330;
}

.car-wash--locked .car-wash__hint {
    opacity: 0.7;
}

.car-wash__tools {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 0 0 10px;
    align-items: start;
}

.car-wash__tool-slot {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.car-wash__tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    min-height: 78px;
    padding: 6px 4px;
    border: 1px solid #3d4558;
    background: linear-gradient(180deg, #1a1f2a 0%, #12151c 100%);
    color: #9aa3b5;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.car-wash__tool:hover {
    border-color: #5a6578;
    color: #c5cddb;
}

.car-wash__tool.is-active {
    border-color: #fcd330;
    color: #fcd330;
    background: linear-gradient(180deg, rgba(252, 211, 48, 0.12) 0%, #12151c 100%);
}

.car-wash--locked .car-wash__tool:not(.is-locked) {
    pointer-events: none;
    opacity: 0.65;
}

.car-wash__tool.is-locked {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.car-wash__tool-buy-btn {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    font-size: 12px;
    padding: 5px 4px;
    white-space: nowrap;
}

.car-wash__tool-icon {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.car-wash__tool.is-active .car-wash__tool-icon {
    filter: drop-shadow(0 0 4px rgba(252, 211, 48, 0.45));
}

.car-wash__tool-name {
    font-size: 11px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
}

.car-wash__tool-desc {
    font-size: 10px;
    line-height: 1.2;
    color: #7f8798;
    text-align: center;
}

.car-wash__tool.is-active .car-wash__tool-desc {
    color: #c4b06a;
}

.car-wash__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 22px 10px 28px;
    overflow: hidden;
    border: 1px solid #9aa3b5;
    background:
        radial-gradient(ellipse at 50% 110%, rgba(180, 210, 235, 0.45) 0%, transparent 58%),
        linear-gradient(180deg, #d5dde8 0%, #b8c4d4 48%, #9eacbf 100%);
    touch-action: none;
    cursor: none;
}

.car-wash__stage:active,
.car-wash.is-washing .car-wash__stage {
    cursor: none;
}

.car-wash--locked .car-wash__stage {
    cursor: not-allowed;
    opacity: 0.72;
}

.car-wash.is-done .car-wash__stage {
    cursor: default;
}

.car-wash__hand {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 8;
    width: 72px;
    height: 72px;
    margin: 0;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(-999px, -999px, 0) rotate(-22deg);
    transition: opacity 0.12s ease;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
    will-change: transform;
}

.car-wash__hand.is-visible {
    opacity: 1;
}

.car-wash__hand > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.car-wash--locked .car-wash__hand,
.car-wash.is-done .car-wash__hand {
    display: none;
}

.car-wash__car {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    filter: saturate(0.9) brightness(0.96);
    transition: filter 0.55s ease, transform 0.45s ease;
}

.car-wash.is-done .car-wash__car {
    filter: saturate(1.15) brightness(1.08);
    transform: translateY(-2px);
    animation: car-wash-bob 1.4s ease-in-out 1;
}

.car-wash__car .car-with-wheels,
.car-wash__car .car-display-fallback-wrap {
    --car-sprite-height: 150px;
}

.car-wash__silhouette {
    width: 280px;
    height: 90px;
    border-radius: 40% 40% 18% 18% / 55% 55% 35% 35%;
    background:
        linear-gradient(180deg, #4a5568 0%, #2a3140 55%, #1a2030 100%);
    box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.25);
    position: relative;
}

.car-wash__silhouette::before {
    content: "";
    position: absolute;
    left: 18%;
    right: 22%;
    top: 10%;
    height: 42%;
    border-radius: 40% 40% 10% 10%;
    background: rgba(140, 170, 200, 0.28);
}

.car-wash__silhouette::after {
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: -6px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    filter: blur(3px);
}

.car-wash__dirt {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    touch-action: none;
    pointer-events: auto;
}

.car-wash.is-done .car-wash__dirt {
    pointer-events: none;
}

.car-wash--locked .car-wash__dirt {
    pointer-events: none;
}

.car-wash__shine {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(
        115deg,
        transparent 35%,
        rgba(255, 255, 255, 0.55) 48%,
        transparent 62%
    );
    transform: translateX(-120%);
}

.car-wash.is-done .car-wash__shine {
    opacity: 1;
    animation: car-wash-shine 0.9s ease-out 1;
}

.car-wash__foam {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

.car-wash__bubble {
    position: absolute;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff 0%, rgba(210, 235, 255, 0.85) 45%, rgba(150, 200, 230, 0.15) 70%, transparent 75%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
    animation: car-wash-bubble 0.55s ease-out forwards;
    pointer-events: none;
}

.car-wash__progress {
    margin-top: 10px;
    height: 8px;
    border: 1px solid #3d4558;
    background: #12151c;
    overflow: hidden;
}

.car-wash__progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #3a8fd4 0%, #6ec8ff 55%, #fcd330 100%);
    transition: width 0.12s linear;
}

.car-wash.is-done .car-wash__progress-bar {
    background: linear-gradient(90deg, #2ea86a 0%, #fcd330 100%);
}

.car-wash__percent {
    margin-top: 4px;
    text-align: center;
    font-size: 12px;
    color: #9aa3b5;
}

.car-wash.is-done .car-wash__percent {
    color: #fcd330;
    font-weight: bold;
}

@keyframes car-wash-shine {
    from {
        transform: translateX(-120%);
    }
    to {
        transform: translateX(120%);
    }
}

@keyframes car-wash-bubble {
    0% {
        opacity: 0.95;
        transform: scale(0.4) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(1.35) translateY(-18px);
    }
}

@keyframes car-wash-bob {
    0%,
    100% {
        transform: translateY(-2px);
    }
    50% {
        transform: translateY(-6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .car-wash.is-done .car-wash__car,
    .car-wash.is-done .car-wash__shine,
    .car-wash__bubble {
        animation: none;
    }
}
