/* ============================================================
   ⚖️ AI JUDGE — styles.css
   Dark courtroom landing page with gold accents.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #0d0d0d;
  --bg-soft: #141414;
  --card: #161616;
  --card-elevated: #1c1c1c;
  --elevated: #1c1c1c;
  --card-border: #262626;
  --surface: #1e1e1e;
  --surface-hover: #252525;
  --gold: #f5c518;
  --gold-light: #ffe066;
  --gold-dark: #c9a200;
  --text: #ececec;
  --text-muted: #9d9d9d;
  --text-dim: #6e6e6e;
  --danger: #ff5c6b;
  --success: #4ade80;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  --glow-ring: 0 0 0 1px rgba(245, 197, 24, 0.3), 0 8px 40px rgba(245, 197, 24, 0.12);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Decorative background ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(620px 440px at 50% -12%, rgba(245, 197, 24, 0.14), transparent 70%),
    radial-gradient(900px 640px at 90% 112%, rgba(245, 197, 24, 0.05), transparent 70%);
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 22%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 22%, #000 10%, transparent 72%);
  pointer-events: none;
}

.bg-stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255, 255, 255, 0.35), transparent 100%),
    radial-gradient(1px 1px at 70% 18%, rgba(255, 255, 255, 0.25), transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 75%, rgba(255, 255, 255, 0.2), transparent 100%),
    radial-gradient(1px 1px at 85% 60%, rgba(255, 255, 255, 0.3), transparent 100%),
    radial-gradient(1px 1px at 60% 88%, rgba(255, 255, 255, 0.18), transparent 100%);
  pointer-events: none;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(13, 13, 13, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.nav-brand-mark {
  font-size: 1.15rem;
  animation: none;
}

.nav-brand-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(245, 197, 24, 0.09);
  border: 1px solid rgba(245, 197, 24, 0.28);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Mode switch (Fun / Serious) ---------- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  gap: 2px;
}

.mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

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

.mode-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #191919;
  box-shadow: 0 2px 10px rgba(245, 197, 24, 0.3);
}

/* ---------- Serious mode: party list ---------- */
.party-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.party-row {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  animation: fade-in 0.3s ease both;
}

.party-row.removing {
  animation: fade-out 0.25s ease both;
}

.party-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.party-index {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.party-remove {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}

.party-remove:hover {
  color: var(--danger);
  background: rgba(255, 91, 107, 0.1);
}

.party-name {
  width: 100%;
  margin-bottom: 8px;
}

.party-statement {
  width: 100%;
  min-height: 72px;
}

.party-tools {
  margin-top: 14px;
}

.party-tools .ghost-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Text input (context field, party names) */
.text-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid #323232;
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 15px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.text-input:hover {
  background: var(--surface-hover);
}

.text-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.14);
}

.kicker-note {
  text-transform: none;
  letter-spacing: 0.04em;
  font-weight: 500;
  opacity: 0.75;
}

.hint-line {
  margin-top: 8px;
  display: block;
  font-weight: 400;
}

/* ---------- Small ghost button ---------- */
.ghost-btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.field-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

/* ---------- Streaming caret ---------- */
.verdict-caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: var(--gold);
  animation: caret-blink 0.8s steps(1) infinite;
}

@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---------- Layout ---------- */
.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(36px, 7vw, 72px) 20px 40px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  margin-bottom: clamp(38px, 7vw, 64px);
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(245, 197, 24, 0.3);
  border-radius: 999px;
  padding: 7px 18px;
  margin-bottom: 22px;
  background: rgba(245, 197, 24, 0.05);
}

