@font-face {
    font-family: 'VCR';
    src: url('VCR_OSD_MONO_1.001.woff');
    font-weight: normal;
    font-style: normal;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  -webkit-touch-callout: none; 
    -webkit-user-select: none; 
     -khtml-user-select: none; 
       -moz-user-select: none; 
        -ms-user-select: none; 
            user-select: none; 
}

textarea:focus, input:focus{
    outline: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #eee;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#top-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0a0a0a;
  border-bottom: 1px solid #333;
}

#exportControls {
  margin: 0 16px;
}

#exportControls button {
  padding: 8px;
  background: #ffcc00;

  font-size: 11px;
  color: #111;
}

.file-management {
  flex: 0;
  display: flex;
  flex-direction: row;
  padding: 0;

  z-index: 999;
}

.file-management button, .file-management label {
  display: flex;
  margin: 0;
  padding: 12px 8px;
  align-items: center;
  justify-content: center;
  flex: 1;

  background: #111;
  border: 0;
  border-bottom: 1px solid #222;

  font-family: 'VCR', 'Courier New', monospace;
  font-size: 12px;
  text-transform: uppercase;

  color: #999;
}

.file-management button:hover, .file-management label:hover {
  background: #333;

  color: #fff;
  cursor: pointer;
}

.menu-parent {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;

  font-family: 'VCR', 'Courier New', monospace;
  font-size: 12px;
  text-transform: uppercase;
  color: #ddd;
}

.menu-parent .file-management {
  display: none;
}

.menu-parent:hover .file-management {
  display: flex;

  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}

#top {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr 440px;
  grid-template-rows: 1fr;
}

#bottom {
  display: flex;
  display: none;
  flex-direction: row;
  width: 100%;
  height: 240px;

  border-top: 1px solid #333;
  background: #111111;
}

#left-panel {
  border-right: 1px solid #333;
  background: #111111;
  display: flex;
  flex-direction: column;
  gap: 0;

  max-height: calc(100vh - 50px);
}

.section.groupName {
  margin: 0 16px;
  padding: 16px 0 16px 0;
  width: calc(100% - 32px);

  border-bottom: 1px solid #333;
}

.section.groupName input {
  font-family: 'VCR', 'Courier New', monospace;
  font-size: 15px;
  text-transform: uppercase;
}

#center-panel {
  display: grid;
  grid-template-rows: 3fr 1fr;
  gap: 0;
  padding: 6px;
  background: #000000;
}

#main-view {
  overflow: hidden;
  border: 1px solid #333;
  background: #111111;
  position: relative;
}

.view-title {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 10px;
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  font-family: 'VCR', 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#mainCanvas, .ortho-canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

#ortho-views {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ortho-wrapper {
  overflow: hidden;
  border: 1px solid #333;
  background: #111;
  position: relative;
}

#right-panel {
  padding: 0 0 16px 0;
  border-left: 1px solid #333;
  background: #111111;
  display: flex;

  max-height: calc(100vh - 50px);

  flex-direction: column;
  gap: 8px;

  overflow: auto;
}

h1 {
  padding: 16px 0;
  margin: 0;

  font-size: 16px;
  font-weight: 400;
  font-family: 'VCR', 'Courier New', monospace;
  text-transform: uppercase;
  color: #555;

}

h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 8px;
}

label {
  font-size: 12px;
  display: block;
}

select, input, button, textarea {
  font-size: 12px;
  padding: 6px 4px;
  border: 0;
  background: #191919;
  color: #eee;
  width: 100%;
}

select:hover, input:hover, button:hover {
    background: #333;
}

input.right {
  text-align: right;
}

textarea {
  background: #111;
  padding: 4px 8px;
  font-family: monospace;
}
textarea:hover {
  background: #131313;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance:textfield; /* Firefox */
}

input[type=color] {
  margin: 4px 0;
  padding: 0;
  width: 36px;
  border: 0;
}

textarea {
  height: 100px;
}

select {
  font-size: 13px;
  font-family: 'VCR';
  text-transform: uppercase;
}

button {
  cursor: pointer;
  border: 1px solid #555;
  background: #111;
}

button:hover {
  background: #222;
}

.section {
  margin: 0 8px;
  padding: 0 8px;
}

