/* ==========================================================================
   Tennis Court Motion Lighting Simulation — Natural Architectural Design
   Clean athletic palette, authentic court textures, emoji-free UI
   Features: Full Light & Dark Theme Support
   ========================================================================== */

:root {
  /* Default Dark Theme Variables */
  --bg-base: #0b0f17;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-header: rgba(11, 15, 23, 0.95);
  --bg-input: #0f172a;
  --bg-input-border: #334155;
  --bg-item-card: rgba(15, 23, 42, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-focus: #38bdf8;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-clock: #f8fafc;

  /* Natural Tennis Court Tones */
  --court-outer: #1b382b; /* Authentic forest green asphalt runoff */
  --court-outer-border: #142a20;
  --court-inner: #1e3a8a; /* Deep tournament hardcourt blue */
  --court-lines: #ffffff;
  --tennis-ball-natural: #d4e157; /* Optic yellow felt */

  /* Functional Status & Warning */
  --status-active: #22c55e;
  --status-active-bg: rgba(34, 197, 94, 0.12);
  --status-warning: #f59e0b; /* Vibrant architectural amber/orange */
  --status-warning-bg: rgba(245, 158, 11, 0.15);
  --status-warning-glow: rgba(245, 158, 11, 0.35);
  --status-off: #64748b;
  --status-off-bg: rgba(100, 116, 139, 0.14);
  --accent-blue: #38bdf8;

  /* Curfew & Auto-Off Red Accents */
  --curfew-red: #ef4444;
  --curfew-red-bg: rgba(239, 68, 68, 0.12);
  --curfew-red-border: #ef4444;
  --curfew-red-glow: rgba(239, 68, 68, 0.35);

  /* Natural Floodlight Luminescence */
  --light-beam-color: rgba(255, 250, 235, 0.35);

  /* Typography */
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows & Radius */
  --shadow-court: 0 16px 36px -6px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Transitions */
  --trans-fast: 0.15s ease;
  --trans-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Light Theme Override Variables
   ========================================================================== */
body.theme-light {
  --bg-base: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-input: #f8fafc;
  --bg-input-border: #cbd5e1;
  --bg-item-card: #f8fafc;
  --border-subtle: #e2e8f0;
  --border-focus: #0284c7;

  /* Text Colors */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-clock: #0f172a;

  /* Shadow & Glow Adjustments for Light Mode */
  --shadow-court: 0 12px 30px -4px rgba(0, 0, 0, 0.15);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.05);

  /* Curfew Red in Light Mode */
  --curfew-red: #dc2626;
  --curfew-red-bg: rgba(220, 38, 38, 0.09);
  --curfew-red-border: #dc2626;
  --curfew-red-glow: rgba(220, 38, 38, 0.25);

  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(2, 132, 199, 0.06) 0%, transparent 70%);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.45;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(30, 58, 138, 0.1) 0%, transparent 70%);
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.facility-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.facility-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--tennis-ball-natural);
  background: transparent;
}

.app-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.app-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.icon-btn:hover {
  background: var(--bg-item-card);
  color: var(--text-main);
  border-color: var(--border-focus);
}

/* ==========================================================================
   Main Layout Container
   ========================================================================== */
.app-main-layout {
  padding: 1rem 1.75rem 1.5rem;
  max-width: 1540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ==========================================================================
   Top Configuration Bar
   ========================================================================== */
.config-bar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 1.25rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  align-items: center;
  box-shadow: var(--shadow-card);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.config-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.config-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.input-with-hint {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.input-desc {
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* Time Input */
.time-input {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  outline: none;
  transition: border-color var(--trans-fast);
}

.time-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
  opacity: 0.85;
}

body.theme-light .time-input::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.7;
}

/* Auto-Off & Curfew Red Styling */
.label-curfew-red {
  color: var(--curfew-red) !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.label-curfew-red::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--curfew-red);
  box-shadow: 0 0 6px var(--curfew-red-glow);
}

.time-input.curfew-highlight {
  border: 1px solid var(--curfew-red) !important;
  outline: none !important;
  color: #ffffff !important; /* White in dark mode */
  background: var(--curfew-red-bg) !important;
  box-shadow: 0 0 4px var(--curfew-red-glow);
}

body.theme-light .time-input.curfew-highlight {
  color: #0f172a !important;
}

.time-input.curfew-highlight:focus {
  border-color: var(--curfew-red) !important;
  outline: none !important;
  box-shadow: 0 0 8px var(--curfew-red-glow);
}

/* Number Input */
.number-input-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.45rem;
}

.num-input {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  width: 44px;
  background: transparent;
  border: none;
  color: var(--text-main);
  text-align: center;
  outline: none;
}

.unit-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Time Scrubber */
.time-scrubber-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.scrubber-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.digital-clock {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff !important;
}

body.theme-light .digital-clock {
  color: #0f172a !important;
}

/* Slider Track Wrapper with Dynamic Curfew Marker */
.slider-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.custom-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input-border);
  outline: none;
  cursor: pointer;
  z-index: 1;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid var(--accent-blue);
  cursor: grab;
  transition: transform 0.1s ease;
  z-index: 3;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.custom-range::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}

