/* Courtroom Live — immersive role-play UI */
.cl-page {
  --cl-accent: #8b5cf6;
  --cl-bench: #1e3a5f;
  --cl-gold: #c9a227;
}

.cl-hero {
  padding: 1rem 1rem 1.5rem;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.12) 0%, transparent 100%);
}
.cl-breadcrumb { justify-content: flex-start; margin-bottom: 1rem; }
.cl-hero-inner {
  display: grid;
  gap: 1.25rem;
  max-width: 960px;
  margin: 0 auto;
}
@media (min-width: 720px) {
  .cl-hero-inner { grid-template-columns: 1fr 1.1fr; align-items: center; }
}
.cl-hero-text h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  margin: 0.35rem 0;
}
.cl-hero-text p { color: var(--gl-muted); font-size: 0.9rem; line-height: 1.6; margin: 0; }
.cl-bench-visual {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--gl-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.cl-bench-visual .cq-courtroom-svg { width: 100%; height: auto; display: block; }

.cl-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.cl-panel {
  background: var(--gl-card);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.cl-panel h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Case cards */
.cl-case-cards { display: grid; gap: 0.85rem; }
.cl-case-card {
  text-align: left;
  padding: 1.1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--gl-border);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.cl-case-card:hover {
  border-color: var(--cl-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
}
.cl-case-card strong { display: block; font-size: 1rem; margin: 0.25rem 0; }
.cl-case-card > span:not(.cl-case-card-cta) { font-size: 0.8125rem; color: var(--gl-muted); }
.cl-case-card-court {
  font-size: 0.6875rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a78bfa !important;
}
.cl-case-card-cta {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cl-accent);
}

/* Active courtroom */
.cl-case-header {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.cl-back-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--gl-border);
  background: transparent;
  color: var(--gl-text);
  cursor: pointer;
}
.cl-case-eyebrow { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: #a78bfa; margin: 0; }
.cl-case-header h2 { font-family: 'Source Serif 4', Georgia, serif; font-size: 1.2rem; margin: 0.15rem 0; }
.cl-case-sub { font-size: 0.8125rem; color: var(--gl-muted); margin: 0; }

.cl-facts-card {
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.cl-facts-card h3 { font-size: 0.8125rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.4rem; }
.cl-facts-card p { font-size: 0.875rem; line-height: 1.65; margin: 0; }

.cl-role-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.cl-role-bar label { font-size: 0.8125rem; font-weight: 600; }
.cl-role-brief {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--gl-muted);
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--cl-accent);
}
.cl-hints { display: block; margin-top: 0.4rem; font-size: 0.75rem; color: #94a3b8; }
.cl-hints em { font-style: normal; color: #c4b5fd; }

/* Input modes */
.cl-input-zone {
  border: 1px solid var(--gl-border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.cl-mode-tabs {
  display: flex;
  border-bottom: 1px solid var(--gl-border);
}
.cl-mode-tab {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--gl-muted);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.15s, color 0.15s;
}
.cl-mode-tab.active {
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  box-shadow: inset 0 -2px 0 var(--cl-accent);
}
.cl-mode-panel { padding: 1rem; }
.cl-argument { min-height: 140px; border: none !important; background: transparent !important; margin: 0 !important; }
.cl-char-count { font-size: 0.6875rem; color: var(--gl-muted); text-align: right; margin-top: 0.35rem; }

/* Voice stage */
.cl-voice-stage { text-align: center; padding: 1.5rem 1rem; }
.cl-voice-btn {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(139, 92, 246, 0.4);
  transition: transform 0.15s;
}
.cl-voice-btn:hover { transform: scale(1.05); }
.cl-voice-btn.listening { animation: cl-pulse 1.2s ease infinite; }
.cl-voice-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(139, 92, 246, 0.4);
  pointer-events: none;
}
.cl-voice-btn.listening .cl-voice-ring { animation: cl-ring 1.2s ease infinite; }
@keyframes cl-pulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(139, 92, 246, 0.4); }
  50% { box-shadow: 0 8px 40px rgba(139, 92, 246, 0.7); }
}
@keyframes cl-ring {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}
.cl-voice-status { font-size: 0.8125rem; color: var(--gl-muted); margin: 1rem 0 0.5rem; }
.cl-voice-transcript {
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: left;
  min-height: 4rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--gl-border);
}

