@font-face {
  font-family: 'NoeDisplay';
  src: url('assets/fonts/NoeDisplay-Bold.otf') format('opentype');
  font-weight: bold;
  font-display: swap;
}
@font-face {
  font-family: 'Thicccboi';
  src: url('assets/fonts/THICCCBOI-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Thicccboi';
  src: url('assets/fonts/THICCCBOI-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Thicccboi';
  src: url('assets/fonts/THICCCBOI-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

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

:root {
  --bg: #1a3a3f;
  --panel: #213f44;
  --panel-2: #1a3a3f;
  --line: rgba(49, 191, 228, 0.15);
  --text: #e8e2d6;
  --muted: #8a9e9e;
  --accent: #31bfe4;
  --error: #e05252;
  --canvas-bg: #16323661;
  --section-bg: #21404466;
  --el-video: #2a6a76;
  --el-image: #31bfe4;
  --el-text: #c9a86a;
}

html, body {
  height: 100%;
  font-family: 'Thicccboi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

body { display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.brand .logo-o { font-family: 'NoeDisplay', Georgia, serif; font-weight: 700; font-size: 28px; line-height: 1; color: var(--accent); }

.viewports { display: flex; gap: 6px; }
.viewports button,
.actions button,
.panel-header button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.viewports button.active { background: var(--accent); color: #1a3a3f; border-color: var(--accent); font-weight: 600; }
.viewports button:hover, .actions button:hover, .panel-header button:hover { border-color: var(--accent); }

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

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  min-height: 0;
}

.left, .right {
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.right { border-right: none; border-left: 1px solid var(--line); }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.tree { list-style: none; padding: 6px; }
.tree li { padding: 0; }
.tree .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}
.tree .row:hover { background: var(--panel-2); }
.tree .row.selected { background: var(--accent); color: #1a3a3f; }
.tree .row.selected .num { color: #1a3a3f; }
.tree .label { display: flex; gap: 8px; align-items: center; }
.tree .num { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; }
.tree .actions-mini { display: flex; gap: 4px; }
.tree .actions-mini button {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
  opacity: 0.7;
}
.tree .actions-mini button:hover { opacity: 1; }
.tree ul { list-style: none; padding-left: 14px; border-left: 1px dashed var(--line); margin-left: 8px; }

.canvas-wrap {
  display: flex;
  flex-direction: column;
  background: #0a0c11;
  min-width: 0;
}
.canvas-meta {
  padding: 8px 16px;
  color: var(--muted);
  font-size: 11px;
  font-family: ui-monospace, monospace;
  border-bottom: 1px solid var(--line);
}
.canvas-scroll {
  flex: 1;
  overflow: auto;
  padding: 24px;
  text-align: center;
}
.canvas-stage {
  display: inline-block;
  position: relative;
  vertical-align: top;
  text-align: left;
}
.canvas-stage > .canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}

.canvas {
  background: var(--canvas-bg);
  width: 1280px;
  min-width: 1280px;
  min-height: 600px;
  flex-shrink: 0;
  transition: width 0.2s ease, min-width 0.2s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.page {
  display: flex;
  flex-direction: column;
}

.section {
  background: var(--section-bg);
  position: relative;
  display: grid;
  outline: 1px dashed transparent;
  cursor: pointer;
}
.section.selected { outline-color: var(--accent); outline-width: 2px; }

.element {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #1a3a3f;
  font-weight: 600;
  cursor: pointer;
}
.element.video { background: var(--el-video); color: #e8e2d6; }
.element.image { background: var(--el-image); }
.element.text  { background: var(--el-text); }

.props { padding: 12px; }
.props .hint { color: var(--muted); font-style: italic; }
.props h3 {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 12px 0 6px;
  letter-spacing: 0.5px;
}
.props h3:first-child { margin-top: 0; }
.props .field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.props label {
  font-size: 12px;
  color: var(--text);
  flex: 1;
}
.props label small { color: var(--muted); display: block; font-size: 10px; }
.props input[type="number"],
.props select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 4px;
  width: 56px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
  text-align: center;
  -moz-appearance: textfield;
}
.props input[type="number"]::-webkit-outer-spin-button,
.props input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.props select { width: 110px; }

.props .readout {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--accent);
  padding: 5px 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-width: 56px;
  text-align: center;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}
.stepper button {
  background: var(--panel-2);
  color: var(--accent);
  border: 1px solid var(--line);
  width: 22px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  padding: 0;
}
.stepper button:hover { border-color: var(--accent); background: rgba(49,191,228,0.1); }
.props .delete {
  margin-top: 14px;
  width: 100%;
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  padding: 7px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.props .delete:hover { background: var(--error); color: #1a3a3f; }

.props .add-row {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.props .add-row button {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}
.props .add-row button:hover { border-color: var(--accent); }

footer {
  position: fixed;
  bottom: 6px;
  right: 10px;
  z-index: 999;
  pointer-events: none;
}
.version { font-size: 10px; color: #555; font-family: ui-monospace, monospace; }
