* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #f0f4fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 1300px;
    width: 100%;
    background: white;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
}

h1 {
    text-align: center;
    color: #1e3c72;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.subtitle {
    text-align: center;
    color: #6b7a8f;
    font-size: 1rem;
    margin-bottom: 30px;
}

.legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #2c3e50;
    background: #f8fafd;
    padding: 6px 16px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
}

.badge {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.badge.normal { background: #1e5fb4; }
.badge.trisomy { background: #f59e0b; }
.badge.deletion { background: #6b7280; }

.layout {
    display: flex;
    gap: 30px;
}

.chromosomes {
    flex: 2;
}

.row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}


.pair {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: white;
    border: 1px solid #dde3ed;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 70px;
}

.pair:hover {
    border-color: #1e5fb4;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(30, 95, 180, 0.1);
}

.pair.selected {
    background: #f0f7ff;
    border: 2px solid #1e5fb4;
}


.chromo-box {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    height: 70px;
    margin-bottom: 8px;
    position: relative;
}


.chromo {
    width: 20px;
    height: 55px;
    background: #1e5fb4;
    border-radius: 4px;
    position: relative;
}


.chromo::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.2);
    top: 45%;
    left: 0;
    transform: translateY(-50%);
}


.pair[data-group="a"] .chromo { height: 60px; }
.pair[data-group="b"] .chromo { height: 55px; }
.pair[data-group="c"] .chromo { height: 52px; }
.pair[data-group="d"] .chromo { height: 48px; }
.pair[data-group="e"] .chromo { height: 45px; }
.pair[data-group="f"] .chromo { height: 42px; }
.pair[data-group="g"] .chromo { height: 38px; }


.pair.trisomy .chromo { background: #f59e0b; }

.pair.deletion .chromo { 
    background: #6b7280; 
    height: 30px !important;
    margin-top: 15px;
}


.pair.trisomy .chromo-box::after {
    content: '+1';
    position: absolute;
    background: #f59e0b;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    top: -8px;
    right: -5px;
}

.pair-label {
    font-weight: 600;
    color: #1e3c72;
    font-size: 0.95rem;
}

.pair-group {
    font-size: 0.65rem;
    color: #8a9bb0;
}


.sidebar {
    flex: 1;
    min-width: 260px;
}

.info-card {
    background: #f8fafd;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    border-left: 4px solid #1e5fb4;
    min-height: 240px;
}

.info-card h2 {
    color: #1e3c72;
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.info-card p {
    color: #4a5b6c;
    line-height: 1.5;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.anomaly-badge {
    display: inline-block;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: white;
    color: #1e5fb4;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #d0ddeb;
}

.stats-card {
    background: #f8fafd;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e3c72;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: #6b7a8f;
    text-transform: uppercase;
}

.reset-btn {
    width: 100%;
    background: #1e5fb4;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s;
}

.reset-btn:hover {
    background: #154a8a;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f7ff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #3b82f6;
    padding: 10px 18px;
    transition: all 0.2s;
    font-weight: 600;
    border-radius: 50%;
    border-left: 5px solid #1a5fb4;
}

.back-button:hover {
    color: #2563eb;
    transform: translateX(-4px);
}

.back-button:active {
    transform: translateX(-2px);
}


.back-button .text {
    font-family: inherit;
    font-size: 1rem;
}

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }
    h1 {
        font-size: 2rem;
    }
}