/* === CSS Variables (Black & White Theme) === */
:root {
    --primary: #111827;
    --primary-dark: #000000;
    --primary-light: #f3f4f6;
    --accent: #374151;
    --success: #374151;
    --success-light: #f3f4f6;
    --warning: #6b7280;
    --warning-light: #f9fafb;
    --danger: #1f2937;
    --danger-light: #f3f4f6;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    --radius: 6px;
    --radius-lg: 10px;
}

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

/* === Base === */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: var(--gray-900);
    line-height: 1.6;
    font-size: 16px;
}

/* === Layout === */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === Navigation === */
nav {
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

/* === Hero === */
.hero {
    background: var(--gray-900);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.7;
    margin-bottom: 2rem;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--gray-900);
    color: white;
}

.btn-primary:hover {
    background: var(--gray-700);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-block {
    display: block;
    width: 100%;
}

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

.section-alt {
    background: var(--gray-50);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

/* === Intro Box === */
.intro-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--gray-200);
}

.intro-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.intro-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--gray-900);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step p {
    color: var(--gray-600);
}

/* === Cards === */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* === I/O Specification === */
.io-spec {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.io-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    white-space: nowrap;
}

.io-label {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Forms === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gray-900);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-group textarea {
    min-height: 180px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.form-help {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

/* === Input with Button === */
.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button input {
    flex: 1;
}

.input-with-button .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* === Tabs === */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.tab {
    flex: 1;
    padding: 0.875rem 1rem;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--gray-900);
    border-bottom-color: var(--gray-900);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* === Rule Builder (Natural Language) === */
.rule-section {
    margin-bottom: 1.5rem;
}

.rule-label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.natural-rule {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.natural-rule.default-rule {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.inline-select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    background: white;
    cursor: pointer;
}

.inline-input {
    width: 60px;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    text-align: center;
}

.rule-item {
    margin-bottom: 0.75rem;
    position: relative;
}

.rule-item .natural-rule {
    padding-right: 3rem;
}

.remove-rule {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: var(--gray-200);
    color: var(--gray-600);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-rule:hover {
    background: var(--gray-900);
    color: white;
}

/* === Preview === */
.preview-section {
    margin-bottom: 1.5rem;
}

.preview-box {
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.preview-box p {
    margin-bottom: 0.5rem;
}

.preview-box p:last-child {
    margin-bottom: 0;
}

/* === Tables === */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

th.sortable:hover {
    background: var(--gray-100);
}

.sort-icon {
    margin-left: 0.25rem;
    color: var(--gray-400);
    font-size: 0.7rem;
}

.sort-icon.active {
    color: var(--gray-900);
}

tr:hover {
    background: var(--gray-50);
}

.leaderboard-container {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

/* === Rank Badges === */
.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.rank-other {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 600;
}

.score {
    font-weight: 600;
    color: var(--gray-900);
}

.description {
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
}

.badge-npc {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* === Alerts === */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert h4 {
    margin-bottom: 0.5rem;
}

.alert p {
    margin: 0;
}

.alert-success {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.alert-error {
    background: var(--gray-100);
    color: var(--gray-800);
    border: 1px solid var(--gray-400);
}

.alert-info {
    background: var(--gray-50);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

/* === Status === */
.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending {
    background: var(--gray-100);
    color: var(--gray-600);
}

.status-processing {
    background: var(--gray-200);
    color: var(--gray-700);
}

.status-completed {
    background: var(--gray-900);
    color: white;
}

.status-info {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* === Code === */
pre {
    background: var(--gray-900);
    color: #e5e7eb;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

pre code {
    background: none;
    padding: 0;
}

.example {
    margin-bottom: 1.5rem;
}

.example:last-child {
    margin-bottom: 0;
}

.example h4 {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* === Loading === */
.loading {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--gray-900);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

/* === Footer === */
footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    font-size: 0.85rem;
}

footer .footer-contact {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

footer a {
    color: var(--gray-300);
    text-decoration: none;
}

footer a:hover {
    color: white;
}

/* === Submit Container === */
.submit-container {
    max-width: 600px;
    margin: 0 auto;
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .natural-rule {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .description {
        display: none;
    }
}

/* === HTMX Loading States === */
.htmx-request .spinner {
    display: block;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* === Submit Success === */
.submit-success {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--gray-200);
}

.success-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.success-icon {
    font-size: 1.5rem;
}

.success-header h3 {
    margin: 0;
    color: var(--gray-900);
}

.submit-success > p {
    margin-bottom: 1.5rem;
    color: var(--gray-600);
}

/* === Status Loading === */
.status-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.status-loading p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* === Status Complete (Result Card) === */
.status-complete {
    padding: 1rem;
}

.result-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
}

.result-rank {
    font-size: 2.5rem;
}

.result-info {
    flex: 1;
}

.result-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.result-score {
    font-size: 1.1rem;
    color: var(--gray-700);
    font-weight: 600;
}

.result-coop-stats {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.result-coop-stats .coop-stat {
    margin-right: 0.75rem;
}

/* === Share Buttons === */
.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.share-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.copy-feedback {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    height: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s;
}

/* === Result Details === */
.result-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

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

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-700);
}

.stat-value.coop {
    color: var(--gray-800);
}

.stat-value.after-d {
    color: var(--gray-600);
}

.result-matchups {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mini-matchup {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
}

.mini-matchup.best {
    border-left: 3px solid var(--gray-900);
}

.mini-matchup.worst {
    border-left: 3px solid var(--gray-400);
}

.matchup-icon {
    font-size: 1rem;
}

.matchup-text {
    color: var(--gray-700);
}

/* === Clickable Row === */
.clickable-row {
    cursor: pointer;
    transition: background 0.15s;
}

.clickable-row:hover {
    background: var(--gray-100) !important;
}

/* === Expand Icon === */
.expand-icon {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.7rem;
    color: var(--gray-400);
    transition: transform 0.2s;
}

.expand-icon.open {
    color: var(--gray-900);
}

/* === Detail Row (Toggle Expand) === */
.detail-row {
    display: none;
}

.detail-row.open {
    display: table-row;
}

.detail-row > td {
    padding: 0;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-900);
}

.detail-container {
    padding: 1.25rem;
}

/* === Strategy Detail Expanded === */
.strategy-detail-expanded {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Top row: description + matchup results */
.detail-top-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.detail-top-row .strategy-description {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin: 0;
    padding: 0;
    border: none;
    flex-shrink: 0;
}

.detail-top-row .matchup-section {
    display: flex;
    gap: 0.75rem;
    flex: 1;
}

/* === Matchup Cards === */
.matchup-section {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.matchup-card {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: white;
    border: 1px solid var(--gray-200);
}

.matchup-best {
    border-left: 3px solid var(--gray-900);
}

.matchup-worst {
    border-left: 3px solid var(--gray-400);
}

.matchup-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.matchup-opponent {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.matchup-score {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.matchup-score .my-score {
    color: var(--gray-900);
    font-weight: 600;
}

.matchup-score .vs {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.matchup-score .opp-score {
    color: var(--gray-500);
}

.no-matchups {
    color: var(--gray-400);
    font-size: 0.85rem;
    padding: 1rem;
}

/* === Code Section === */
.code-section {
    background: var(--gray-900);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-800);
    color: var(--gray-400);
    font-size: 0.75rem;
    font-weight: 500;
}

.code-section pre {
    margin: 0;
    border-radius: 0;
    font-size: 0.75rem;
    padding: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}

/* Fix text alignment in submit result */
.status-complete .strategy-detail-expanded {
    text-align: left;
}

.status-complete .code-section pre code {
    text-align: left;
    display: block;
    white-space: pre;
}

.badge-rule {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-code {
    background: var(--gray-200);
    color: var(--gray-700);
}

.badge-user {
    background: var(--gray-900);
    color: white;
}

/* === Responsive Detail === */
@media (max-width: 768px) {
    .detail-top-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .detail-top-row .matchup-section {
        flex-direction: column;
    }
    
    .matchup-card {
        min-width: 100%;
    }
}

/* === Admin Actions === */
.admin-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-danger {
    background: var(--gray-700);
    color: white;
}

.btn-danger:hover {
    background: var(--gray-900);
}

/* === Game Rules (Payoff Matrix & Termination) === */
.game-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.game-rules h3 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
    font-weight: 600;
}

/* Payoff Matrix Table */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.matrix-table th,
.matrix-table td {
    padding: 0.5rem 0.75rem;
    text-align: center;
    border: 1px solid var(--gray-200);
}

.matrix-table thead th {
    background: var(--gray-100);
    font-weight: 600;
    font-size: 0.75rem;
}

.matrix-table tbody th {
    background: var(--gray-100);
    font-weight: 600;
    font-size: 0.75rem;
}

.matrix-table .cc {
    background: var(--gray-50);
    font-weight: 600;
}

.matrix-table .dd {
    background: var(--gray-100);
    font-weight: 600;
}

.matrix-table .cd {
    background: var(--gray-100);
}

.matrix-table .dc {
    background: var(--gray-50);
}

/* Termination Rule */
.termination-rule {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.termination-rule p {
    margin-bottom: 0.5rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.termination-rule .hint {
    font-size: 0.8rem;
    color: var(--gray-500);
}

@media (max-width: 768px) {
    .game-rules {
        grid-template-columns: 1fr;
    }
}

/* === Rounds Viewer === */
.rounds-viewer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.rounds-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.opponent-select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    min-width: 200px;
}

.rounds-result-container {
    min-height: 50px;
}

/* === Game Rounds Result === */
.game-rounds-result {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.rounds-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.strategy-label {
    font-weight: 600;
    color: var(--gray-700);
}

.vs-label {
    color: var(--gray-400);
    font-size: 0.8rem;
}

.rounds-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    border: 1px solid var(--gray-200);
}

.rounds-count {
    color: var(--gray-500);
}

.avg-score {
    color: var(--gray-600);
}

/* Rounds Timeline */
.rounds-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
}

.round-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    background: white;
    border: 1px solid var(--gray-200);
}

.round-item.mutual-coop {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.round-item.mutual-defect {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.round-item.i-defect {
    background: white;
    border-color: var(--gray-300);
}

.round-item.opp-defect {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.round-num {
    color: var(--gray-400);
    font-size: 0.65rem;
}

.choices {
    display: flex;
    gap: 0.15rem;
}

.choice {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.65rem;
}

.choice-c {
    background: #22c55e;
    color: white;
}

.choice-d {
    background: #ef4444;
    color: white;
}

.scores {
    color: var(--gray-600);
    font-size: 0.65rem;
}

.no-rounds {
    color: var(--gray-400);
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem;
}

/* === Cooperation Rate Columns === */
.coop-rate, .coop-after-defect {
    font-size: 0.85rem;
    text-align: center;
}

.coop-rate {
    color: var(--gray-700);
}

.coop-after-defect {
    color: var(--gray-500);
}
