/* === CSS Variables - Plotline Light Theme === */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --bg-card: #ffffff;
  --bg-hover: #f8f9fa;
  
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  
  --primary: #753bee;
  --primary-light: #8b5cf6;
  --primary-dark: #5b21b6;
  --primary-glow: rgba(117, 59, 238, 0.15);
  --primary-subtle: rgba(117, 59, 238, 0.08);
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --gold: #f59e0b;
  --silver: #6b7280;
  --bronze: #b45309;
  
  --nano-banana: #f59e0b;
  --nano-banana-pro: #8b5cf6;
  --gpt-image: #10b981;
  
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === Container === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === App Layout === */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Global Header === */
.global-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.global-header .header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-img {
  height: 28px;
  width: auto;
}

.logo-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.logo-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.header-link:hover {
  color: var(--primary);
}

/* === Pages === */
.page {
  display: none;
  flex: 1;
}

.page.active {
  display: block;
}

/* === Home Page === */
.home-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 80px 24px;
  text-align: center;
  color: white;
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.home-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 1.125rem;
  opacity: 0.9;
  line-height: 1.7;
}

/* === Benchmarks Section === */
.benchmarks-section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text-primary);
}

.benchmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.benchmark-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.benchmark-card:hover:not(.coming-soon) {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--primary-glow);
  transform: translateY(-2px);
}

.benchmark-card.coming-soon {
  opacity: 0.7;
  cursor: default;
}

.benchmark-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.benchmark-icon {
  font-size: 2rem;
}

.benchmark-status {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 100px;
}