/* Dynamic Curfew Marker on Slider Track - Outlined in Red */
.curfew-track-marker {
  position: absolute;
  top: -2px;
  left: 83.33%;
  width: 2.5px;
  height: 10px;
  border-radius: 1px;
  background: var(--curfew-red);
  outline: none;
  box-shadow: 0 0 5px var(--curfew-red-glow);
  pointer-events: none;
  z-index: 2;
  transition: left 0.15s ease;
  transform: translateX(-50%);
}

/* Relative Day Bar Tickers (12 PM left, 6 PM middle, 12 AM right, Curfew relative) */
.slider-ticks {
  position: relative;
  width: 100%;
  height: 22px;
  margin-top: 4px;
}

.tick-mark {
  position: absolute;
  top: 0;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: color var(--trans-fast);
}

.tick-mark:hover {
  color: var(--text-main);
}

.tick-start {
  left: 0;
  transform: translateX(0);
}

.tick-mid {
  left: 50%;
  transform: translateX(-50%);
}

.tick-end {
  left: 100%;
  transform: translateX(-100%);
}

/* Curfew Ticker on Scrubber - Outlined in Red */
.tick-curfew {
  color: var(--curfew-red) !important;
  font-weight: 700 !important;
  padding: 0.08rem 0.38rem;
  border-radius: 4px;
  background: var(--curfew-red-bg);
  border: 1px solid var(--curfew-red) !important;
  outline: none !important;
  box-shadow: 0 0 5px var(--curfew-red-glow);
  transform: translateX(-50%);
  z-index: 5;
  transition: left 0.15s ease, background var(--trans-fast);
}

.tick-curfew:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #f87171 !important;
  outline: none !important;
  color: #fff !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Status Pill */
.status-group {
  min-width: 175px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--status-active-bg);
  color: var(--status-active);
  border: 1px solid rgba(34, 197, 94, 0.3);
  transition: all var(--trans-fast);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-active);
}

.status-pill[data-state="dim"] {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border-color: rgba(245, 158, 11, 0.45);
}
.status-pill[data-state="dim"] .status-dot {
  background-color: var(--status-warning);
}

.status-pill[data-state="off"] {
  background: var(--status-off-bg);
  color: var(--status-off);
  border-color: rgba(100, 116, 139, 0.25);
}
.status-pill[data-state="off"] .status-dot {
  background-color: var(--status-off);
}

.status-subtext {
  font-size: 0.66rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

/* ==========================================================================
   Center Workspace Grid
   ========================================================================== */
.court-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.15rem;
  align-items: start;
}

/* Court Card */
.court-view-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-main);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-active);
}

/* On-Court Live Timer */
.court-live-timer {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-blue);
  transition: all var(--trans-fast);
}

.court-live-timer.dim-active {
  background: var(--status-warning-bg);
  border-color: var(--status-warning);
  color: var(--status-warning);
}

.header-action-hints {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Court Arena */
.court-arena {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #070c14;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-court);
}

/* Darkness Layer (Master ambient illumination shader) */
.darkness-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background: rgba(2, 6, 23, 0.05);
  transition: background 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Floodlight Beams Layer */
.floodlight-beams {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.6s ease;
}

.stanchion {
  position: absolute;
  width: 12px;
  height: 12px;
}

.stanchion-tl { top: 12px; left: 14px; }
.stanchion-tr { top: 12px; right: 14px; }
.stanchion-bl { bottom: 12px; left: 14px; }
.stanchion-br { bottom: 12px; right: 14px; }

.stanchion-bulb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1.5px solid #1e293b;
}

