.version {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 20px;
    color: #000;
    background-color: aqua;
}

header {
    display: flex;
    justify-content: space-between;
}

body {
    background-color: #14cd0e;
}

.win {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(207, 37, 37, 0.5);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.win-content {
    display: inherit;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 200px;
    background-color: #d61414;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header-right {
    color: red;
}

.dog {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    background: transparent;
}

.dogName {
    position: absolute;
    top: -13px;
    left: 56px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.dogs-container {
    display: flex;
    gap: 20px;
    flex-direction: column;
}

@keyframes leg-animation {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(2deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.leg {
    animation: leg-animation 1s infinite;
}

@keyframes dog-walk {
    0% { 
        left: 0vw; 
    }
    49% { 
        left: calc(100vw - 150px); 
    }
    50% { 
        left: calc(100vw - 150px); 
    }
    99% { 
        left: 0vw; 
    }
    100% { 
        left: 0vw; 
    }
}

@keyframes dog-rotate {
    0% { 
        transform: rotateY(0deg);
    }
    49% { 
        transform: rotateY(0deg);
    }
    50% { 
        transform: rotateY(180deg);
    }
    99% { 
        transform: rotateY(180deg);
    }
    100% { 
        transform: rotateY(0deg);
    }
}

.dog {
    animation: dog-walk 8s linear infinite;
    position: relative;
}

.dog-svg {
    animation: dog-rotate 8s linear infinite;
}

/* Добавляем задержку для каждой следующей собаки */
.dog1 { animation-delay: 0s; }
.dog1 .dog-svg { animation-delay: 0s; }
.dog2 { animation-delay: 1s; }
.dog2 .dog-svg { animation-delay: 1s; }
.dog3 { animation-delay: 2s; }
.dog3 .dog-svg { animation-delay: 2s; }
.dog4 { animation-delay: 3s; }
.dog4 .dog-svg { animation-delay: 3s; }
.dog5 { animation-delay: 4s; }
.dog5 .dog-svg { animation-delay: 4s; }

/* Адаптив для планшетов (768px и меньше) */
@media (max-width: 768px) {
    .dog {
        width: 80px;
        height: 80px;
        padding: 10px;
    }
    
    .dogName {
        font-size: 12px;
        top: -10px;
        left: 45px;
    }
    
    .win-content {
        width: 250px;
        height: 150px;
        padding: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Адаптив для мобильных (480px и меньше) */
@media (max-width: 480px) {
    .dog {
        width: 60px;
        height: 60px;
        padding: 8px;
    }
    
    .dogName {
        font-size: 10px;
        top: -8px;
        left: 35px;
    }
    
    .dogs-container {
        gap: 15px;
    }
    
    .win-content {
        width: 200px;
        height: 120px;
        padding: 10px;
        font-size: 14px;
    }
    
    h1 {
        font-size: 20px;
        margin: 10px 0;
    }
    
    h2 {
        font-size: 16px;
    }
    
    button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Уменьшаем размер SVG собак */
    .dog-svg {
        width: 60px !important;
        height: 48px !important;
    }
}

/* Адаптив для очень маленьких экранов (320px и меньше) */
@media (max-width: 320px) {
    .dog {
        width: 50px;
        height: 50px;
        padding: 5px;
    }
    
    .dogName {
        font-size: 8px;
        top: -6px;
        left: 30px;
    }
    
    .win-content {
        width: 180px;
        height: 100px;
        padding: 8px;
        font-size: 12px;
    }
    
    h1 {
        font-size: 18px;
    }
    
    h2 {
        font-size: 14px;
    }
    
    button {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .dog-svg {
        width: 50px !important;
        height: 40px !important;
    }
}