/* Gavel that strikes on each verdict */
.hero-gavel {
  display: inline-block;
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 10px;
  transform-origin: 50% 100%;
  animation: gavel-sway 3s ease-in-out infinite;
}
.hero.strike .hero-gavel {
  animation: gavel-strike 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.title {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 11vw, 5.2rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.04;
  cursor: default;
  user-select: none;
}

.title-inner {
  background: linear-gradient(100deg, var(--gold-dark), var(--gold) 38%, #fff8dc 50%, var(--gold) 62%, var(--gold-dark));
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

.subtitle {
  margin-top: 16px;
  font-size: clamp(1.02rem, 3vw, 1.2rem);
  color: var(--text-muted);
}

.subtitle-accent {
  color: var(--gold-light);
  font-style: italic;
  font-family: "Fraunces", Georgia, serif;
}

.hero-stats {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.hero-stats b {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Sections ---------- */
.section {
  margin-bottom: clamp(40px, 7vw, 64px);
}

.section-kicker {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* ---------- Judge cards ---------- */
.judge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.judge-card {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  padding: 18px 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition),
    transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.judge-card:hover {
  border-color: rgba(245, 197, 24, 0.45);
  background: var(--card-elevated);
  transform: translateY(-2px);
}

.judge-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.35);
}

.judge-card[aria-checked="true"] {
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(245, 197, 24, 0.1), rgba(245, 197, 24, 0.02));
  box-shadow: var(--glow-ring);
}

/* Selected check badge (purely decorative) */
.judge-card[aria-checked="true"]::after {
  content: "✔";
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 0.8rem;
  color: var(--gold);
}

.judge-emoji {
  font-size: 1.7rem;
  line-height: 1.2;
}

.judge-name {
  font-weight: 600;
  font-size: 0.98rem;
  margin-top: 6px;
}

.judge-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Courtroom card ---------- */
.courtroom {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: clamp(22px, 4.5vw, 34px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.courtroom::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 24%);
}

/* ---------- Fields ---------- */
.field {
  margin-bottom: 20px;
  position: relative;
}

.field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 9px;
}

.label-hint {
  font-size: 0.7rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
}

.field-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.char-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  transition: color var(--transition);
}
.char-count.warn {
  color: var(--gold);
}
.char-count.max {
  color: var(--danger);
}

/* Textarea */
.textarea-wrap {
  position: relative;
  border-radius: var(--radius-sm);
}

.textarea-wrap::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 2px;
  opacity: 0.45;
  transition: opacity var(--transition);
}

textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  background: var(--surface);
  border: 1px solid #323232;
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 15px 17px;
  font-size: 0.97rem;
  font-family: inherit;
  line-height: 1.55;
  transition: border-color var(--transition), background var(--transition),
    box-shadow var(--transition);
}

textarea::placeholder {
  color: var(--text-dim);
}

textarea:hover {
  background: var(--surface-hover);
}

textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.14);
}
.textarea-wrap:focus-within::after {
  opacity: 1;
}

/* ---------- Submit button ---------- */
.verdict-btn {
  position: relative;
  width: 100%;
  padding: 17px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold) 55%, var(--gold-light));
  color: #191919;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform var(--transition), box-shadow var(--transition),
    filter var(--transition);
  box-shadow: 0 10px 28px rgba(245, 197, 24, 0.28);
  overflow: hidden;
}

.verdict-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 14px 36px rgba(245, 197, 24, 0.4);
}

.verdict-btn:active {
  transform: translateY(0) scale(0.985);
}

.verdict-btn:disabled {
  cursor: not-allowed;
  filter: saturate(0.7) brightness(0.8);
  transform: none;
}

/* Spinner, hidden by default */
.spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: none;
}

.spinner-ring {
  fill: none;
  stroke: rgba(0, 0, 0, 0.18);
  stroke-width: 3;
}

.spinner-dot {
  fill: none;
  stroke: #191919;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 56;
  stroke-dashoffset: 40;
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 0.8s linear infinite;
}

.verdict-btn.loading .spinner,
.verdict-btn.loading .spinner-dot {
  display: block;
}

.verdict-btn.loading .btn-text {
  visibility: hidden;
}

/* ---------- Loading status ---------- */
.loading-status {
  text-align: center;
  margin-top: 14px;
  min-height: 1.4em;
  font-size: 0.9rem;
  color: var(--gold);
  font-style: italic;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition);
}

