:root {
  --font-ui: "Inter", "Segoe UI", sans-serif;
  --font-heading: "Sora", "Inter", sans-serif;
  --background: linear-gradient(180deg, rgba(43, 66, 101, 1) 0%, rgba(24, 45, 74, 1) 100%);
  --text-primary: #bcc3c5;
  --text-secondary: #788594;
  --border_color: #30363d;
  --border_style: 1px solid var(--border_color);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: var(--text-primary);
}

html {
  scroll-behavior: smooth;
  font-size: 105%;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #083d8c;
}

a {
  color: inherit;
  text-decoration: none;
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #0d2a5d;
  --bs-btn-border-color: #0b3d91;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0a4294;
  --bs-btn-hover-border-color: #082f6b;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #06244f;
  --bs-btn-active-border-color: #06244f;
  transition: all 0.35s ease;
  border-color: var(--border_color);
  color: #8b949e;
}

.badge {
  border-radius: 2px;
}

.app-header {
  background: var(--background);
  border-bottom: var(--border_style);
  font-family: var(--font-ui), serif;
}

.app-footer {
  background: var(--background);
  border-top: var(--border_style);
}
.app-footer .small {
  opacity: 0.75;
  font-size: 0.75rem;
}

.app-sidebar {
  min-width: 200px;
  max-width: 600px;
  width: 300px;
  flex-shrink: 0;
  background: rgb(55, 60, 75);
  border-right: var(--border_style);
  position: relative;
}
.app-sidebar .btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(3em, 1fr));
  align-items: stretch;
}
.app-sidebar button {
  font-size: 110%;
}
.app-sidebar::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  cursor: col-resize;
  background: black;
  transition: background 0.2s;
  z-index: 10;
}
.app-sidebar::after:hover {
  background: rgba(88, 166, 255, 0.3);
}
.app-sidebar.resizing::after {
  background: rgba(88, 166, 255, 0.5);
}

@media (max-width: 1200px) {
  .app-sidebar {
    max-width: 500px;
    width: 280px;
  }
}
@media (max-width: 992px) {
  .app-sidebar {
    max-width: 400px;
    width: 260px;
  }
}
@media (max-width: 768px) {
  .app-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 280px;
    max-width: 90vw;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-sidebar::after {
    display: none;
  }
  .sidebar-toggle {
    position: fixed;
    top: 60px;
    left: 10px;
    z-index: 99;
    background: rgb(55, 60, 75);
    border: var(--border_style);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .sidebar-overlay.show {
    opacity: 1;
    pointer-events: all;
  }
}
@media (max-width: 576px) {
  .app-header .h5 {
    font-size: 1rem;
  }
  .app-header .logo {
    height: 1.8em !important;
  }
  .app-footer .small {
    font-size: 0.65rem;
  }
}
.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  background: rgba(13, 17, 23, 0.95);
  padding: 2rem 3rem;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  text-align: center;
  color: var(--text-primary);
  font-size: 1rem;
  border: 1px solid var(--border_color);
}
.loading.hidden {
  display: none;
}
.loading .spinner-border {
  width: 3rem;
  height: 3rem;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.lil-gui {
  --background-color: #3b4750;
  --text-color: var(--text-primary);
  --title-text-color: red;
  --widget-color: #1c2128;
  --hover-color: var(--border_color);
  --focus-color: #58a6ff;
  --number-color: #58a6ff;
  --string-color: #a2db3c;
  --font-size: 0.9em;
  --input-font-size: 12px;
  --padding: 0.5rem;
  --spacing: 0.3rem;
  --widget-height: 1.5em;
  --name-width: 45%;
  --slider-knob-width: 2px;
  --slider-input-width: 27%;
  --color-input-width: 27%;
  --slider-input-min-width: 2em;
  --color-input-min-width: 65px;
  --folder-indent: 7px;
  --widget-padding: 0 0 0 3px;
  --widget-border-radius: 2px;
  --checkbox-size: calc(0.75 * var(--widget-height));
  --scrollbar-width: 5px;
  --width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-bottom: 2px solid var(--border_color);
}
.lil-gui button:hover {
  background: rgba(60, 60, 60, 0.95);
}
.lil-gui .children .title {
  background-color: #465662;
}
.lil-gui.root > .title {
  display: none !important;
}

.lil-gui .no-header-folder > .title {
  display: none;
}

.lil-gui .no-header-folder {
  padding-top: 0;
}
