/**
 * PragCore Training Ground & Combat Laboratory Stylesheet
 * Strictly zero emojis. Monochrome obsidian aesthetics with cyan/amber telemetry accents.
 * Adheres to PragCore DESIGN.md, Web Interface Guidelines, and Rule 13 Hard CSS Privacy Gate.
 */

/* ==========================================================================
   Rule 13: Hard CSS Privacy Gate
   ========================================================================== */
body:not(.sovereign-unlocked) #training-laboratory {
  display: none !important;
}

body.sovereign-unlocked #clearance-gate-container {
  display: none !important;
}

/* ==========================================================================
   Base Layout & Viewport
   ========================================================================== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #050508;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.training-page {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Avionics Training Top Navigation Header (50px locked height)
   ========================================================================== */
.training-header {
  position: relative;
  z-index: 100;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  background: rgba(8, 9, 13, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.training-header::-webkit-scrollbar {
  display: none;
}

.training-header-left,
.training-header-center,
.training-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.training-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.training-brand-glyph {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, #00f2fe 0%, #38bdf8 100%);
  display: inline-block;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.training-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: rgba(0, 242, 254, 0.12);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.training-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: 0 0 6px #00f2fe;
  animation: pulse-dot 1.8s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Header Action Controls */
.training-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 0.38rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.18s ease;
  font-family: inherit;
  outline: none;
}

.training-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.training-btn:focus-visible {
  box-shadow: 0 0 0 2px #00f2fe;
}

.training-btn--primary {
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.35);
  color: #00f2fe;
}

.training-btn--primary:hover {
  background: rgba(0, 242, 254, 0.28);
  border-color: #00f2fe;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.training-btn--danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.training-btn--danger:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
}

.speed-selector,
.zoom-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 2px;
}

.speed-btn,
.zoom-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-variant-numeric: tabular-nums;
}

.speed-btn:hover,
.zoom-btn:hover {
  color: #ffffff;
}

.speed-btn.is-active,
.zoom-btn.is-active {
  background: rgba(0, 242, 254, 0.2);
  color: #00f2fe;
}

/* ==========================================================================
   Main Laboratory Arena & Stage Viewport
   ========================================================================== */
.training-arena {
  position: relative;
  flex: 1;
  width: 100%;
  height: calc(100vh - 50px);
  overflow: hidden;
  background: #06080d;
}

/* Canvas Backing Store */
#stage-grid-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#debug-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
}

/* DOM Platforms Stage World Container */
#training-stage-world {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

/* ==========================================================================
   Platform Fighter Test Zones Styling
   ========================================================================== */
.stage-platform {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  transition: transform 0.05s linear;
}

/* 1. Center Main Tournament Stage (Solid) */
.plat-main-deck {
  background: linear-gradient(180deg, #181c26 0%, #0d111a 100%);
  border-top: 2px solid #00f2fe;
  border-left: 2px solid rgba(0, 242, 254, 0.4);
  border-right: 2px solid rgba(0, 242, 254, 0.4);
  border-bottom: 2px solid #090c14;
  border-radius: 2px 2px 8px 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.plat-main-deck .plat-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  font-family: monospace;
  color: rgba(0, 242, 254, 0.6);
  text-transform: uppercase;
}

/* Ledge Snapping Sweetspots */
.stage-ledge-marker {
  position: absolute;
  top: 0;
  width: 8px;
  height: 14px;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}
.stage-ledge-left { left: 0; border-radius: 2px 0 0 2px; }
.stage-ledge-right { right: 0; border-radius: 0 2px 2px 0; }

/* 2. Soft Semi-Solid Platforms (Battlefield Tri-Plats) */
.plat-soft {
  background: rgba(14, 165, 233, 0.12);
  border-top: 2px solid #38bdf8;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
  backdrop-filter: blur(4px);
  border-radius: 2px;
}

.plat-soft::before,
.plat-soft::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 6px;
  height: 4px;
  background: #ffffff;
  box-shadow: 0 0 6px #38bdf8;
}
.plat-soft::before { left: 0; }
.plat-soft::after { right: 0; }

/* 3. Solid Impermeable Block */
.plat-solid-block {
  background: #11141c;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 8px 24px rgba(0, 0, 0, 0.7);
  border-radius: 4px;
}

.plat-solid-block .plat-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  font-family: monospace;
  color: #94a3b8;
  text-transform: uppercase;
}

/* 4. Moving / Patrolling Platform */
.plat-moving {
  background: rgba(168, 85, 247, 0.18);
  border-top: 2px solid #c084fc;
  border-bottom: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
  border-radius: 3px;
}

.plat-moving .plat-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  font-family: monospace;
  color: #e9d5ff;
}

/* 5. Crumbling / Fragile Platform */
.plat-crumble {
  background: rgba(245, 158, 11, 0.14);
  border-top: 2px dashed #f59e0b;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.plat-crumble.is-crumbling {
  animation: plat-shake 0.08s infinite ease-in-out;
  border-color: #ef4444;
}

