* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Baloo 2', cursive, sans-serif;
    background: linear-gradient(135deg, #2d3436, #636e72);
    min-height: 100vh;
    color: white;
}

h1, h2, h3 {
    font-family: 'Fredoka', sans-serif;
}

.back-link {
    position: fixed;
    top: 16px;
    left: 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 1rem;
    z-index: 100;
    transition: color 0.2s;
}

.back-link:hover {
    color: white;
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 1.15rem;
    opacity: 0.7;
}

/* Compare Area */
.compare-area {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.car-picker {
    flex: 1;
    min-width: 260px;
    max-width: 380px;
    text-align: center;
}

.car-picker h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.search-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.car-search {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    font-family: 'Baloo 2', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.car-search::placeholder {
    color: rgba(255,255,255,0.4);
}

.car-search:focus {
    border-color: rgba(255,255,255,0.5);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #3d3d3d;
    border-radius: 0 0 12px 12px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    border: 2px solid rgba(255,255,255,0.15);
    border-top: none;
}

.search-results.open {
    display: block;
}

.search-result-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: left;
    transition: background 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover,
.search-result-item.highlighted {
    background: rgba(255,255,255,0.12);
}

.search-result-item .car-category {
    font-size: 0.75rem;
    opacity: 0.5;
}

.search-result-item .match-highlight {
    color: #ffeaa7;
    font-weight: 600;
}

.results-section-label {
    padding: 6px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

.car-card {
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 24px;
    border: 2px solid rgba(255,255,255,0.1);
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s, background 0.3s;
}

.car-card.active {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.12);
}

.car-image-wrap {
    width: 100%;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
}

.car-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.car-emoji {
    font-size: 4rem;
}

.car-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.car-stats {
    width: 100%;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.95rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    opacity: 0.6;
    font-size: 0.85rem;
}

.stat-value {
    font-weight: 600;
}

/* VS Badge */
.vs-badge {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #e17055;
    background: rgba(225, 112, 85, 0.15);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 100px;
    border: 2px solid rgba(225, 112, 85, 0.3);
}

/* Comparison Section */
.comparison {
    display: none;
}

.comparison.active {
    display: block;
}

.comparison h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 28px;
    color: #ffeaa7;
}

.bars-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bar-label {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bar-track {
    display: flex;
    height: 36px;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}

.bar-left, .bar-right {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    transition: width 0.8s ease;
    min-width: 60px;
}

.bar-left {
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    border-radius: 18px 0 0 18px;
}

.bar-right {
    background: linear-gradient(90deg, #e17055, #d63031);
    border-radius: 0 18px 18px 0;
}

.bar-left.winner {
    background: linear-gradient(90deg, #00b894, #55efc4);
}

.bar-right.winner {
    background: linear-gradient(90deg, #55efc4, #00b894);
}

.bar-names {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    opacity: 0.5;
    padding: 0 8px;
}

/* Verdict */
.verdict {
    text-align: center;
    padding: 24px;
    background: rgba(255,255,255,0.08);
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.1);
}

.verdict h3 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.verdict p {
    opacity: 0.7;
    font-size: 1rem;
}

.verdict .winner-name {
    color: #55efc4;
}

/* Responsive */
@media (max-width: 650px) {
    .compare-area {
        flex-direction: column;
        align-items: center;
    }

    .vs-badge {
        margin-top: 0;
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .car-picker {
        max-width: 100%;
        width: 100%;
    }
}
