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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
}

#app {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

header h1 a {
    color: #e0e0e0;
    text-decoration: none;
}

.subtitle {
    color: #888;
    margin-top: 0.25rem;
    font-size: 1.1rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Dataset Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.dataset-card {
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dataset-card:hover {
    border-color: #4a4a6a;
    transform: translateY(-2px);
}

.dataset-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.dataset-card p {
    color: #888;
    font-size: 0.9rem;
}

.dataset-card .meta {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #666;
}

/* Engine Selector */
.engine-selector {
    margin-top: 1rem;
    text-align: center;
}

.engine-selector.hidden {
    display: none;
}

.engine-selector select {
    background: #1a1a24;
    color: #e0e0e0;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

/* Comparison View */
.progress-bar {
    height: 4px;
    background: #1a1a24;
    border-radius: 2px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #6366f1;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 2rem;
}

.compare-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: center;
}

.choice-card {
    flex: 1;
    max-width: 280px;
    background: #1a1a24;
    border: 2px solid #2a2a3a;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    color: #e0e0e0;
    font-size: 1rem;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.choice-card:hover {
    border-color: #6366f1;
    transform: scale(1.02);
}

.choice-card:active {
    transform: scale(0.98);
}

.choice-card.chosen {
    border-color: #6366f1;
    background: #1e1e3a;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
}

.choice-card.not-chosen {
    opacity: 0.3;
    transform: scale(0.95);
    transition: all 0.2s ease;
}

.key-hint {
    color: #555;
    font-size: 0.75rem;
    text-align: center;
    margin-top: 1rem;
}

.choice-content .emoji {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.choice-content .name {
    font-size: 1.1rem;
    font-weight: 500;
}

.choice-content .color-swatch {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    border: 2px solid #333;
}

.choice-content .color-label {
    font-size: 0.85rem;
    color: #888;
}

.vs {
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
    flex-shrink: 0;
}

/* Results */
.results-list {
    margin: 1.5rem 0;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #1a1a24;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.result-rank {
    font-size: 1.2rem;
    font-weight: 700;
    color: #6366f1;
    min-width: 2rem;
    text-align: center;
}

.result-rank.gold { color: #fbbf24; }
.result-rank.silver { color: #94a3b8; }
.result-rank.bronze { color: #d97706; }

.result-emoji {
    font-size: 1.5rem;
}

.result-name {
    flex: 1;
    font-weight: 500;
}

.result-score {
    color: #666;
    font-size: 0.8rem;
}

.result-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #333;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

.btn.primary {
    background: #6366f1;
    color: white;
}

.btn.primary:hover {
    background: #5558e6;
}

.btn.secondary {
    background: #1a1a24;
    color: #e0e0e0;
    border: 1px solid #2a2a3a;
}

.btn.secondary:hover {
    border-color: #4a4a6a;
}

.btn.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background: #2a2a3a;
    color: #e0e0e0;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Share */
.share-box {
    background: #1a1a24;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
}

.share-link {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.share-link input {
    flex: 1;
    background: #0a0a0f;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.shared-meta {
    color: #888;
    text-align: center;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .compare-container {
        flex-direction: column;
        gap: 1rem;
    }

    .choice-card {
        max-width: 100%;
        width: 100%;
        min-height: 100px;
    }

    .vs {
        margin: -0.25rem 0;
    }

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