/* ================================================================
   Bayesian Courtroom — Mobile-First Styles
   ================================================================ */

:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --surface-2: #222240;
  --border: #2a2a4a;
  --text: #e8e8f0;
  --text-muted: #9090b0;
  --accent: #6c63ff;
  --accent-light: #8b83ff;
  --guilty: #e74c3c;
  --guilty-soft: #ff6b6b;
  --innocent: #2ecc71;
  --innocent-soft: #69db7c;
  --warning: #f39c12;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
}

/* ----------------------------------------------------------------
   Screens & Transitions
   ---------------------------------------------------------------- */
.screen {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0;
  min-height: 100dvh;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.screen.active {
  display: block;
  position: relative;
  opacity: 1;
  transform: translateX(0);
}

.screen.slide-out-left {
  opacity: 0;
  transform: translateX(-30px);
}

.screen.slide-in-right {
  opacity: 0;
  transform: translateX(30px);
}

.screen-content {
  padding: 20px 16px 40px;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.screen-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  flex: 1;
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  padding: 14px 28px;
}
.btn-primary:hover { background: var(--accent-light); }

.btn-lg {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  margin-top: 20px;
}

.btn-back {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* ----------------------------------------------------------------
   Welcome Screen
   ---------------------------------------------------------------- */
.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  text-align: center;
  padding-top: 60px;
}

.logo-area {
  margin-bottom: 40px;
}

.gavel-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  opacity: 0.9;
}

.logo-area h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 12px;
  line-height: 1.5;
}

.how-to-play {
  width: 100%;
  margin-top: 24px;
  text-align: left;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.how-to-play summary {
  padding: 14px 16px;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent-light);
  list-style: none;
}

.how-to-play summary::before { content: "▸ "; }
.how-to-play[open] summary::before { content: "▾ "; }

.how-to-content {
  padding: 0 16px 16px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.how-to-content p { margin-bottom: 10px; }
.how-to-content ul { padding-left: 20px; margin-bottom: 10px; }
.how-to-content li { margin-bottom: 6px; }

/* ----------------------------------------------------------------
   Case Selection
   ---------------------------------------------------------------- */
.case-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.case-card:active { transform: scale(0.98); }
.case-card:hover { border-color: var(--accent); }

.case-card-img {
  width: 100%;
  height: 120px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-muted);
  overflow: hidden;
}

.case-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-card-body {
  padding: 14px 16px;
}

.case-card-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.case-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-beginner { background: #1a4d2e; color: #69db7c; }
.badge-intermediate { background: #4a3800; color: #ffd43b; }
.badge-advanced { background: #4a1520; color: #ff8787; }

.case-card-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ----------------------------------------------------------------
   Set Your Standard
   ---------------------------------------------------------------- */
.guidance-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 20px;
}

.threshold-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.threshold-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.threshold-btn.selected {
  border-color: var(--accent);
  background: var(--surface-2);
}

.threshold-pct {
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 60px;
  color: var(--accent-light);
}

.threshold-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.threshold-result {
  text-align: center;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.input-method-toggle {
  margin-bottom: 10px;
}

.input-method-toggle label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.toggle-group {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.toggle-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-family: var(--font);
}

.toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ----------------------------------------------------------------
   Case Presentation
   ---------------------------------------------------------------- */
.case-image-container {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  max-height: 200px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-setting {
  font-size: 0.85rem;
  color: var(--accent-light);
  margin-bottom: 16px;
  font-weight: 500;
}

.case-narrative {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 16px;
}

.case-details { color: var(--text-muted); }

.prior-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.prior-section h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--accent-light);
}

.prior-info {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.context-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.context-section h4 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--warning);
}

.context-section p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ----------------------------------------------------------------
   Evidence Preview
   ---------------------------------------------------------------- */
.evidence-count {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.evidence-preview-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.evidence-preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.evidence-preview-card .ev-number {
  font-size: 0.75rem;
  color: var(--accent-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.evidence-preview-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.evidence-preview-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ----------------------------------------------------------------
   Evidence Evaluation
   ---------------------------------------------------------------- */
.progress-bar-container {
  position: relative;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-label {
  position: absolute;
  right: 0;
  top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.evidence-description {
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 20px;
  color: var(--text);
}

/* Probability meter */
.probability-meter-section {
  margin-bottom: 20px;
}

.meter-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.probability-meter {
  position: relative;
  height: 28px;
  background: linear-gradient(to right, var(--innocent), #ffd43b, var(--guilty));
  border-radius: 14px;
  overflow: visible;
  border: 2px solid var(--border);
}

.meter-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  border-radius: 12px 0 0 12px;
  background: rgba(255,255,255,0.15);
  transition: width 0.6s ease;
}

.meter-threshold {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255,255,255,0.5);
  transition: left 0.3s ease;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 2px;
}

/* Input section */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.input-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.guidance-prompt {
  display: block;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 14px;
  color: var(--text);
  font-weight: 500;
}

/* Slider styling */
.evidence-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  outline: none;
}

.evidence-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--accent-light);
  box-shadow: 0 2px 8px rgba(108, 99, 255, 0.4);
}

.evidence-slider::-moz-range-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--accent-light);
}

