:root {
  --bg: #06060b;
  --surface: #0d0d16;
  --surface2: #14142a;
  --surface3: #1c1c38;
  --border: #252548;
  --border-hi: #3a3a6a;
  --text: #e8e8f0;
  --dim: #7878a0;
  --muted: #505078;
  --accent: #8b5cf6;
  --accent-dim: #6b52c0;
  --gold: #fbbf24;
  --emerald: #34d399;
  --rose: #fb7185;
  --amber: #fbbf24;
  --philosopher: #a78bfa;
  --pragmatist: #60a5fa;
  --analyst: #2dd4bf;
  --creative: #f472b6;
  --maverick: #fb923c;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse 900px 500px at 50% 0%, rgba(139, 92, 246, .06), transparent),
    radial-gradient(ellipse 600px 400px at 80% 100%, rgba(45, 212, 191, .04), transparent),
    radial-gradient(ellipse 600px 400px at 20% 100%, rgba(244, 114, 182, .04), transparent),
    var(--bg);
  min-height: 100vh;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.court-header {
  text-align: center;
  padding: 48px 0 16px;
}

.gavel-icon {
  font-size: 52px;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, .25));
  margin-bottom: 8px;
}

.court-header h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent), var(--analyst), var(--emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--dim);
  font-size: 14px;
  margin-top: 6px;
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* Judge previews */
.judges-preview {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 28px 0 24px;
  flex-wrap: wrap;
}

.preview-judge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.preview-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all .2s;
}

.preview-judge:hover .preview-icon {
  border-color: var(--jc);
  box-shadow: 0 0 12px color-mix(in srgb, var(--jc) 25%, transparent);
}

.preview-name {
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 600;
}

/* Form */
.court-main { flex: 1; padding-bottom: 40px; }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .08);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
}

/* Submit */
.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 24px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: .5px;
  transition: filter .15s, transform .1s;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}
.submit-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  transition: left .5s;
}
.submit-btn:hover:not(:disabled)::before { left: 100%; }
.submit-btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.submit-btn:active:not(:disabled) { transform: translateY(0); }
.submit-btn:disabled { opacity: .5; cursor: not-allowed; }

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Verdict section */
.case-recap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
}

.recap-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.case-recap h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  line-height: 1.3;
}

.recap-position {
  font-size: 14px;
  color: var(--dim);
  line-height: 1.6;
  max-height: 100px;
  overflow: hidden;
}

/* Bench label */
.bench-label {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}
.bench-label span {
  display: inline-block;
  padding: 0 16px;
  background: var(--bg);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--muted);
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.bench-label::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Judge cards */
.judges-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.judge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease, border-color .3s;
}
.judge-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--jc, var(--accent));
  opacity: 0;
  transition: opacity .3s;
}
.judge-card.revealed {
  opacity: 1;
  transform: translateY(0);
}
.judge-card.revealed::before { opacity: 1; }
.judge-card.thinking { border-color: color-mix(in srgb, var(--jc) 40%, transparent); }
.judge-card.thinking::before { opacity: 1; }

.judge-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.judge-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.judge-meta { flex: 1; min-width: 0; }

.judge-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--jc, var(--text));
}

.judge-title {
  font-size: 12px;
  color: var(--dim);
  margin-top: 2px;
}

.judge-model {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 5px;
  display: inline-block;
  margin-top: 6px;
}

.judge-score-area {
  text-align: right;
  flex-shrink: 0;
  display: none;
}
.judge-card.scored .judge-score-area { display: block; }

.judge-score-num {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.judge-score-label {
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.judge-bar {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  margin: 14px 0;
  overflow: hidden;
  display: none;
}
.judge-card.scored .judge-bar { display: block; }

.judge-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--jc, var(--accent));
  width: 0%;
  transition: width .8s cubic-bezier(.4, 0, .2, 1);
}

.judge-verdict {
  font-size: 14px;
  color: var(--dim);
  line-height: 1.7;
  display: none;
}
.judge-card.scored .judge-verdict { display: block; }

/* Thinking dots */
.thinking-area {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--dim);
  font-size: 13px;
}
.judge-card.thinking .thinking-area { display: flex; }

.dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--jc, var(--dim));
  animation: dotBounce .6s infinite alternate;
}
.dot:nth-child(2) { animation-delay: .15s; }
.dot:nth-child(3) { animation-delay: .3s; }
@keyframes dotBounce { to { opacity: .25; transform: translateY(-5px); } }

/* Final ruling */
.final-ruling {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: scale(.96);
  transition: opacity .6s ease, transform .6s ease;
}
.final-ruling.revealed {
  opacity: 1;
  transform: scale(1);
}
.final-ruling::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, .06), transparent 70%);
  pointer-events: none;
}

.ruling-gavel {
  font-size: 56px;
  margin-bottom: 8px;
  animation: gavelSlam .6s ease-out;
}
@keyframes gavelSlam {
  0% { transform: rotate(-30deg) scale(1.3); opacity: 0; }
  50% { transform: rotate(5deg) scale(1.05); }
  100% { transform: rotate(0) scale(1); opacity: 1; }
}

.ruling-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.final-ruling h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}

.ruling-score {
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 16px 0;
}

.ruling-breakdown {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.rb-judge {
  text-align: center;
  min-width: 64px;
}

.rb-icon { font-size: 20px; margin-bottom: 4px; }

.rb-score {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
}

.rb-name {
  font-size: 10px;
  color: var(--dim);
  margin-top: 2px;
}

.ruling-summary {
  font-size: 15px;
  line-height: 1.7;
  color: var(--dim);
  max-width: 580px;
  margin: 20px auto 24px;
  position: relative;
  z-index: 1;
}
.ruling-summary strong {
  color: var(--text);
  font-weight: 600;
}

.new-case-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  text-transform: lowercase;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: .5px;
}
.new-case-btn:hover {
  background: rgba(139, 92, 246, .1);
  border-color: var(--accent);
}

/* Footer */
.court-footer {
  text-align: center;
  padding: 24px;
  font-size: 11px;
  color: var(--muted);
}
.court-footer a {
  color: var(--dim);
  text-decoration: none;
}
.court-footer a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 640px) {
  .court-header h1 { font-size: 26px; }
  .gavel-icon { font-size: 40px; }
  .judges-preview { gap: 10px; }
  .preview-icon { width: 36px; height: 36px; font-size: 18px; }
  .ruling-score { font-size: 36px; }
  .final-ruling h2 { font-size: 22px; }
  .judge-top { gap: 12px; }
  .judge-avatar { width: 44px; height: 44px; font-size: 22px; }
}