.light-cone {
  position: absolute;
  width: 520px;
  height: 380px;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.cone-tl {
  top: 0; left: 0;
  background: radial-gradient(circle at 0% 0%, var(--light-beam-color) 0%, rgba(255, 250, 235, 0.08) 50%, transparent 80%);
}
.cone-tr {
  top: 0; right: 0;
  background: radial-gradient(circle at 100% 0%, var(--light-beam-color) 0%, rgba(255, 250, 235, 0.08) 50%, transparent 80%);
}
.cone-bl {
  bottom: 0; left: 0;
  background: radial-gradient(circle at 0% 100%, var(--light-beam-color) 0%, rgba(255, 250, 235, 0.08) 50%, transparent 80%);
}
.cone-br {
  bottom: 0; right: 0;
  background: radial-gradient(circle at 100% 100%, var(--light-beam-color) 0%, rgba(255, 250, 235, 0.08) 50%, transparent 80%);
}

/* Court SVG */
.court-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.court-outer-runoff {
  fill: var(--court-outer);
  stroke: var(--court-outer-border);
  stroke-width: 2;
}

.court-inner-surface {
  fill: var(--court-inner);
}

.court-line {
  stroke: var(--court-lines);
  stroke-width: 2.2;
  stroke-linecap: square;
}

.court-net-line {
  stroke: #ffffff;
  stroke-width: 3;
  stroke-dasharray: 4 2;
}

.net-post {
  fill: #64748b;
}

.bench-structure {
  fill: #1e293b;
  stroke: #334155;
  stroke-width: 1.2;
}

.bench-text {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  fill: #94a3b8;
  letter-spacing: 0.06em;
}

.court-tag-text {
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 600;
  fill: #22c55e;
}

.motion-sensor-boundary {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1.2;
  stroke-dasharray: 6 4;
}

.sensor-boundary-text {
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 600;
  fill: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.06em;
}

.tennis-ball-dot {
  fill: var(--tennis-ball-natural);
  pointer-events: none;
}

/* Draggable Players */
.player-token {
  cursor: grab;
  user-select: none;
}

.player-token:active {
  cursor: grabbing;
}

.player-halo {
  fill: rgba(255, 255, 255, 0.05);
  stroke: rgba(255, 255, 255, 0.2);
  stroke-dasharray: 2 2;
}

.player-body.p1-color {
  fill: #2563eb;
  stroke: #93c5fd;
  stroke-width: 1.8;
}

.player-body.p2-color {
  fill: #dc2626;
  stroke: #fca5a5;
  stroke-width: 1.8;
}

.player-core {
  fill: #ffffff;
}

.player-tag {
  font-family: var(--font-main);
  font-size: 8.5px;
  font-weight: 600;
  fill: #ffffff;
  paint-order: stroke fill;
  stroke: #0b0f17;
  stroke-width: 2.5px;
  stroke-linejoin: round;
}

/* On-Court Alert Banner (Temporary 3s Notification on Dim) */
.court-alert-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 1rem;
  background: #0f172a;
  border: 1px solid var(--status-warning);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { transform: translate(-50%, -10px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.alert-body strong {
  display: block;
  font-size: 0.82rem;
  color: #f8fafc;
}

.alert-body p {
  font-size: 0.7rem;
  color: #94a3b8;
}

.alert-wave-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--status-warning);
  color: #422006;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity var(--trans-fast);
}

.alert-wave-btn:hover {
  opacity: 0.9;
}

/* Quick Action Controls Bar */
.court-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  gap: 0.5rem;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.control-actions-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.bar-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.action-btn:hover {
  background: var(--bg-item-card);
  color: var(--text-main);
  border-color: var(--border-focus);
}

/* Neutral Idle Button - No Green Outline */
#btn-rest-bench {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  outline: none !important;
  box-shadow: none;
}

#btn-rest-bench:hover {
  background: var(--bg-item-card);
  color: var(--text-main);
  border-color: var(--border-focus);
}

/* Fast Forward to Idle Button - Outlined & Filled in Green */
.btn-green-action,
#btn-fast-forward-idle {
  background: rgba(34, 197, 94, 0.12) !important;
  border: 1px solid #22c55e !important;
  outline: none !important;
  color: #22c55e !important;
  font-weight: 600;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.2);
}

.btn-green-action:hover,
#btn-fast-forward-idle:hover {
  background: rgba(34, 197, 94, 0.25) !important;
  border-color: #4ade80 !important;
  outline: none !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

body.theme-light .btn-green-action,
body.theme-light #btn-fast-forward-idle {
  background: rgba(22, 163, 74, 0.1) !important;
  border: 1px solid #16a34a !important;
  outline: none !important;
  color: #15803d !important;
}

body.theme-light .btn-green-action:hover,
body.theme-light #btn-fast-forward-idle:hover {
  background: #16a34a !important;
  border-color: #15803d !important;
  outline: none !important;
  color: #ffffff !important;
}

.btn-warning-action {
  background: var(--status-warning-bg);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--status-warning);
}

.btn-warning-action:hover {
  background: rgba(245, 158, 11, 0.25);
  color: var(--status-warning);
}

/* ==========================================================================
   Right: Compact Guide Sidebar (Non-scrolling)
   ========================================================================== */
.guide-sidebar {
  display: flex;
  flex-direction: column;
}

.compact-guide-card {
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.compact-guide-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Compact Instructions List */
.compact-instructions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.compact-instructions-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  background: var(--bg-item-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border-subtle);
  color: var(--text-main);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.compact-instructions-list strong {
  display: block;
  font-size: 0.76rem;
  color: var(--text-main);
  margin-bottom: 0.1rem;
}

.compact-instructions-list p {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.compact-instructions-list em {
  color: var(--text-main);
  font-style: normal;
  font-weight: 600;
}

/* Quick Tip Box */
.quick-tip-box {
  padding: 0.5rem 0.65rem;
  background: var(--bg-item-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.quick-tip-box p {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.quick-tip-box strong {
  color: var(--text-main);
}

.quick-tip-box em {
  color: var(--accent-blue);
  font-style: normal;
  font-weight: 600;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Responsive Adaptations */
@media (max-width: 1200px) {
  .court-workspace-grid {
    grid-template-columns: 1fr;
  }
  .config-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .config-bar {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  .court-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .control-actions-left {
    flex-direction: column;
    align-items: stretch;
  }
}
