/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --accent-color: #3b82f6;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #fafafa;
    --bg-white: #ffffff;
    --bg-cream: #faf8f5;
    --border-color: #e5e5e5;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --navy: #1a1f36;
    --warm-white: #fefefe;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    background: var(--warm-white);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.game-link {
    background: var(--navy);
    color: white !important;
    padding: 0.5rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid var(--navy);
}

.game-link:hover {
    background: transparent;
    color: var(--navy) !important;
    transform: none;
}

/* Hero Section */
.hero {
    background: var(--bg-cream);
    color: var(--navy);
    padding: 5rem 0 6rem;
    border-bottom: 1px solid var(--border-color);
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content {
    text-align: left;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-chart {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    background: white;
    padding: 1rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--navy);
}

.subtitle {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    color: var(--text-light);
    font-weight: 400;
    line-height: 1.6;
}

.description {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 0 2.5rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* Word flipping animation */
.flip-words {
    display: inline-block;
    position: relative;
    min-width: 200px;
    text-align: left;
}

.flip-word {
    position: absolute;
    left: 0;
    opacity: 0;
    animation: flipWord 4s infinite;
}

.flip-word:nth-child(1) {
    animation-delay: 0s;
}

.flip-word:nth-child(2) {
    animation-delay: 2s;
}

@keyframes flipWord {

    0%,
    45% {
        opacity: 1;
        transform: translateY(0);
    }

    55%,
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--navy);
    color: white;
    border: 1px solid var(--navy);
}

.btn-primary:hover {
    background: transparent;
    color: var(--navy);
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--navy);
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-gray {
    background: var(--bg-light);
}

/* Featured Game Section */
.section-featured {
    padding: 0;
    background: var(--navy);
    color: white;
}

.featured-game {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 5rem 0;
}

.featured-game-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.featured-game-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
}

.featured-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.featured-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-game-featured {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    color: var(--navy);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    border: 2px solid white;
}

.btn-game-featured:hover {
    background: transparent;
    color: white;
    transform: translateY(-2px);
}

.game-preview {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 2.5rem;
    text-align: center;
}

.preview-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.preview-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: white;
}

.preview-cues {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.preview-cue {
    padding: 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.preview-cue.lexical {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.preview-cue.acoustic {
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.preview-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-dark);
}

.section-description {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Cards */
.experiment-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-color);
    color: white;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Leaderboard */
.leaderboard-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group,
.search-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.filter-group select,
.search-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.filter-group select:focus,
.search-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

.leaderboard-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.leaderboard-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.leaderboard-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.leaderboard-table th.active {
    background: rgba(255, 255, 255, 0.2);
}

.leaderboard-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table tbody tr:hover {
    background: var(--bg-light);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.baseline-row {
    background: #fafafa;
    border-top: 2px solid var(--border-color);
}

.baseline-label {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--text-light);
    color: white;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    color: white;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: var(--text-dark);
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: var(--text-dark);
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #e6a85c);
    color: white;
}

.rank-other {
    background: var(--text-light);
}

.model-name {
    font-weight: 600;
    color: var(--text-dark);
}

.model-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.type-proprietary {
    background: #dbeafe;
    color: #1e40af;
}

.type-opensource {
    background: #dcfce7;
    color: #166534;
}

.score {
    font-weight: 600;
}

.score-high {
    color: var(--success-color);
}

.score-medium {
    color: var(--warning-color);
}

.score-low {
    color: var(--danger-color);
}

.score-na {
    color: var(--text-light);
    font-style: italic;
}

.leaderboard-notes {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.leaderboard-notes h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.leaderboard-notes ul {
    list-style-position: inside;
    color: var(--text-light);
}

.leaderboard-notes li {
    margin-bottom: 0.5rem;
}

/* Visualizations */
.visualization-single {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.viz-card-large {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 900px;
}

.viz-image-large {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.viz-caption {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.8;
    text-align: left;
}

/* Examples */
.examples-container {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

.example-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.example-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.example-header {
    padding: 1.5rem 2rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.example-header.neutral-text {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.example-header.emotion-matched {
    background: linear-gradient(135deg, #10b981, #059669);
}

.example-header.emotion-mismatched {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.example-header.paralinguistic {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.example-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.2rem;
}

.example-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.example-content {
    padding: 2rem;
}

.example-field {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.example-field strong {
    color: var(--text-dark);
    display: block;
    margin-bottom: 0.5rem;
}

.example-field em {
    color: var(--text-light);
    font-style: italic;
}

.example-field code {
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.example-choices {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.highlight-answer {
    background: #fef3c7;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.example-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
}

.result-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.badge-neutral,
.badge-frustration,
.badge-excitement,
.badge-anger,
.badge-correct,
.badge-incorrect,
.badge-warning {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-neutral {
    background: #e5e7eb;
    color: #374151;
}

.badge-frustration {
    background: #fef3c7;
    color: #92400e;
}

.badge-excitement {
    background: #dbeafe;
    color: #1e40af;
}

.badge-anger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-correct {
    background: #d1fae5;
    color: #065f46;
}

.badge-incorrect {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.example-note {
    padding: 1rem;
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 0.25rem;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Experiment Details */
.experiment-details {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

.detail-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exp-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    font-weight: 700;
}

.detail-card p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.detail-card ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.detail-card code {
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
}

/* Citation */
.citation-box {
    position: relative;
    background: var(--text-dark);
    color: #f8fafc;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.citation-box pre {
    overflow-x: auto;
    margin: 0;
}

.citation-box code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: var(--secondary-color);
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

footer a {
    color: white;
    text-decoration: none;
    margin: 0 1rem;
    transition: opacity 0.3s;
}

footer a:hover {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .featured-game {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 3rem 0;
    }

    .featured-stats {
        gap: 1rem;
    }

    .flip-words {
        min-width: 180px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero h1 {
        font-size: 2.5rem;
        justify-content: center;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .hero-chart {
        max-width: 100%;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .leaderboard-controls {
        flex-direction: column;
    }

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

/* Loading Animation */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}