.plat-crumble.is-broken {
  opacity: 0.15;
  pointer-events: none;
  filter: blur(2px);
}

@keyframes plat-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  75% { transform: translate(2px, -1px); }
}

/* 6. Bouncy Spring Platform */
.plat-spring {
  background: rgba(236, 72, 153, 0.18);
  border-top: 3px solid #f472b6;
  border-bottom: 2px solid rgba(236, 72, 153, 0.4);
  border-radius: 4px;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.35);
}

.plat-spring .plat-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: monospace;
  color: #fbcfe8;
}

/* 7. Conveyor Belt Platform */
.plat-conveyor {
  background: rgba(34, 197, 94, 0.15);
  border-top: 2px solid #22c55e;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.conveyor-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 12px,
    rgba(34, 197, 94, 0.4) 12px,
    rgba(34, 197, 94, 0.4) 16px
  );
}

.conveyor-left .conveyor-track {
  animation: conveyor-move-left 0.8s linear infinite;
}

.conveyor-right .conveyor-track {
  animation: conveyor-move-right 0.8s linear infinite;
}

@keyframes conveyor-move-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-28px); }
}

@keyframes conveyor-move-right {
  0% { transform: translateX(-28px); }
  100% { transform: translateX(0); }
}

/* 8. Ice / Low-Friction Platform */
.plat-ice {
  background: rgba(224, 242, 254, 0.25);
  border-top: 2px solid #bae6fd;
  box-shadow: 0 0 15px rgba(186, 230, 253, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px);
  border-radius: 3px;
}

.plat-ice .plat-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  font-family: monospace;
  color: #e0f2fe;
}

/* 9. Hazard Spike Bed */
.plat-hazard {
  background: rgba(239, 68, 68, 0.22);
  border-top: 2px solid #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.4);
  border-radius: 2px;
}

.hazard-spikes {
  position: absolute;
  top: -8px;
  left: 0;
  width: 100%;
  height: 8px;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 6px,
    #ef4444 6px,
    #ef4444 12px
  );
}

.plat-hazard .plat-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: monospace;
  color: #fca5a5;
}