.benchmark-status.live {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.benchmark-status.upcoming {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.benchmark-card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.benchmark-full-name {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.benchmark-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.benchmark-stats {
  display: flex;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

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

.benchmark-stat .stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.benchmark-stat .stat-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.benchmark-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.benchmark-cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.benchmark-card:hover .benchmark-cta svg {
  transform: translateX(4px);
}

.benchmark-cta.disabled {
  color: var(--text-muted);
}

/* === Benchmark Page Header === */
.benchmark-header {
  background: var(--bg-primary);
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
  margin-bottom: 20px;
}

.back-btn:hover {
  color: var(--primary);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.benchmark-title-section {
  margin-bottom: 24px;
}

.benchmark-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--primary-subtle);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.benchmark-title-section h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.benchmark-title-section p {
  color: var(--text-muted);
  font-size: 1rem;
}

.benchmark-meta {
  display: flex;
  gap: 16px;
}

.meta-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.meta-chip .meta-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.meta-chip .meta-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === Navigation === */
.nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 100;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 4px;
}

.nav-btn {
  padding: 16px 20px;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text-secondary);
}

.nav-btn.active {
  color: var(--primary);
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* === Main Content === */
.main {
  flex: 1;
  padding: 40px 0;
}

.content-section {
  display: none;
}

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

.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* === Podium === */
.podium-container {
  display: flex;
  justify-content: center;
  padding: 48px 0;
  background: linear-gradient(180deg, var(--primary-subtle) 0%, transparent 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}

.podium {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.podium-crown {
  font-size: 1.5rem;
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.podium-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.first .podium-avatar {
  background: linear-gradient(135deg, var(--gold), #d97706);
  color: #fff;
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.second .podium-avatar {
  background: linear-gradient(135deg, #9ca3af, #6b7280);
  color: #fff;
}

.third .podium-avatar {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
}

.podium-name {
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  max-width: 100px;
}

.podium-score {
  font-size: 1rem;
  font-weight: 700;
}

.first .podium-score { color: var(--gold); }
.second .podium-score { color: var(--silver); }
.third .podium-score { color: var(--bronze); }

.podium-block {
  width: 100px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: var(--shadow-sm);
}

.first .podium-block {
  height: 120px;
  width: 120px;
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-primary) 100%);
}

.second .podium-block {
  height: 80px;
  border-color: var(--silver);
}

.third .podium-block {
  height: 56px;
  border-color: var(--bronze);
}

/* === Standings Table === */
.standings-table-container {
  margin-bottom: 32px;
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.standings-table th,
.standings-table td {
  padding: 16px 20px;
  text-align: left;
}

.standings-table th {
  background: var(--bg-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.standings-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

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

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

.standings-table .position {
  font-weight: 700;
  font-size: 1.125rem;
}

.standings-table .position-1 { color: var(--gold); }
.standings-table .position-2 { color: var(--silver); }
.standings-table .position-3 { color: var(--bronze); }

.standings-table .model-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.standings-table .points {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}

.standings-table .podium-count {
  font-size: 0.9375rem;
  font-weight: 500;
}

/* === Chart Container === */
.chart-container {
  padding: 28px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.chart-container h3 {
  margin-bottom: 20px;
  font-size: 1rem;
  font-weight: 600;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bar-label {
  width: 130px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.bar-track {
  flex: 1;
  height: 28px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  transition: width 0.8s ease;
}

/* === Performance Section === */
.perf-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.perf-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.perf-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.perf-card.fastest::before {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.perf-card-icon {
  font-size: 1.75rem;
  margin-bottom: 12px;
}

.perf-card-model {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.perf-card-value {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.perf-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.perf-card-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

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

.perf-stat-value {
  font-size: 0.9375rem;
  font-weight: 600;
}

.perf-stat-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Section Runtime Grid */
.section-runtime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.section-runtime-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
}

.section-runtime-card h4 {
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-runtime-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.runtime-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.runtime-bar-label {
  width: 100px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.runtime-bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.runtime-bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  transition: width 0.6s ease;
}

/* Task Runtime Chart */
.task-runtime-chart {
  overflow-x: auto;
}

.task-runtime-table {
  width: 100%;
  min-width: 600px;
}

.task-runtime-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

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

.task-runtime-row.header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.task-runtime-id {
  font-weight: 600;
  color: var(--primary);
}

.task-runtime-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-runtime-bar {
  flex: 1;
  height: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.task-runtime-fill {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 0.625rem;
  font-weight: 600;
  color: #fff;
  min-width: 40px;
}

.task-runtime-fill.failed {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(239, 68, 68, 0.3) 4px,
    rgba(239, 68, 68, 0.3) 8px
  ) !important;
  color: var(--error);
}

/* Success Rate Grid */
.success-rate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.success-rate-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}

.success-rate-model {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 16px;
}

.success-rate-ring {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 16px;
}

.success-rate-ring svg {
  transform: rotate(-90deg);
}

.success-rate-ring circle {
  fill: none;
  stroke-width: 8;
}

.success-rate-ring .bg {
  stroke: var(--bg-primary);
}

.success-rate-ring .progress {
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.success-rate-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.25rem;
  font-weight: 700;
}

.success-rate-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.success-rate-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.success-rate-stats .success-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.success-rate-stats .fail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

/* === Sections Grid === */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.section-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.section-card-header {
  padding: 20px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.section-card-header h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-card-body {
  padding: 20px 24px;
}

.section-ranking {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.section-ranking:last-child {
  border-bottom: none;
}

.section-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.section-rank-1 { background: var(--gold); }
.section-rank-2 { background: var(--silver); }
.section-rank-3 { background: var(--bronze); }

.section-model {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
}

.section-score {
  font-weight: 600;
  color: var(--primary);
}

/* === Tasks List === */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.task-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.task-card-header:hover {
  background: var(--bg-hover);
}

.task-id-badge {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 6px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
}

.task-info {
  flex: 1;
}

.task-info h4 {
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.task-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-winner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
}

.task-winner .winner-icon {
  font-size: 1rem;
}

.task-card-body {
  padding: 20px 24px;
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.task-card.expanded .task-card-body {
  display: block;
}

.task-rankings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.task-ranking-item {
  padding: 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border);
}

.task-ranking-position {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.task-ranking-model {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.task-ranking-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === Gallery === */
.gallery-nav {
  margin-bottom: 24px;
}

.gallery-nav select {
  width: 100%;
  max-width: 400px;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
}

.gallery-nav select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.gallery-placeholder {
  padding: 80px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
}

.gallery-task-info {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.gallery-task-info h3 {
  margin-bottom: 12px;
}

.gallery-prompt {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

.gallery-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.gallery-image-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.gallery-image-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gallery-image-card.rank-1 { border-color: var(--gold); }
.gallery-image-card.rank-2 { border-color: var(--silver); }
.gallery-image-card.rank-3 { border-color: var(--bronze); }

.gallery-image-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.gallery-model-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.875rem;
}

.gallery-rank-badge {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.gallery-rank-badge.rank-1 { background: var(--gold); }
.gallery-rank-badge.rank-2 { background: var(--silver); }
.gallery-rank-badge.rank-3 { background: var(--bronze); }

.gallery-image-wrapper {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-tertiary);
}

.gallery-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.gallery-image-wrapper:hover img {
  transform: scale(1.05);
}

.gallery-image-stats {
  padding: 16px;
  display: flex;
  justify-content: space-around;
  background: var(--bg-secondary);
}

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

.gallery-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}

.gallery-stat-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gallery-input-image {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.gallery-input-image h4 {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.gallery-input-image img {
  max-width: 400px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* === Footer === */
.footer {
  padding: 32px 0;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  height: 24px;
  width: auto;
}

.footer-brand span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-credits {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* === Modal === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.modal-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius-lg);
}

.modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.modal-close:hover {
  opacity: 0.7;
}

/* === Responsive === */
@media (max-width: 768px) {
  .home-hero h1 {
    font-size: 2rem;
  }
  
  .benchmarks-grid {
    grid-template-columns: 1fr;
  }
  
  .benchmark-meta {
    flex-wrap: wrap;
  }
  
  .podium {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }
  
  .podium-place { order: 0; }
  .first { order: -1; }
  
  .perf-summary,
  .success-rate-grid {
    grid-template-columns: 1fr;
  }
  
  .task-rankings {
    grid-template-columns: 1fr;
  }
  
  .gallery-images {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
