/* ============================================================
   SPLIT-SCREEN COURTROOM — Red Team Version
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  background: #111316;
  color: #c0c4c8;
  font-family: 'Newsreader', serif;
  font-size: 14px;
  line-height: 1.6;
}

::selection {
  background: rgba(139, 92, 246, 0.15);
  color: #e8e0f0;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #111316;
}
::-webkit-scrollbar-thumb {
  background: #2a2e33;
  border-radius: 3px;
}

/* --- Skip Link --- */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #8B5CF6;
  color: #000;
  padding: 4px 8px;
  z-index: 9999;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  text-decoration: none;
}

.skip-link:focus-visible {
  position: fixed;
  top: 8px;
  left: 8px;
  padding: 8px 16px;
  border-radius: 4px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* --- Court Layout --- */

.court {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

/* --- Court Header (full width) --- */

.court-header {
  padding: 32px 24px 24px;
  text-align: center;
  border-bottom: 1px solid #1e2228;
}

.court-header__title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #999;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 12px 0;
}

.court-header__name {
  font-family: 'Newsreader', serif;
  font-size: 24px;
  color: #e8e8e8;
  margin: 0 0 4px 0;
  font-weight: 600;
}

.court-header__role {
  font-size: 13px;
  color: #999;
  margin: 0;
}

.court-header__summary {
  margin-top: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #999;
  letter-spacing: 0.03em;
}

.court-header__summary a {
  color: #8B5CF6;
  text-decoration: none;
}

.court-header__summary a:hover {
  text-decoration: underline;
}

/* --- Docket Summary --- */

.docket-summary {
  padding: 20px 24px;
  border-bottom: 1px solid #1e2228;
  text-align: center;
  background: #13161a;
}

.docket-summary__stats {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #c0c4c8;
  letter-spacing: 0.03em;
  margin: 0 0 8px 0;
}

.docket-summary__verdict {
  font-family: 'Newsreader', serif;
  font-size: 14px;
  color: #a0a8b0;
  margin: 0 0 12px 0;
}

.docket-summary__links {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.docket-summary__links a {
  color: #8B5CF6;
  text-decoration: none;
  margin: 0 8px;
}

.docket-summary__links a:hover {
  text-decoration: underline;
}

/* --- Court Grid (main content area) --- */

.court-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
}

/* --- Trial Row --- */

.trial-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
}

/* --- Defense Column (visually right, DOM first) --- */

.trial-row .defense {
  grid-column: 3;
  grid-row: 1;
  padding: 24px 20px;
  background: #13161a;
  border-left: 1px solid #1e2228;
}

/* --- Center Gutter --- */

.trial-row .gutter {
  grid-column: 2;
  grid-row: 1;
  background: #0e1014;
  border-left: 1px solid #1e2228;
  border-right: 1px solid #1e2228;
  position: relative;
}

/* --- Prosecution Column (visually left, DOM last) --- */

.trial-row .prosecution {
  grid-column: 1;
  grid-row: 1;
  padding: 24px 20px;
  background: #1A1D23;
}

/* --- Gutter Tick --- */

.gutter__tick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: #888;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #1a1e22;
  min-height: 48px;
}

.gutter__tick-num {
  color: #aaa;
  font-weight: 700;
}

.gutter__tick-status {
  margin-top: 2px;
  font-size: 8px;
}

