body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

header {
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 1px;
}

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

nav button {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 8px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
}

nav button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

nav button.active {
    background-color: white;
    color: #6e8efb;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.date-input {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.date-input input {
    width: 30%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background-color: #ccc;
    padding: 1px;
    width: 300px;
    margin: 20px auto;
}

.matrix-cell {
    background-color: white;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.stats {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

.couple-container, .couple-results {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    margin-bottom: 20px;
}

.partner {
    flex-basis: calc(50% - 10px);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.partner.male {
    background-color: #e6f3ff;
}

.partner.female {
    background-color: #fff0f5;
}

.partner .matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background-color: #ccc;
    padding: 1px;
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
}

.partner .matrix-cell {
    background-color: white;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.partner .stats {
    margin-top: 20px;
}

.partner .stats p {
    margin: 5px 0;
}

#calculateCouple {
    display: block;
    margin: 20px auto;
}

#graphResult {
    text-align: center;
    margin-top: 20px;
}

#graphResult img {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

#graphResult p {
    font-size: 18px;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .couple-container, .couple-results {
        flex-direction: column;
    }

    .partner {
        flex-basis: 100%;
        margin-bottom: 20px;
    }

    #graphResult {
        flex-direction: column;
    }

    #graphResult canvas {
        width: 100%;
        margin-bottom: 20px;
    }
}

.couple-results {
    margin-top: 20px;
}

.couple-results.hidden {
    display: none;
}

/* Стиль для кнопок "рассчитать" */
button#calculate, button#calculateCouple, button#calculateGraph {
    background-color: #6e8efb;
    color: white;
    border: none;
    padding: 12px 24px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 20px 0;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

button#calculate:hover, button#calculateCouple:hover, button#calculateGraph:hover {
    background-color: #5c7cfa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button#calculate:active, button#calculateCouple:active, button#calculateGraph:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
