* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    background:
        linear-gradient(rgba(13, 17, 23, 0.95), rgba(13, 17, 23, 0.95)),
        url("../images/git.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    color: white;
    min-height: 100vh;

}

.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 16px;
    text-align: center;
}

h1 {
    margin-top: 20px;
    margin-bottom: 20px;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.switch {
    position: relative;
    width: 52px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background-color: #21262D;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked+.slider {
    background-color: #238636;
}

.switch input:checked+.slider::before {
    transform: translateX(26px);
}


form {

    display: flex;
    gap: 10px;
    max-width: 640px;
    margin: 0 auto;
}

input {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: none;
}

button {
    background: #238636;
    color: white;
    font-weight: 600;
    transition: background 0.25s ease, transform 0.15s ease;
    padding: 10px 15px;
    border-radius: 6px;
    border: none;
    cursor: pointer;

}

button:hover {
    background: #2ea043;
    transform: translateY(-1px);
}

button:active {
    transform: scale(0.96);
}

.profile {
    background: #161B22;
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    text-align: center;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
}

.profile img {
    width: 100px;
    border-radius: 50%;
}

.profile a {
    text-decoration: none;
    color: #58a6ff;
}

.profile a:hover {
    text-decoration: underline;
}

.repos {
    background: #161B22;
    margin-top: 16px;
    padding: 18px;
    border-radius: 12px;
    border: 2px solid #21262D;
}

.repos h3 {
    margin-bottom: 10px;
    font-size: 18px;

}

.repo-item {
    margin: 8px 0;
}

.repo-item a {
    color: #58a6ff;
    text-decoration: none;
}

.repo-item a:hover {
    text-decoration: underline;
}

.repo-item span {
    font-size: 12px;
    opacity: 0.7;
}

.hidden {
    display: none;
}

#error {
    color: #ff6b6b;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
}

.winner {
    border: 2px solid #2ea043;
    box-shadow: 0 0 18px rgba(46, 160, 67, 0.35);
}

.loser {
    border: 2px solid #f85149;
    box-shadow: 0 0 18px rgba(248, 81, 73, 0.35);
}

.winner::before {
    content: "🏆 Winner";
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #2ea043;
}

.loser::before {
    content: "Loser";
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #f85149;
}

.battle-result {

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 20px;
    justify-items: center;
    text-align: center;
}


.battle-user .profile {
    height: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.battle-user .repos {
    width: 100%;
    min-height: 275px;


}

.battle-user {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 360px;


}

.battle-error {
    color: #ff6b6b;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
}

.battle-result>p {
    grid-column: 1 / -1;
    justify-self: center;
}

.no-repos {
    opacity: 0.7;
    font-size: 14px;

}

@media(max-width:600px) {

    .battle-result {
        grid-template-columns: 1fr;
    }

    body {
        background-position: center top;
    }

    form {
        flex-direction: column;
        width: 100%;
    }

    .container {
        max-width: 92%;
        margin-left: auto;
        margin-right: auto;

        padding-left: 14px;
        padding-right: 14px;
    }

    form input {
        padding: 8px;
        font-size: 14px;
        width: 100%;
    }

    form button {
        font-size: 14px;
        width: auto;
        align-self: center;
        padding: 10px 24px;
    }

    .profile,
    .repos {
        padding: 14px;
    }

    .toggle-wrapper {
        flex-wrap: wrap;
    }


}