/* ===== CLBench-Life page overrides ===== */

#life-leaderboard .clb-detail-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* ===== Liquid Glass Case Cards ===== */
.life-cases {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 22px 0;
  padding: 12px;
  border-radius: 12px;
  position: relative;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 180, 130, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 70%, rgba(130, 170, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 40%, rgba(160, 220, 160, 0.12) 0%, transparent 50%),
    rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.life-case {
  position: relative;
  padding: 14px 12px 12px;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.35s ease;

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.72) 0%,
      rgba(255, 255, 255, 0.36) 40%,
      rgba(255, 255, 255, 0.52) 100%
    );
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);

  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -0.5px 1px rgba(0, 0, 0, 0.03),
    0 2px 12px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
}

.life-case::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

.life-case--warm::before {
  background: linear-gradient(145deg, rgba(255, 180, 130, 0.2) 0%, rgba(255, 220, 200, 0.08) 50%, transparent 100%);
}

.life-case--cool::before {
  background: linear-gradient(145deg, rgba(130, 170, 255, 0.2) 0%, rgba(200, 210, 255, 0.08) 50%, transparent 100%);
}

.life-case--neutral::before {
  background: linear-gradient(145deg, rgba(160, 220, 160, 0.2) 0%, rgba(200, 240, 210, 0.08) 50%, transparent 100%);
}

.life-case--lilac::before {
  background: linear-gradient(145deg, rgba(190, 160, 230, 0.2) 0%, rgba(220, 200, 240, 0.08) 50%, transparent 100%);
}

.life-case:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -0.5px 1px rgba(0, 0, 0, 0.03),
    0 6px 20px rgba(0, 0, 0, 0.10),
    0 1px 3px rgba(0, 0, 0, 0.06);
}

.life-case > * {
  position: relative;
  z-index: 1;
}

/* Header row (always visible) */
.life-case-header {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.life-case-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.85) 0%,
      rgba(255, 255, 255, 0.45) 100%
    );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 4px rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.life-case-icon svg {
  width: 14px;
  height: 14px;
}

.life-case-header-text {
  flex: 1;
  min-width: 0;
}

.life-case-title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.3;
  margin: 0;
}

.life-case-subtitle {
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  margin-top: 2px;
  display: block;
  line-height: 1.5;
}

.life-case-subtitle-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 2px;
}

.life-case-subcat {
  color: var(--text-tertiary);
}

.life-case-subcat-sep {
  color: var(--text-tertiary);
  opacity: 0.5;
  margin: 0 1px;
}

.life-case-example-note {
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.life-case-example-note strong {
  font-weight: 600;
  color: var(--text-secondary);
}

.life-case-arrow {
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.life-case.open .life-case-arrow {
  transform: rotate(180deg);
}

/* Expandable body */
.life-case-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.45s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.35s ease,
    margin 0.35s ease;
  margin-top: 0;
}

.life-case.open .life-case-body {
  max-height: 320px;
  opacity: 1;
  margin-top: 9px;
}

.life-case-context,
.life-case-task {
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.life-case-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-tertiary);
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 6px;
  vertical-align: 1px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.8),
    inset 0 -0.5px 1px rgba(0, 0, 0, 0.04),
    0 1px 4px rgba(0, 0, 0, 0.05),
    0 0.5px 1px rgba(0, 0, 0, 0.04);
}

.life-case-badge--task {
  color: var(--text-secondary);
}

.life-case-meta {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  letter-spacing: 0.01em;
}

/* Single-run marker */
.life-single-run {
  color: #b07030;
  font-size: 0.75em;
  margin-left: 1px;
  cursor: help;
}

.life-footnote {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 6px;
  padding-left: 2px;
  letter-spacing: 0.01em;
}

.life-footnote sup {
  color: #b07030;
  font-size: 0.9em;
}

/* ===== Pass Score Curve Chart ===== */
.psc-section {
  margin-top: 24px;
}

.psc-title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 5px;
}

.psc-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}

.psc-hint {
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.6;
  margin-top: 8px;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.psc-hint strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.psc-controls {
  margin-bottom: 8px;
}

.psc-model-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.psc-toggle {
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 7px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.psc-toggle:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}

.psc-toggle.active {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border-color: var(--text-tertiary);
}

.psc-toggle.pinned {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.psc-toggle.pinned .psc-toggle-dot {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.psc-pin-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  background: #1a1a1a;
  padding: 4px 4px 4px 10px;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  letter-spacing: 0.01em;
  max-width: calc(100% - 20px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.psc-pin-badge strong {
  font-weight: 700;
}

.psc-pin-clear {
  all: unset;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.psc-pin-clear:hover {
  background: rgba(255, 255, 255, 0.35);
}

.psc-detail-table tbody tr.pinned {
  background: rgba(26, 26, 26, 0.06);
  box-shadow: inset 3px 0 0 #1a1a1a;
}

.psc-detail-table tbody tr.pinned td {
  color: var(--black);
  font-weight: 600;
}

.psc-toggle-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

.psc-chart-container {
  position: relative;
  width: 100%;
  height: 360px;
  padding: 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 2px 12px rgba(0, 0, 0, 0.05);
}

.psc-detail-panel {
  margin-top: 10px;
}

.psc-detail-title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 5px;
}

.psc-detail-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
}

.psc-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.psc-detail-table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: 5px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}

.psc-detail-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 10px;
  white-space: nowrap;
}

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

.psc-detail-table tbody tr {
  cursor: pointer;
}

.psc-detail-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.35);
}

.psc-detail-table td strong {
  font-weight: 700;
}

.psc-rank-1 { color: #d97706; font-weight: 700; }
.psc-rank-2 { color: #6b7280; font-weight: 700; }
.psc-rank-3 { color: #92400e; font-weight: 700; }

@media (max-width: 768px) {
  #life-leaderboard .clb-detail-grid {
    grid-template-columns: 1fr;
  }

  .life-cases {
    width: 100%;
    padding: 8px;
    gap: 5px;
  }

  .life-case {
    padding: 10px 8px;
  }

  .life-case-title {
    font-size: 11px;
  }

  .psc-chart-container {
    height: 260px;
    padding: 4px;
  }

  .psc-title {
    font-size: 11px;
  }

  .psc-desc {
    font-size: 11px;
  }

  .psc-toggle {
    font-size: 10px;
    padding: 2px 5px;
  }
}