section.no-border {
  border-bottom: 0;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-item {
  padding: 6px 0 6px 6px;
  border: 1px solid transparent;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.list-item.frames {
  flex-direction: column;
}

.list-item.active {
  background: #222;
}

.list-item:hover {
  background: #444;
}

.list-item span {
  flex: 1 1 auto;

  font-family: 'VCR', 'Courier New', monospace;
  text-transform: uppercase;
}

.list-item span.type {
  flex: 0;
  margin: 0 8px 0 0;
  padding: 6px 8px;
  min-width: 32px;
  text-align: center;

  background: #111;

  font-size: 11px;
  font-weight: 400;
  font-family: monospace;
  text-transform: uppercase;
}

.list-item div.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-item span.meta {
  font-size: 8px;
  color: #aaa;
}

.list-item button {
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 0;

  color: #555;
}
.list-item button:hover {
  color: #fff;
}

.row {
  display: flex;
  gap: 6px;
}

.row > * {
  flex: 1;
}

.small-btn {
  width: auto;
  padding-inline: 6px;
  /* flex: 0 0 auto; */
}

.layer-del, .frame-del {
  text-align: center;
  font-size: 18px;
}

textarea {
  resize: vertical;
  min-height: 60px;
}

#pointsList {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 50vh;
  margin: 0 0 0 4px;
  gap: 4px;
  overflow: auto;
}

.point-row {
  display: flex;
  width: 100%;
  padding: 0 0;
  gap: 4px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 5px;

  transition: padding .15s ease-in-out;
}

.point-row > div {
  display: flex;
}

.point-row span {
  padding: 7px;
  background: #222;
  border-right: 1px dashed #333;
  color: #555;
}

.point-row.selected {
  padding: 4px 0;
  border: 1px solid #333;
}

.point-row select {
  width: 50px;
  background: #111;
}

.menu-item .point-row input {
  flex: 1 1 0;
  padding: 7px 0px;
  width: 0;
  text-align: center;

  font-size: 10px;

  background: #222;
}

.point-row button {
  flex: 0 0 auto;
  padding-inline: 6px;
  width: 32px;
  border: 0;
}

#stringControls {
  display: none;
}

h2 {
  color: #fff;
}

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 0;
  
  border-bottom: 1px solid #333;
}

.menu-item.no-border {
  border-bottom: 0;
}

.menu-item.no-top {
  padding-top: 0;
}

.menu-item.checkbox {
  width: 100%;
  padding: 8px;
}

.menu-item.checkbox label {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.menu-item.checkbox input {
  width: auto;
}

.menu-item.checkbox > label {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-item.checkbox > label > input[type="checkbox"] {
  width: 20px;
}

.menu-item input {
  padding: 8px;
}

.menu-item input[type=color] {
  margin: 0;
  padding: 0;
  width: 100%;
}

.menu-item label {
  margin: 0;
  padding: 0 0 4px 0;
  min-width: 60px;
  font-size: 12px;
  font-family: 'VCR', 'Courier New', monospace;
  text-transform: uppercase;
  font-weight: 500;
  color: #555;
}

.menu-item > div {
  display: flex;
  font-size: 11px;
  text-transform: uppercase;
}

.menu-item-color {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 2px 6px;

  background: #191919;

  font-size: 12px;
}

.menu-item-color input[type=color] {
  margin: 0 8px 0 0;
  width: 24px;
}

.menu-item-header {
  padding: 24px 0 0 8px;
  display: flex;
  align-items: center;

  /* border-bottom: 1px solid #333; */

  font-size: 14px;
  font-family: 'VCR', 'Courier New', monospace;
  text-transform: uppercase;
  font-weight: 500;
  color: #999;
}

.menu-item-horizontal {
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid #333;

  font-size: 11px;
  color: #999;
}

.menu-item-horizontal.no-border {
  border-bottom: 0;
}

.menu-item-horizontal label {
  padding: 0 0 0 8px;
  width: 140px;
  font-size: 12px;
  font-family: 'VCR', 'Courier New', monospace;
  text-transform: uppercase;
  font-weight: 500;
  color: #555;
}

.menu-item-horizontal input {
  padding: 6px 8px;
}
.menu-item-horizontal input[type=color] {
  padding: 0;
}

.menu-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  width: 100%;
  padding: 0;
}

.menu-topbar label {
  margin: 0 0 0 8px;
  color: #555;
}

.menu-topbar label.main {
  margin: 0 0 0 8px;
  font-size: 14px;
  color: #999;
}

.menu-topbar nav {
  display: flex;
  gap: 8px;
}

.menu-topbar select {
  padding: 0;
  width: 80px;
  height: 24px;

  background: transparent;

  font-family: 'VCR', 'Courier New', monospace;
  text-transform: uppercase;
  font-size: 11px;
  text-align: right;
  color: #aaa;
}

.menu-topbar nav button, .multi-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 4px 0;
  width: 24px;
  height: 24px;

  background: transparent;
  border: 0;

  font-size: 20px;
  color: #999;
}

.menu-topbar nav button:hover, .multi-btn:hover {
  color: #fff;
}

.menu-topbar nav button#previewOverlayBtn, .multi-btn#previewOverlayBtn {
  padding: 0;
  font-size: 18px;
  width: 36px;
  height: 36px;
}

#frameList {
  width: 100%;
}

#frameList .list-item {
  display: flex;
  flex-direction: column;
  padding: 0 0 0 8px;
  width: 100%;

  gap: 0;
  
  font-size: 11px;
}