.loading-status.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Error banner ---------- */
.error-banner {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 91, 107, 0.1);
  border: 1px solid rgba(255, 91, 107, 0.35);
  color: #ffb3ba;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fade-in 0.3s ease both;
}

.error-banner strong {
  color: var(--danger);
  font-size: 0.95rem;
}

.retry-btn {
  align-self: flex-start;
  margin-top: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.retry-btn:hover {
  background: var(--gold);
  color: #191919;
}

/* ---------- Verdict ---------- */
.verdict {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed #343434;
  animation: fade-in 0.45s ease both;
  position: relative;
}

.verdict-ribbon {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #191919;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  padding: 6px 15px;
  border-radius: 4px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(245, 197, 24, 0.25);
}

.verdict-body {
  font-size: 0.98rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

/* Light markdown-ish formatting (applied after safe HTML escaping) */
.verdict-body h1,
.verdict-body h2,
.verdict-body h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.16rem;
  color: var(--gold);
  margin: 18px 0 6px;
}
.verdict-body h1::before,
.verdict-body h2::before,
.verdict-body h3::before {
  content: "⚖ ";
  opacity: 0.85;
}
.verdict-body h2 {
  font-size: 1.05rem;
}
.verdict-body p {
  margin: 8px 0;
}
.verdict-body ul {
  margin: 8px 0 8px 24px;
}
.verdict-body strong {
  color: #fff;
}
.verdict-body blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 14px;
  color: var(--text-muted);
  font-style: italic;
  margin: 10px 0;
}
.verdict-body em {
  color: var(--gold-light);
}

.verdict-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.ghost-btn {
  padding: 10px 18px;
  border-radius: 22px;
  border: 1px solid #333;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition),
    background var(--transition);
}
.ghost-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(245, 197, 24, 0.06);
}
.ghost-btn:active {
  transform: scale(0.97);
}
.ghost-btn.copied {
  border-color: var(--success);
  color: var(--success);
}

/* ---------- History ---------- */
.history {
  margin-top: 30px;
  animation: fade-in 0.4s ease both;
  position: relative;
}

.history-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-list li {
  background: var(--elevated);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--transition), color var(--transition),
    background var(--transition);
}
.history-list li:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--surface);
}
.history-list li:active {
  transform: scale(0.99);
}

/* ---------- How it works ---------- */
.how-title {
  text-align: center;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  margin-bottom: 26px;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.how-step {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 22px 18px;
  transition: border-color var(--transition), transform var(--transition);
}

.how-step:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 197, 24, 0.4);
}

.how-num {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  opacity: 0.85;
}

.how-step h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 10px 0 6px;
}

.how-step p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 8px;
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 26px 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.footer-disclaimer b {
  color: var(--text-muted);
}

.footer-texts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-privacy {
  opacity: 0.8;
}

.footer-top {
  color: var(--gold);
  font-size: 0.82rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 197, 24, 0.35);
  transition: border-color var(--transition), color var(--transition);
}
.footer-top:hover {
  border-bottom-color: var(--gold);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(10px);
  background: var(--card-elevated);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 30px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 200;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */

@keyframes shimmer {
  to {
    background-position: -220% center;
  }
}

@keyframes gavel-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-8deg); }
}

@keyframes gavel-strike {
  0% { transform: rotate(-20deg); }
  35% { transform: rotate(35deg) translateY(8px); }
  55% { transform: rotate(-10deg) translateY(3px); }
  100% { transform: rotate(0deg); }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ---------- Shake for empty-input validation ---------- */
.shake {
  animation: shake 0.4s ease both;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ---------- Staggered load reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 560px) {
  .page {
    padding: 28px 14px 32px;
  }

  .title {
    font-size: 3rem;
  }

  .judge-grid {
    grid-template-columns: 1fr;
  }

  .how-grid {
    grid-template-columns: 1fr;
  }

  .nav-pill {
    display: none;
  }

  .courtroom {
    padding: 20px 15px;
  }

  textarea {
    min-height: 120px;
  }

  .hero-stats {
    gap: 10px;
  }

  .nav-inner {
    gap: 10px;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}