/* Recording */
.cl-record-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.cl-record-btn.recording { color: #f87171; border-color: #f87171; }
.cl-record-btn.recording i { animation: cl-blink 1s infinite; }
@keyframes cl-blink { 50% { opacity: 0.3; } }
.cl-record-timer { font-size: 0.8125rem; font-variant-numeric: tabular-nums; color: #f87171; }
.cl-playback {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}
.cl-playback audio { flex: 1; max-width: 100%; height: 36px; }
.cl-discard-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--gl-border);
  background: transparent;
  color: var(--gl-muted);
  cursor: pointer;
}

.cl-submit-btn {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  font-size: 0.9375rem;
}

/* AI Judge panel */
.cl-judge-panel {
  background: var(--gl-card);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.cl-judge-panel.cl-verdict-good { border-color: #10b981; }
.cl-judge-panel.cl-verdict-mid { border-color: #f59e0b; }
.cl-judge-panel.cl-verdict-low { border-color: #ef4444; }

.cl-judge-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.cl-judge-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e3a5f, #3b6ea5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--cl-gold);
  flex-shrink: 0;
}
.cl-judge-eyebrow { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gl-muted); margin: 0; }
.cl-judge-header h2 { font-family: 'Source Serif 4', Georgia, serif; font-size: 1.35rem; margin: 0.1rem 0 0; }
.cl-total-score {
  margin-left: auto;
  font-size: 2rem;
  font-weight: 800;
  color: var(--cl-accent);
  line-height: 1;
}

.cl-score-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 480px) {
  .cl-score-grid { grid-template-columns: repeat(3, 1fr); }
}
.cl-score-card {
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--gl-border);
}
.cl-score-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gl-muted); display: block; margin-bottom: 0.4rem; }
.cl-score-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--gl-border);
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.cl-score-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cl-accent), #06b6d4);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.cl-score-val { font-size: 1.1rem; font-weight: 700; }

.cl-judge-thinking {
  text-align: center;
  padding: 1.5rem;
  color: var(--gl-muted);
  font-size: 0.875rem;
}
.cl-thinking-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 0.5rem; }
.cl-thinking-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cl-accent);
  animation: cl-dot 1.2s ease infinite;
}
.cl-thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.cl-thinking-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes cl-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.cl-feedback-stream { display: grid; gap: 0.65rem; margin-bottom: 1rem; }
.cl-feedback-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.55;
  animation: cl-fade-in 0.35s ease;
}
@keyframes cl-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.cl-feedback-item p { margin: 0; }
.cl-feedback-good { background: rgba(16, 185, 129, 0.1); border-left: 3px solid #10b981; }
.cl-feedback-good i { color: #10b981; margin-top: 2px; }
.cl-feedback-warn { background: rgba(245, 158, 11, 0.1); border-left: 3px solid #f59e0b; }
.cl-feedback-warn i { color: #f59e0b; margin-top: 2px; }
.cl-feedback-cite { background: rgba(139, 92, 246, 0.1); border-left: 3px solid var(--cl-accent); }
.cl-feedback-cite i { color: #a78bfa; margin-top: 2px; }

.cl-precedents-block h3 {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cl-precedent-card {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(30, 58, 95, 0.35);
  border: 1px solid rgba(59, 110, 165, 0.35);
  margin-bottom: 0.5rem;
}
.cl-precedent-card strong { display: block; font-size: 0.8125rem; color: #93c5fd; margin-bottom: 0.35rem; }
.cl-precedent-card p { font-size: 0.8125rem; line-height: 1.55; margin: 0; color: var(--gl-muted); }

.cl-judge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.cl-judge-actions .gl-btn { flex: 1; min-width: 140px; justify-content: center; }

@media (max-width: 380px) {
  .cl-total-score { font-size: 1.5rem; }
  .cl-voice-btn { width: 72px; height: 72px; font-size: 1.4rem; }
}