.slider-value {
  text-align: center;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.slider-value span:first-child {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

/* Direct input */
.number-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.num-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.number-input-wrapper input[type="number"] {
  flex: 1;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  -moz-appearance: textfield;
}

.number-input-wrapper input::-webkit-inner-spin-button,
.number-input-wrapper input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* Live calculation */
.live-calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.88rem;
}

.calc-row span { color: var(--text-muted); }

.db-positive { color: var(--guilty-soft); }
.db-negative { color: var(--innocent-soft); }
.db-neutral { color: var(--text-muted); }

/* ----------------------------------------------------------------
   Verdict Screen
   ---------------------------------------------------------------- */
.evidence-summary-table {
  margin-bottom: 24px;
}

.ev-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.ev-summary-row .ev-name { flex: 1; margin-right: 12px; }

.ev-db-positive { color: var(--guilty-soft); font-weight: 700; }
.ev-db-negative { color: var(--innocent-soft); font-weight: 700; }

.final-meter {
  margin-bottom: 24px;
}

.verdict-announcement {
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.verdict-guilty {
  background: linear-gradient(135deg, #4a1520, #6b1d2d);
  border: 2px solid var(--guilty);
}

.verdict-guilty h2 {
  font-size: 2rem;
  color: var(--guilty-soft);
  margin-bottom: 8px;
}

.verdict-not-guilty {
  background: linear-gradient(135deg, #1a3d2e, #1a4d3e);
  border: 2px solid var(--innocent);
}

.verdict-not-guilty h2 {
  font-size: 2rem;
  color: var(--innocent-soft);
  margin-bottom: 8px;
}

.verdict-announcement p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.reference-comparison {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.reference-comparison h3 {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--accent-light);
}

.ref-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.ref-row:last-child { border-bottom: none; }

.detailed-results {
  width: 100%;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.detailed-results summary {
  padding: 14px 16px;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent-light);
}

.detailed-results pre {
  padding: 12px 16px;
  font-size: 0.75rem;
  overflow-x: auto;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ----------------------------------------------------------------
   Loading & Utility
   ---------------------------------------------------------------- */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.hidden { display: none !important; }

/* ----------------------------------------------------------------
   Join Section (Welcome Screen)
   ---------------------------------------------------------------- */
.join-section {
  width: 100%;
  margin-top: 8px;
}

.join-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.join-divider::before,
.join-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 1rem;
  padding: 14px 28px;
}
.btn-secondary:hover { background: var(--surface); border-color: var(--accent); }

.btn-accent {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
  font-size: 1rem;
  padding: 14px 28px;
}
.btn-accent:hover { background: linear-gradient(135deg, #27ae60, #229954); }

.join-input-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.join-code-field {
  width: 100%;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 8px;
  padding: 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  text-transform: uppercase;
}

.join-code-field:focus {
  outline: none;
  border-color: var(--accent);
}

.join-name-field {
  width: 100%;
  font-size: 1rem;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
}

.join-name-field:focus {
  outline: none;
  border-color: var(--accent);
}

.host-name-input {
  margin-bottom: 16px;
}

/* Join flow threshold selection */
.join-threshold-section {
  width: 100%;
}

.join-threshold-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.join-threshold-options {
  display: flex;
  gap: 4px;
}

.join-threshold-btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  justify-content: center;
}

.join-threshold-db-display {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
  margin-bottom: 0;
}

.host-name-input label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.start-mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* ----------------------------------------------------------------
   Lobby Screen
   ---------------------------------------------------------------- */
.lobby-room-code {
  text-align: center;
  margin-bottom: 24px;
}

.lobby-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.room-code-display {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 40px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.room-code-display:active { background: var(--surface-2); }

.room-code-display.copied { border-color: var(--innocent); }

#room-code-text {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 12px;
  color: var(--accent-light);
}

.copy-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.lobby-player-section {
  margin-bottom: 24px;
}

.lobby-player-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}

.lobby-player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lobby-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.lobby-player.you {
  border-color: var(--accent);
  background: var(--surface-2);
}

.lobby-player-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.lobby-player-status {
  font-size: 0.78rem;
  font-weight: 600;
}

.lobby-player-status.connected { color: var(--innocent-soft); }
.lobby-player-status.disconnected { color: var(--guilty-soft); }

.waiting-for-host {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 16px;
  animation: pulse-text 2s infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ----------------------------------------------------------------
   Waiting Overlay
   ---------------------------------------------------------------- */
.waiting-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 15, 26, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.waiting-content {
  text-align: center;
  padding: 32px;
}

.waiting-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

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

.waiting-content p {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.waiting-progress {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------
   Player Sidebar
   ---------------------------------------------------------------- */
.player-sidebar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
}

.sidebar-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 501;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

.sidebar-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: var(--guilty);
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.sidebar-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 16px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 50vh;
  overflow-y: auto;
  z-index: 499;
}

.sidebar-panel.open {
  transform: translateY(0);
}

.sidebar-panel h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--accent-light);
}

.sidebar-player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.sidebar-player.you { border-left: 3px solid var(--accent); }
.sidebar-player.disconnected { opacity: 0.5; }

.sp-name { font-weight: 600; }
.sp-status { color: var(--text-muted); font-size: 0.78rem; }

/* ----------------------------------------------------------------
   Host Controls
   ---------------------------------------------------------------- */
.host-waiting-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 16px;
  margin-top: 20px;
  animation: pulse-text 2s infinite;
}

/* ----------------------------------------------------------------
   Jury Panel Results (Verdict)
   ---------------------------------------------------------------- */
.jury-panel-results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.jury-panel-results h3 {
  font-size: 0.95rem;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.jury-table-container {
  overflow-x: auto;
  margin-bottom: 12px;
}

.jury-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.jury-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jury-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.jury-row-you {
  background: var(--surface-2);
}

.jv-guilty { color: var(--guilty-soft); font-weight: 700; }
.jv-not-guilty { color: var(--innocent-soft); font-weight: 700; }

.group-verdict-banner {
  text-align: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.gv-guilty {
  background: linear-gradient(135deg, #4a1520, #6b1d2d);
  border: 1px solid var(--guilty);
  color: var(--guilty-soft);
}

.gv-not-guilty {
  background: linear-gradient(135deg, #1a3d2e, #1a4d3e);
  border: 1px solid var(--innocent);
  color: var(--innocent-soft);
}

/* ----------------------------------------------------------------
   Responsive — Tablet+
   ---------------------------------------------------------------- */
@media (min-width: 768px) {
  #app {
    max-width: 720px;
  }

  .case-card-img { height: 160px; }
  .screen-content { padding: 24px 20px 48px; }

  /* Sidebar becomes a side panel on tablet */
  .sidebar-toggle {
    bottom: auto;
    top: 16px;
    right: 16px;
  }

  .sidebar-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 240px;
    max-height: 100vh;
    border-radius: 0;
    border-top: none;
    border-left: 1px solid var(--border);
    transform: translateX(100%);
  }

  .sidebar-panel.open {
    transform: translateX(0);
  }

  .sidebar-panel h3 {
    margin-top: 48px;
  }
}
