/* UtopiaColor Simulation Stylesheet */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000000;
  color: #ffffff;
  display: flex;
}

/* Main Layout Split */
#main-viewport {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
}

#viewport-container {
  width: 100%;
  height: 100%;
}

/* Phase space overlay in top-left */
#phaseCanvas {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  border-radius: 4px;
}

/* Trait Card overlay in bottom-left */
#traitCanvas {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 10;
  pointer-events: none;
}

/* Top center day/speed indicator */
#topStatus {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #333;
  font-size: 13px;
  font-weight: 600;
  color: #eee;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Right Panel matching Cary Huang's 400px UI */
#side-panel {
  width: 380px;
  height: 100%;
  background: #000000;
  border-left: 2px solid #222;
  display: flex;
  flex-direction: column;
  z-index: 15;
}

#rightUiCanvas {
  width: 380px;
  flex: 1;
  background: #000000;
}

/* Control strip at bottom of side panel */
#controlStrip {
  background: #111;
  border-top: 1px solid #222;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-row {
  display: flex;
  gap: 4px;
}

button.btn-ctrl {
  flex: 1;
  background: #222;
  border: 1px solid #444;
  color: #ddd;
  padding: 5px 6px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.1s ease;
}

button.btn-ctrl:hover {
  background: #333;
  color: #fff;
}

button.btn-ctrl.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #fff;
  font-weight: bold;
}

/* Mobile Toggle Bar */
#mobileToggleBar {
  display: none;
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #444;
  padding: 6px 12px;
  border-radius: 20px;
  gap: 8px;
}

/* Responsive Media Query for Mobile */
@media (max-width: 820px) {
  body {
    flex-direction: column;
  }
  #side-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 360px;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  }
  #side-panel.open {
    transform: translateX(0);
  }
  #mobileToggleBar {
    display: flex;
  }
  #traitCanvas {
    display: none;
  }
}
