/* benchmark.rodeo - Styles du site public */

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

:root {
    --accent: #f59e0b;
    --accent-dim: rgba(245, 158, 11, 0.12);
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --text: #f0f0f5;
    --text-dim: #a0aec0;
    --border: rgba(255, 255, 255, 0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */

.site-header {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-logo {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    flex: 1;
    display: flex;
    gap: 20px;
}

.site-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}

.site-nav a:hover {
    color: var(--text);
}

.lang-switcher {
    position: relative;
}

.lang-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 32px 7px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

.lang-trigger:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.lang-trigger:focus {
    outline: none;
    border-color: var(--accent);
}

.lang-trigger[aria-expanded="true"] {
    border-color: var(--accent);
}

.lang-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 100%;
    z-index: 4000;
    padding: 4px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    animation: langDropOpen 0.12s ease;
}

.lang-dropdown.lang-open {
    display: block;
}

@keyframes langDropOpen {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-option {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s ease;
    user-select: none;
    white-space: nowrap;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.lang-option.is-selected {
    color: var(--accent);
    font-weight: 500;
}

/* Hero */

.hero {
    text-align: center;
    padding: 80px 24px 48px;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 18px;
    color: var(--text-dim);
    line-height: 1.7;
}

/* Series cards */

.series-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.series-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.15s;
}

.series-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.series-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.series-card p {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 12px;
    line-height: 1.5;
}

.series-meta {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Home : CTA dans le hero */

.hero-cta {
    margin-top: 24px;
}
.hero-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 999px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    user-select: none;
}
.hero-cta-link:hover {
    background: rgba(245, 158, 11, 0.08);
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* Home : gagnants par serie */

.home-series-section {
    max-width: 1320px;
    margin: 0 auto 48px;
    padding: 0 24px;
}
.home-series-head {
    margin-bottom: 14px;
}
.home-series-head h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
}
.home-series-head h2 a {
    color: inherit;
    text-decoration: none;
    background-image: linear-gradient(transparent calc(100% - 1px), rgba(245, 158, 11, 0.6) 1px);
    background-repeat: no-repeat;
    background-size: 0% 100%;
    transition: background-size 0.25s;
}
.home-series-head h2 a:hover {
    background-size: 100% 100%;
}
.home-series-desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    max-width: 720px;
}

.home-winners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.home-winner-tile {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, transform 0.15s;
    user-select: none;
}
.home-winner-tile:hover {
    border-color: rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
}

.home-winner-tile .winner-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #0d0d14;
    overflow: hidden;
}
.home-winner-tile .winner-visual img,
.home-winner-tile .winner-visual iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 0;
    display: block;
    background: #fff;
}
.home-winner-tile.tile-image .winner-visual img {
    object-fit: cover;
    background: #0d0d14;
}
.home-winner-tile.tile-text .winner-visual {
    aspect-ratio: 4 / 3;
    background: #14141c;
}
.winner-text-excerpt {
    padding: 14px 14px 32px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-dim);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
}
.winner-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 24px;
}
.winner-score {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0;
    z-index: 2;
}
.winner-score .result-score {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.home-winner-tile .winner-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.winner-task {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.winner-model {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}
.winner-provider {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.winner-name {
    font-size: 11.5px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Classement global (tableaux) */

.ranking-section {
    max-width: 1100px;
    margin: 0 auto 48px;
    padding: 0 24px;
}
.ranking-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.ranking-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border), transparent);
}

.ranking-table-wrap {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ranking-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
}
.ranking-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}
.ranking-table tbody tr:last-child td {
    border-bottom: 0;
}
.ranking-table tbody tr:hover {
    background: rgba(245, 158, 11, 0.04);
}