/* 10. Wall-Jump Chasm Columns */
.plat-wall-chasm {
  background: #151922;
  border-left: 2px solid rgba(0, 242, 254, 0.5);
  border-right: 2px solid rgba(0, 242, 254, 0.5);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   Left Inspector Drawer: Real-Time Combat & Frame Data Telemetry
   ========================================================================== */
.inspector-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 280px;
  background: rgba(10, 12, 18, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  z-index: 50;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.4rem;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.telemetry-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
}

.tile-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.tile-value {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: monospace;
  color: #f8fafc;
}

.tile-value--cyan { color: #00f2fe; }
.tile-value--emerald { color: #10b981; }
.tile-value--rose { color: #f43f5e; }
.tile-value--amber { color: #f59e0b; }

.combo-callout {
  padding: 0.5rem;
  border-radius: 6px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.combo-status-true {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
}

.combo-status-escapable {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

/* ==========================================================================
   Right Control Deck: Fighter Setup, Dummy AI & Overlays
   ========================================================================== */
.control-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 310px;
  background: rgba(10, 12, 18, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  z-index: 50;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: calc(100vh - 82px);
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
}

.form-select,
.form-input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: #f8fafc;
  padding: 0.4rem 0.6rem;
  font-size: 0.78rem;
  font-family: inherit;
  outline: none;
}

.form-select:focus,
.form-input:focus {
  border-color: #00f2fe;
}

/* Damage Slider & Stepper */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.slider-input {
  flex: 1;
  accent-color: #00f2fe;
  cursor: pointer;
}

.slider-presets {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: rgba(0, 242, 254, 0.15);
  color: #00f2fe;
  border-color: rgba(0, 242, 254, 0.3);
}

/* Toggle Checkboxes */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.toggle-label {
  font-size: 0.74rem;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.toggle-switch {
  position: relative;
  width: 32px;
  height: 18px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  transition: .2s ease;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #00f2fe;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(14px);
  background-color: #050508;
}

/* ==========================================================================
   Hotkeys & Legend Footer Tooltip
   ========================================================================== */
.hotkeys-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 12, 18, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 0.35rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  z-index: 50;
  font-size: 0.7rem;
  color: #94a3b8;
}

.hotkey-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.key-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-family: monospace;
  font-weight: 700;
  color: #ffffff;
  font-size: 0.65rem;
}

/* ==========================================================================
   Dummy Mode & Controls Callout Enhancements
   ========================================================================== */
.dummy-config-section.is-solo-mode {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.8);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.controls-hint-box {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.45;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.controls-hint-box strong {
  color: #00f2fe;
}

/* ==========================================================================
   Stage Construction Editor & Studio Styles
   ========================================================================== */
.training-arena.is-builder-mode {
  cursor: crosshair;
}

.stage-draw-ghost {
  position: absolute;
  border: 1.5px dashed #00f2fe;
  background: rgba(0, 242, 254, 0.12);
  pointer-events: none;
  z-index: 40;
  border-radius: 4px;
}

.stage-selection-box {
  position: absolute;
  border: 1.5px solid #00f2fe;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
  pointer-events: none;
  z-index: 45;
  border-radius: 2px;
}

.stage-resize-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border: 1.5px solid #00f2fe;
  border-radius: 2px;
  pointer-events: auto;
  z-index: 46;
}

.stage-resize-handle.handle-nw { top: -4px; left: -4px; cursor: nwse-resize; }
.stage-resize-handle.handle-ne { top: -4px; right: -4px; cursor: nesw-resize; }
.stage-resize-handle.handle-sw { bottom: -4px; left: -4px; cursor: nesw-resize; }
.stage-resize-handle.handle-se { bottom: -4px; right: -4px; cursor: nwse-resize; }

.stage-builder-toolbar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 10px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 60;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.75), 0 0 16px rgba(0, 242, 254, 0.15);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}

.stage-tool-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.stage-tool-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.stage-tool-chip.is-active {
  background: rgba(0, 242, 254, 0.18);
  border-color: #00f2fe;
  color: #00f2fe;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

.toolbar-select {
  padding: 3px 6px;
  font-size: 0.68rem;
  height: 26px;
}

.stage-action-btns {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.stage-action-btns button {
  flex: 1;
}

.stage-inspector-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.stage-inspector-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.stage-inspector-actions button {
  flex: 1;
}

.training-btn--danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.training-btn--danger:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #ffffff;
}

.training-btn--sm {
  padding: 3px 8px;
  font-size: 0.68rem;
  height: 26px;
}

.share-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.share-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.share-textarea {
  width: 100%;
  height: 120px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #e2e8f0;
  font-family: monospace;
  font-size: 0.72rem;
  padding: 8px;
  resize: vertical;
}

.share-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* ==========================================================================
   Dojo Canvas-to-Arena Coordinate Lock & Floating Fighter Scoreboard
   ========================================================================== */
body.training-body #prag-platformer-canvas {
  top: 50px !important;
  left: 0 !important;
  height: calc(100vh - 50px) !important;
  z-index: 15 !important;
}

body.training-body #prag-platformer-hud,
body.training-body #prag-platformer-touch-controls,
body.training-body #hud-radar,
body.training-body #prag-platformer-controller-hud,
body.training-body #hud-boss-pill,
body.training-body #hud-exit-btn {
  display: none !important;
}

/* Collapsible Drawer Controls & Compact Telemetry */
.panel-collapse-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}
.panel-collapse-btn:hover {
  background: rgba(0, 242, 254, 0.18);
  border-color: #00f2fe;
  color: #00f2fe;
}

.panel-collapsible-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.inspector-panel.is-collapsed .panel-collapsible-body,
.control-panel.is-collapsed .panel-collapsible-body {
  display: none !important;
}

.inspector-panel.is-collapsed,
.control-panel.is-collapsed {
  padding-bottom: 0.6rem;
}

.inspector-panel.is-collapsed .panel-title,
.control-panel.is-collapsed .panel-title {
  border-bottom: none;
  padding-bottom: 0;
}

.tile-value--sm {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.training-btn,
.hotkey-item,
.preset-chip {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Responsive Tablet & Mobile Arena Layouts (Zero Overlap & Zero Truncation) */
@media (max-width: 1180px) {
  body.training-body #prag-platformer-hud {
    max-width: calc(100vw - 32px);
  }
  .inspector-panel,
  .control-panel {
    top: auto;
    bottom: 52px;
    width: calc(50% - 20px);
    max-height: 320px;
    overflow-y: auto;
  }
  .inspector-panel {
    left: 12px;
  }
  .control-panel {
    right: 12px;
  }
}

@media (max-width: 640px) {
  .training-header {
    padding: 0 0.65rem;
    gap: 0.5rem;
  }
  .inspector-panel {
    top: 10px;
    bottom: auto;
    left: 8px;
    right: 8px;
    width: auto;
    padding: 0.55rem 0.7rem;
    max-height: 175px;
  }
  .inspector-panel .telemetry-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
  }
  .inspector-panel .tile-value {
    font-size: 0.78rem;
  }
  .control-panel {
    top: auto;
    bottom: 44px;
    left: 8px;
    right: 8px;
    width: auto;
    padding: 0.65rem 0.75rem;
    max-height: 195px;
  }
  .hotkeys-bar {
    bottom: 6px;
    left: 8px;
    right: 8px;
    transform: none;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
    padding: 0.3rem 0.75rem;
    gap: 0.85rem;
  }
  .hotkeys-bar::-webkit-scrollbar {
    display: none;
  }
}



