/* The Jurisprudential Joust — courtroom dark */

:root {
  --bg:           #14110e;
  --bg-raised:    #1d1915;
  --bg-inset:     #0e0c0a;
  --ink:          #e8e0d2;
  --ink-muted:    #9b9082;
  --brass:        #c9a84c;
  --brass-dim:    rgba(201, 168, 76, 0.35);
  --oxblood:      #7e2f2f;
  --oxblood-soft: #a14444;
  --verdigris:    #5e8c7a;
  --border:       #322b23;
  --serif:        'Cormorant Garamond', Georgia, serif;
  --mono:         'IBM Plex Mono', monospace;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.6;
  min-height: 100vh;
}

.mono { font-family: var(--mono); }

/* Masthead */
.masthead {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #181410 0%, var(--bg) 100%);
  padding: 3rem 1.5rem 2.2rem;
  text-align: center;
}
.masthead-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.8rem;
}
.masthead-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.masthead-tagline {
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 0.5rem;
  font-size: 1.05rem;
}

/* Layout */
.arena { max-width: 760px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* Tier selector */
.tier-select { display: flex; gap: 0.6rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.tier-btn {
  flex: 1 1 0;
  min-width: 150px;
  background: var(--bg-raised);
  color: var(--ink-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: center;
}
.tier-btn .tier-sub { font-size: 0.62rem; font-weight: 400; letter-spacing: 0.05em; opacity: 0.7; }
.tier-btn:hover { border-color: var(--brass-dim); color: var(--ink); }
.tier-btn.is-active { border-color: var(--brass); color: var(--brass); }

/* Pattern card */
.pattern-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.6rem 1.7rem;
  margin-bottom: 1.6rem;
}
.pattern-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brass);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.pattern-facts { white-space: pre-wrap; }
.pattern-constraint {
  margin-top: 1.1rem;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--oxblood-soft);
  background: var(--bg-inset);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--ink);
}
.pattern-constraint::before {
  content: 'THE CONSTRAINT';
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--oxblood-soft);
  margin-bottom: 0.4rem;
}

/* Entry zone */
.entry-zone { display: flex; flex-direction: column; gap: 0.55rem; }
.entry-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  margin-top: 0.4rem;
}
textarea {
  width: 100%;
  background: var(--bg-inset);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.5;
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--brass-dim); }
.entry-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--ink-muted);
}
.entry-meta .over-cap { color: var(--oxblood-soft); font-weight: 600; }

.btn-submit {
  margin-top: 0.8rem;
  background: var(--oxblood);
  color: var(--ink);
  border: none;
  border-radius: 8px;
  padding: 0.9rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-submit:hover { background: var(--oxblood-soft); }
.btn-submit:disabled { opacity: 0.5; cursor: wait; }

/* Feedback */
.feedback { margin-top: 2rem; display: none; }
.feedback.visible { display: block; }

.verdict {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  text-align: center;
}
.verdict--granted  { background: rgba(94, 140, 122, 0.12); border: 1px solid var(--verdigris); color: var(--verdigris); }
.verdict--advised  { background: rgba(201, 168, 76, 0.08); border: 1px solid var(--brass-dim); color: var(--brass); }
.verdict--overruled{ background: rgba(126, 47, 47, 0.12);  border: 1px solid var(--oxblood-soft); color: var(--oxblood-soft); }

.doctrine-flag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--oxblood-soft);
  border: 1px solid rgba(161, 68, 68, 0.4);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  background: rgba(126, 47, 47, 0.07);
}

.rubric { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.4rem; }
.rubric-row { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem 1rem; }
.rubric-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; margin-bottom: 0.45rem; }
.rubric-score { color: var(--brass); font-weight: 600; }
.rubric-bar-track { height: 4px; background: var(--bg-inset); border-radius: 2px; overflow: hidden; margin-bottom: 0.5rem; }
.rubric-bar { height: 100%; background: var(--brass); border-radius: 2px; width: 0; transition: width 0.7s ease; }
.rubric-feedback { font-size: 0.95rem; color: var(--ink-muted); font-style: italic; }

.bench-explanation { font-style: italic; margin-bottom: 1.2rem; }

.canonical-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.4rem;
  background: var(--bg-raised);
}
.canonical-details summary {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  cursor: pointer;
}
.canonical-entry { margin-top: 0.8rem; font-weight: 600; }
.canonical-commentary { margin-top: 0.6rem; color: var(--ink-muted); font-size: 1rem; }

.btn-next {
  background: none;
  border: 1px solid var(--brass-dim);
  color: var(--brass);
  border-radius: 8px;
  padding: 0.8rem 1.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-next:hover { background: var(--brass); color: var(--bg); }

.feedback-error {
  color: var(--oxblood-soft);
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* Colophon */
.colophon {
  border-top: 1px solid var(--border);
  padding: 1.6rem 1.25rem 2.4rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