.ranking-table .col-rank { width: 1%; white-space: nowrap; }
.ranking-table .col-score { width: 1%; white-space: nowrap; }
.ranking-table .col-tests,
.ranking-table .col-time,
.ranking-table .col-cost { width: 1%; white-space: nowrap; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.rank-pill.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1a1208; }
.rank-pill.rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #1a1a1a; }
.rank-pill.rank-3 { background: linear-gradient(135deg, #cd853f, #a0522d); color: #1a1208; }

.rank-provider {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
}
.rank-model {
    font-weight: 600;
    color: var(--text);
}

@media (max-width: 640px) {
    .home-winners-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .home-series-section { padding: 0 16px; }
    .ranking-section { padding: 0 16px; }
    .ranking-table thead th,
    .ranking-table tbody td { padding: 9px 10px; }
    .ranking-table .col-tests,
    .ranking-table .col-cost { display: none; }
}

/* Content */

.site-main {
    flex: 1;
}

.content-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* Page head (benchmarks list & series detail) */

.page-head {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 24px;
}

.page-head h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 8px 0 12px;
    background: linear-gradient(135deg, var(--accent), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-head-desc {
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1.6;
    max-width: 720px;
    margin-bottom: 12px;
}

.page-head-meta {
    color: var(--text-dim);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crumbs {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.crumbs a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.15s;
}

.crumbs a:hover {
    color: var(--accent);
}

.crumb-sep {
    margin: 0 8px;
    opacity: 0.5;
}

.crumb-current {
    color: var(--text);
}

/* Task block & results */

.task-block {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    border-top: 1px solid var(--border);
}

.task-block:first-of-type {
    border-top: none;
}

.task-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.task-head h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.format-badge {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.result-card {
    perspective: 800px;
    position: relative;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
}

.card-inner {
    position: relative;
    width: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
}

.card-front {
    position: relative;
    cursor: pointer;
}

.result-stats-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-shrink: 0;
}

.card-info-hint {
    color: rgba(255, 255, 255, 0.15);
    transition: color 0.2s;
    pointer-events: none;
    display: flex;
    align-items: center;
    padding-left: 8px;
    margin-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.result-card:hover .card-info-hint {
    color: rgba(245, 158, 11, 0.7);
}

.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotateY(180deg);
    overflow-y: auto;
}

.result-card:hover .card-front,
.result-card:hover .card-back {
    border-color: rgba(245, 158, 11, 0.4);
}

.result-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.result-model-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.result-provider {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.result-model {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.result-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.result-time {
    font-size: 11px;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.result-score {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.score-high {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.score-mid {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.score-low {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.card-actions {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border);
}

.card-code-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s, background 0.15s;
}

.card-code-btn:hover {
    color: var(--accent);
    background: rgba(245, 158, 11, 0.06);
}

.card-back-close {
    padding: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.card-back-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.card-back-content {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
}
.card-back-content::-webkit-scrollbar {
    width: 8px;
}
.card-back-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}
.card-back-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0;
}
.card-back-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
.card-back-content::-webkit-scrollbar-button {
    display: none;
}

.card-back-stats {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    border-bottom: 1px solid var(--border);
}

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

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stat-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.card-back-thumb {
    width: 100%;
    max-height: 140px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #111;
    cursor: zoom-in;
    transition: transform 0.15s ease;
}
.card-back-thumb:hover {
    transform: scale(1.01);
}
.card-back-thumb img {
    width: 100%;
    height: 100%;
    max-height: 140px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

/* Indicateur de scroll en bas de la carte retournee */
.card-back-scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(10, 10, 18, 0.75);
    color: rgba(245, 158, 11, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}
.card-back-scroll-hint.is-hidden {
    display: none;
}
.card-back-scroll-hint.is-animating {
    animation: bm-scroll-hint 2.1s ease-out 0.25s 1 forwards;
}
@keyframes bm-scroll-hint {
    0%   { opacity: 0; transform: translate(-50%, 4px); }
    8%   { opacity: 1; transform: translate(-50%, 0); }
    20%  { opacity: 0.15; transform: translate(-50%, 7px); }
    32%  { opacity: 1; transform: translate(-50%, 0); }
    44%  { opacity: 0.15; transform: translate(-50%, 7px); }
    56%  { opacity: 1; transform: translate(-50%, 0); }
    72%  { opacity: 0.15; transform: translate(-50%, 7px); }
    100% { opacity: 0; transform: translate(-50%, 7px); }
}

/* Lightbox d'image */
.image-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
    -webkit-tap-highlight-color: transparent;
}
.image-lightbox-overlay.image-lightbox-open {
    display: flex;
    animation: bm-lightbox-fade 0.18s ease-out;
}
@keyframes bm-lightbox-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.image-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: default;
    user-select: none;
}
.image-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
    user-select: none;
}
.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
}
@media (max-width: 640px) {
    .image-lightbox-overlay { padding: 16px; }
    .image-lightbox-close { top: 10px; right: 10px; }
}

.card-back-judgment {
    margin-bottom: 14px;
}
.card-back-judgment-label {
    font-size: 11px;
    font-weight: 700;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.judgment-scores {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.judgment-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.judgment-criteria {
    font-size: 11px;
    color: var(--text-dim);
    width: 90px;
    flex-shrink: 0;
    text-align: right;
}
.judgment-bar-wrap {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}
.judgment-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.judgment-val {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    width: 22px;
    text-align: right;
    flex-shrink: 0;
}
.judgment-overall {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.judgment-overall .judgment-criteria {
    font-weight: 700;
    color: var(--text);
}
.judgment-overall .judgment-val {
    font-weight: 700;
}
.judgment-overall-only {
    text-align: center;
    padding: 8px 0;
}

.card-back-review-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.card-back-commentary {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
}

.preview {
    aspect-ratio: 1 / 1;
    background: #fff;
    overflow: hidden;
    position: relative;
}

.preview-image {
    aspect-ratio: 16 / 9;
    background: #0a0a0f;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}

/* Apercu audio (Web Audio API / Tone.js) : waveform + lecteur integre.
   On utilise la specificite .preview.preview-audio pour neutraliser
   l'aspect-ratio carre herite de .preview (sinon la carte garde un
   format 1:1 et laisse un bandeau vide sous le lecteur). */
.preview.preview-audio {
    aspect-ratio: auto;
    height: 200px;
    background: #1a1a2e;
    overflow: hidden;
    position: relative;
}

.preview.preview-audio iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #1a1a2e;
}

/* Grille elargie pour les benchmarks audio : le lecteur a besoin de
   plus de largeur que les apercus de code carres. */
.results-grid-audio {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}

.preview-capture {
    aspect-ratio: 1 / 1;
    background: #fff;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-capture img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Playable previews (apps & animations) */

.preview-playable {
    aspect-ratio: 1 / 1;
    background: #111;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.preview-playable .play-poster {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.preview-playable .play-poster-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #0d0d1a 100%);
}

.preview-playable .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
    user-select: none;
    backdrop-filter: blur(4px);
}

.preview-playable .play-btn:hover {
    background: rgba(74, 158, 255, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.preview-playable .play-btn svg {
    width: 24px;
    height: 24px;
    margin-left: 2px;
}

.preview-playable.playing .play-btn {
    display: none;
}

.preview-playable.playing .play-poster,
.preview-playable.playing .play-poster-placeholder {
    display: none;
}

.preview-playable .play-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
    position: absolute;
    top: 0;
    left: 0;
}

.preview-empty {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 24px;
    background: #1a1a22;
}

/* Code modal */

.code-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.code-modal-overlay.code-modal-open {
    display: flex;
}

.code-modal {
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: codeModalIn 0.15s ease;
}

@keyframes codeModalIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.code-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.code-modal-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.code-modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    user-select: none;
}

.code-modal-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.code-modal-body {
    flex: 1;
    overflow: auto;
    margin: 0;
    padding: 16px;
    background: #0a0a10;
    font-size: 12px;
    line-height: 1.6;
    color: #cbd5e0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.code-modal-body code {
    white-space: pre;
    word-wrap: normal;
}

.muted {
    color: var(--text-dim);
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 13px;
    color: var(--text-dim);
}

/* RTL */

[dir="rtl"] .site-nav {
    direction: rtl;
}

[dir="rtl"] .header-inner {
    direction: rtl;
}

/* Responsive */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 28px;
    }
    .hero-desc {
        font-size: 15px;
    }
    .series-list {
        grid-template-columns: 1fr;
    }
    .results-grid {
        grid-template-columns: 1fr;
    }
    .header-inner {
        padding: 0 16px;
    }
    .code-modal {
        max-width: 100%;
        max-height: 90vh;
    }
    .code-modal-overlay {
        padding: 12px;
    }
}
