/* web/src/styles.css */
:root {
  --bg: #0b1016;
  --bg-panel: #121a23;
  --bg-card: #18222d;
  --bg-raised: #1f2a36;
  --line: #263341;
  --text: #e6eef6;
  --text-dim: #93a4b5;
  --text-faint: #61748a;
  --teal: #38d6c4;
  --teal-dim: #1d7f78;
  --amber: #f0b429;
  --green: #48c78e;
  --pink: #ff7ab2;
  --red: #ff6b6b;
  --blue: #5aa9ff;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body, #app {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px / 1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.btn {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  border-radius: 8px;
  padding: 6px 11px;
}

.btn:hover {
  border-color: var(--teal-dim);
}

.btn.primary {
  background: var(--teal);
  color: #06231f;
  border-color: var(--teal);
  font-weight: 600;
}

.btn.primary:hover {
  filter: brightness(1.08);
}

.btn.ghost {
  background: none;
}

.btn.danger {
  color: var(--red);
  border-color: #4a2b2b;
}

.btn:disabled {
  opacity: .45;
  cursor: default;
}

.chip {
  display: inline-flex;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  font: 11px var(--mono);
  text-transform: lowercase;
  letter-spacing: .03em;
  color: var(--text-dim);
  border-radius: 999px;
  align-items:  center;
  gap: 5px;
  padding: 2px 8px;
}

.chip.amber {
  color: var(--amber);
  border-color: #4a3d18;
}

.chip.green {
  color: var(--green);
  border-color: #1d3f31;
}

.chip.pink {
  color: var(--pink);
  border-color: #4a2334;
}

.chip.teal {
  color: var(--teal);
  border-color: var(--teal-dim);
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--text-dim);
}

.faint {
  color: var(--text-faint);
}

.small {
  font-size: 12px;
}

.label {
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-faint);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.row {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.grow {
  flex: 1;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

input[type="text"], input[type="number"], textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
  padding: 6px 9px;
}

input:focus, textarea:focus {
  outline: 1px solid var(--teal-dim);
}

.shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.topbar {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
  align-items:  center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
}

.brand {
  letter-spacing: .02em;
  font-weight: 700;
}

.brand span {
  color: var(--teal);
}

.explorer {
  overflow: auto;
  height: 100%;
  padding: 22px;
}

.explorer h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.project-card {
  display: flex;
  cursor: pointer;
  flex-direction: column;
  gap: 8px;
  transition: border-color .12s;
}

.project-card:hover {
  border-color: var(--teal-dim);
}

.project-card h3 {
  margin: 0;
  font-size: 15px;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.episode-row {
  display: flex;
  background: var(--bg);
  cursor: pointer;
  border: 1px solid #0000;
  border-radius: 8px;
  align-items:  center;
  gap: 10px;
  padding: 7px 10px;
}

.episode-row:hover {
  border-color: var(--line);
}

.editor {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
}

.editor-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: 0;
}

.stage {
  position: relative;
  display: flex;
  overflow: hidden;
  background: #05080b;
  justify-content: center;
  align-items:  center;
  min-width: 0;
}

.stage canvas, .stage video {
  max-width: 100%;
  max-height: 100%;
}

.sidebar {
  border-left: 1px solid var(--line);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar .tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.sidebar .tabs button {
  cursor: pointer;
  color: var(--text-faint);
  font: 11px var(--mono);
  text-transform: uppercase;
  background: none;
  border: 0;
  border-bottom: 2px solid #0000;
  flex: 1;
  padding: 9px 4px;
}

.sidebar .tabs button.active {
  color: var(--text);
  border-bottom-color: var(--teal);
}

.sidebar .pane {
  overflow: auto;
  display: none;
  flex: 1;
  min-height: 0;
  padding: 12px;
}

.sidebar .pane.active {
  display: block;
}

.strip-wrap {
  border-top: 1px solid var(--line);
  background: var(--bg-panel);
}

.toasts {
  position: fixed;
  display: flex;
  z-index: 50;
  flex-direction: column;
  gap: 8px;
  bottom: 16px;
  right: 16px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  padding: 8px 12px;
}

.toast.warn {
  border-left-color: var(--amber);
}

.toast.err {
  border-left-color: var(--red);
}

.help-screen {
  position: fixed;
  z-index: 60;
  display: grid;
  background: #05080beb;
  place-items:  center;
  padding: 24px;
  inset: 0;
}

.help-screen .card {
  width: 100%;
  max-width: 720px;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
}

.help-grid div {
  display: flex;
  border-bottom: 1px dashed var(--line);
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

kbd {
  font: 11px var(--mono);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
}
