:root {
  --bg-1: #fff8ee;
  --bg-2: #ffd8af;
  --ink: #241710;
  --muted: #6a4b3d;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(101, 53, 32, 0.18);
  --accent: #b44a22;
  --accent-2: #8f3617;
  --guilty: #a62817;
  --innocent: #1f7446;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  line-height: 1.5;
  background: radial-gradient(circle at 10% 0, #ffe9cd 0, transparent 40%),
    linear-gradient(155deg, var(--bg-1), var(--bg-2));
}

a {
  color: #7c2f14;
}

.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 20px 32px;
  display: grid;
  gap: 16px;
}

.narrow {
  max-width: 560px;
}

.hero,
.panel,
.trial-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(62, 24, 10, 0.12);
}

.hero,
.panel {
  padding: 16px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4.4vw, 2.7rem);
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.flash {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
}

.flash.success {
  background: #e6f9eb;
  color: #1a6635;
}

.flash.error {
  background: #ffe8e8;
  color: #7a1f1f;
}

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

.section-head h2 {
  margin: 0;
}

.count-pill {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff5ea;
  color: #8a3618;
  border: 1px solid rgba(147, 63, 30, 0.2);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0 8px;
}

.list-panel {
  display: grid;
  gap: 10px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.trial-card {
  text-decoration: none;
  color: inherit;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 188px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.trial-card:hover {
  transform: translateY(-2px);
  border-color: rgba(178, 74, 34, 0.45);
  box-shadow: 0 16px 28px rgba(62, 24, 10, 0.18);
}

.trial-card h2 {
  margin: 0;
  font-size: 1.12rem;
}

.summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.stats {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
}

.closed-verdict {
  margin: auto 0 0;
  width: 100%;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed rgba(109, 53, 26, 0.3);
  background: rgba(255, 255, 255, 0.65);
  padding: 14px 12px;
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}

.closed-verdict.guilty {
  color: var(--guilty);
}

.closed-verdict.innocent {
  color: var(--innocent);
}

.closed-verdict.tie {
  color: #705143;
}

.empty-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.suggest-btn,
button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.14s ease;
}

.suggest-btn {
  justify-self: start;
}

button:hover,
.suggest-btn:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.submit-form,
.admin-form,
.inline-form {
  display: grid;
  gap: 10px;
}

.submit-form {
  grid-template-columns: 1fr;
}

.submit-form .full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 5px;
  font-size: 0.9rem;
  font-weight: 600;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.duel {
  display: grid;
  gap: 14px;
}

.cat {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.stream-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.stream-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.prison-bars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: repeating-linear-gradient(
    90deg,
    rgba(12, 12, 12, 0.56) 0,
    rgba(12, 12, 12, 0.56) 9px,
    rgba(12, 12, 12, 0.15) 9px,
    rgba(12, 12, 12, 0.15) 38px
  );
}

.stream-card.is-jailed .prison-bars {
  opacity: 1;
}

.vote-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.vote-form .flash {
  margin: 0;
}

.vote-bars {
  display: grid;
  gap: 6px;
}

.vote-bars p {
  margin: 0;
}

.closure-panel {
  display: grid;
  gap: 10px;
}

.closure-note {
  margin: 0;
  font-weight: 700;
  color: #5f2515;
}

.closure-shot-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.closure-shot {
  width: 100%;
  display: block;
  max-height: 420px;
  object-fit: cover;
}

.bar-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: #ead3bc;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.2s ease;
}

.bar-fill.guilty {
  background: linear-gradient(90deg, #cf5a38, #a1331c);
}

.bar-fill.innocent {
  background: linear-gradient(90deg, #7fbe8a, #3d9256);
}

.doc {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.doc summary {
  cursor: pointer;
  font-weight: 800;
}

.submission {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.75);
}

.admin-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.admin-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.admin-item-title,
.admin-item-meta {
  margin: 0 0 6px;
}

.admin-item-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.footer {
  text-align: center;
  color: #6b4535;
  font-weight: 700;
  font-size: 0.86rem;
}

.hidden {
  display: none;
}

@media (min-width: 900px) {
  .submit-form {
    grid-template-columns: 1fr 1fr;
  }

  .duel {
    grid-template-columns: 1fr 1.2fr;
  }

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