#frameList .list-item {
  padding: 0;
}

#frameList .list-item.active {
  background: transparent;

  cursor: default;
}

#frameList .list-item:hover {
  background: transparent;
}

.active > .frame-row {
  background: #333;

  color: #fff;
}

.frame-row {
  margin: 0;
  padding: 4px 0 4px 8px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;

  background: #222;

  color: #aaa;
}

.frame-row:hover {
  background: #333;

  color: #fff;
}

.frame-row button {
  width: auto;
  padding: 0 8px;
  font-size: 19px;
}

.frame-controls {
  margin: 0;
  padding: 0;
  width: 100%;

  border: 1px solid #222;
}

.frame-controls textarea {
  margin: 0;
}

.frame-controls .menu-item-horizontal {
  padding: 0;
}

.frame-controls .menu-item-horizontal input {
  width: 70%;
}

.frame-controls .menu-item-header {
  padding: 0 0 0 8px;
}

.multi-btn {
  position: relative;
}

.multi-btn:hover .multi-btn-options {
  display: flex;
  flex-direction: column;
}

.multi-btn-options {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  padding: 24px 0 0 0;

  box-shadow: 0 4px 4px rgba(0,0,0,.1);

  z-index: 2;
}

.multi-btn-options .multi-btn-option {
  display: flex;
  justify-content: flex-start;
  padding: 16px 8px;
  width: 120px;

  background: #333;

  text-align: left;
  font-size: 12px;

  cursor: pointer;
}

#geometryControls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#pathControls {
  padding: 16px 0 0 0;
  padding: 0;
}

#pathList {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

#emptyPlaceholder {
  padding: 0 8px;

  font-family: 'VCR', 'Courier New', monospace;
  font-size: 11px;
  text-transform: uppercase;
  color: #555;
}

#previewOverlay {
  position: fixed;
  inset: 50%;
  background: rgba(0, 0, 0, 0.75);
  display: none;              /* toggled by JS */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#previewOverlayInner {
  min-width: 260px;
  max-width: 420px;
  padding: 16px 20px;
  background: #101015;
  border: 1px solid #444;
  border-radius: 8px;
  color: #eee;
  font-family: system-ui, sans-serif;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

#previewOverlayInner h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

#previewOverlayInner p {
  margin: 4px 0 10px;
  font-size: 11px;
  opacity: 0.75;
}

#previewOverlayInner .preview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

#previewOverlayInner .preview-info {
  font-size: 11px;
  opacity: 0.7;
}

#previewCloseBtn {
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}


#timelineContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  padding: 0 8px 8px 8px;
  font-size: 11px;
}

#timelineRows {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.timeline-row {
  flex: 1;
  display: flex;
  align-items: center;
  margin: 0;
}

.timeline-row-label {
  position: absolute;
  /* width: 90px; */
  flex: 0 0 auto;
  padding: 8px;
  color: #aaa;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;

  text-transform: uppercase;
  font-weight: 500;
  font-size: 11px;

  z-index: 1;
}

.timeline-row-track {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  /* background: #101018; */
  border-radius: 4px;
  overflow: hidden;
}

.timeline-block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 5px;
  background: #222;
  background: linear-gradient(to bottom,
  #652D3E 0%,
  #5F2738 100%)
}

.timeline-block.static {
  background: #191919;
  background: linear-gradient(to bottom,
  #2B415F 0%,
  #233855 100%)
}

#timelinePlayhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  pointer-events: none;
  transform: translateX(0);
}

#frameInfo {
  padding: 4px 8px 0 8px;
  font-family: monospace;
  text-transform: uppercase;
  font-size: 11px;
  color: #555;
}

#subFrame {
  background: linear-gradient(to bottom,
  #0b0b0b 0%,
  transparent 100%)
}

#playbackBlock {
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}


#playbackBlock label {
  margin: 0;
  padding: 0 8px 8px 8px;
  min-width: 60px;
  font-size: 14px;
  font-family: 'VCR', 'Courier New', monospace;
  text-transform: uppercase;
  font-weight: 500;
  color: #999;
}

button#previewOverlayBtn {
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

button#previewOverlayBtn span {
  margin: 0 8px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;

  width: 28px;
  height: 28px;
  background: #333;
  aspect-ratio: 1;

  font-size: 15px;
}

canvas {
  width: 100%;
  height: 100%;
}

button {
  width: 100%;
  background: #111;
  border:0;
  text-align: left;
  font-size: 12px;
  font-family: 'VCR', 'Courier New', monospace;
  text-transform: uppercase;
  color: #999;

  appearance: none;
}
button:hover {
  color: #ff9900;
}

/* The area that contains per-frame controls */
#frameList .frame-controls {
  padding-top: 8px;
}

hr {
  margin: 8px 0 0 0;
  width: 100%;
  height: 1px;
  background: #333;
  border: 0;
}

.split {
  display: flex;
  align-items: center;
}