.gutter__tick-status--alive { color: #5FA37A; }
.gutter__tick-status--dead { color: #B84A4A; }
.gutter__tick-status--attack { color: #D6A84F; }
.gutter__tick-status--paper { color: #AEB7BA; }
.gutter__tick-status--system { color: #7E8FA8; }
.gutter__tick-status--ghost { color: #9A8BB3; }

/* --- Mobile Claim Badge (hidden on desktop) --- */

.trial-row__mobile-badge {
  display: none;
}

/* --- Cards (shared base) --- */

.card {
  padding: 20px 0;
  border-bottom: 1px solid #1e2228;
}

/* --- Defense Card Styling --- */

.card--defense {
  font-family: 'Newsreader', serif;
}

.card--defense .card__label {
  font-family: 'Newsreader', serif;
  font-size: 10px;
  font-weight: 600;
  color: #5FA37A;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card--defense .card__title {
  font-family: 'Newsreader', serif;
  font-size: 16px;
  font-weight: 600;
  color: #e8e8e8;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.card--defense .card__body {
  font-size: 14px;
  color: #a0a4a8;
  margin: 0 0 8px 0;
  line-height: 1.6;
}

.card--defense .card__evidence {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #999;
  margin: 8px 0 0 0;
}

.card--defense a {
  color: #8B5CF6;
  text-decoration: none;
}

.card--defense a:hover {
  text-decoration: underline;
}

/* --- Prosecution Card Styling --- */

.card--prosecution {
  font-family: 'JetBrains Mono', monospace;
}

.card--prosecution .card__label {
  font-size: 10px;
  font-weight: 700;
  color: #B84A4A;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card--prosecution .card__title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #e0e0e0;
  margin: 0 0 8px 0;
}

.card--prosecution .card__body {
  font-size: 12px;
  color: #aaa;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.card--prosecution .card__residual {
  font-size: 11px;
  color: #D6A84F;
  margin: 8px 0 0 0;
  padding: 6px 8px;
  border-left: 2px solid #D6A84F;
  background: rgba(214, 168, 79, 0.05);
}

/* --- Verdict Controls --- */

.verdict-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.verdict-btn {
  padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid #2a2e33;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: border-color 150ms, color 150ms, background 150ms;
}

@media (max-width: 700px) {
  .verdict-btn {
    padding: 14px 20px;
    font-size: 11px;
    min-height: 48px;
  }
}

.verdict-btn:focus-visible {
  outline: 2px solid #8B5CF6;
  outline-offset: 2px;
}

.verdict-btn--sustain {
  color: #5FA37A;
}
.verdict-btn--sustain:hover,
.verdict-btn--sustain.is-active {
  border-color: #5FA37A;
  background: rgba(95, 163, 122, 0.1);
}

.verdict-btn--object {
  color: #B84A4A;
}
.verdict-btn--object:hover,
.verdict-btn--object.is-active {
  border-color: #B84A4A;
  background: rgba(184, 74, 74, 0.1);
}

.verdict-btn--hung {
  color: #999;
}
.verdict-btn--hung:hover,
.verdict-btn--hung.is-active {
  border-color: #999;
  background: rgba(153, 153, 153, 0.1);
}

/* --- Verdict Stamp Overlay --- */

.verdict-stamp {
  display: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  margin-top: 8px;
  transform: rotate(-2deg);
}

.verdict-stamp.is-visible {
  display: inline-block;
}

.verdict-stamp--sustained {
  color: #5FA37A;
  border: 2px solid #5FA37A;
  background: rgba(95, 163, 122, 0.08);
}

.verdict-stamp--overruled {
  color: #B84A4A;
  border: 2px solid #B84A4A;
  background: rgba(184, 74, 74, 0.08);
}

.verdict-stamp--hung {
  color: #999;
  border: 2px solid #666;
  background: rgba(153, 153, 153, 0.08);
}

/* --- Court Footer --- */

.court-footer {
  padding: 24px;
  text-align: center;
  border-top: 1px solid #1e2228;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #888;
  letter-spacing: 0.05em;
}

.court-footer a {
  color: #8B5CF6;
  text-decoration: none;
}

.court-footer a:hover {
  text-decoration: underline;
}

.court-footer__jury {
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid #1e2228;
  border-radius: 2px;
  display: inline-block;
}

/* --- Focus Visible --- */

a:focus-visible {
  outline: 2px solid #8B5CF6;
  outline-offset: 2px;
}

/* --- Screen Reader --- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Responsive: Tablet --- */

@media (max-width: 1024px) {
  .court-grid {
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  }

  .trial-row .defense,
  .trial-row .prosecution {
    padding: 16px 14px;
  }
}

/* --- Responsive: Mobile (stacked) --- */

@media (max-width: 700px) {
  .court-grid {
    display: block;
  }

  .trial-row {
    display: block;
    border-bottom: 1px solid #1e2228;
    padding-bottom: 16px;
    margin-bottom: 16px;
  }

  .trial-row .gutter {
    display: none;
  }

  .trial-row .defense,
  .trial-row .prosecution {
    padding: 16px;
    border-left: none;
  }

  .trial-row__mobile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #aaa;
    border-bottom: 1px solid #1e2228;
    background: #0e1014;
  }

  .trial-row__mobile-badge .badge-status {
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 8px;
    text-transform: uppercase;
  }

  .badge-status--alive { color: #5FA37A; border: 1px solid #5FA37A; }
  .badge-status--dead { color: #B84A4A; border: 1px solid #B84A4A; }
  .badge-status--attack { color: #D6A84F; border: 1px solid #D6A84F; }
  .badge-status--system { color: #7E8FA8; border: 1px solid #7E8FA8; }
  .badge-status--ghost { color: #9A8BB3; border: 1px solid #9A8BB3; }

  .card {
    border-bottom: none;
    padding: 12px 0;
  }

  .card--prosecution {
    border-top: 1px dashed #2a2e33;
    padding-top: 12px;
    margin-top: 8px;
  }

  .card--defense .card__title {
    font-size: 15px;
  }

  .verdict-controls {
    flex-direction: column;
  }

  .verdict-btn {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* --- Reduced Motion --- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* --- Print --- */

@media print {
  body {
    background: #fff;
    color: #111;
    font-size: 11pt;
  }

  .court-grid {
    display: block;
  }

  .trial-row {
    display: block;
    break-inside: avoid;
    border-bottom: 1px solid #ccc;
    padding: 12pt 0;
    margin-bottom: 12pt;
  }

  .trial-row .gutter {
    display: none;
  }

  .trial-row .defense,
  .trial-row .prosecution {
    background: none;
    border: none;
    padding: 8pt 0;
  }

  .trial-row__mobile-badge {
    display: block;
    color: #333;
    font-weight: bold;
    padding: 4pt 0;
  }

  .court-header,
  .docket-summary,
  .court-footer {
    break-inside: avoid;
    background: none;
    border-color: #ccc;
  }

  .verdict-controls {
    display: none;
  }

  .verdict-stamp {
    border-color: #333 !important;
    color: #333 !important;
    background: none !important;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 9pt;
    color: #555;
  }

  a[href^="#"]::after,
  a[href^="mailto:"]::after {
    content: '';
  }

  .card--defense .card__label { color: #2a7a4a; }
  .card--prosecution .card__label { color: #a03030; }
  .card--prosecution .card__residual {
    border-left-color: #a07020;
    color: #6a4a10;
    background: none;
  }

  .skip-link { display: none; }
}
