/* Banner Studio, in the same design language as the editor: title bar, panel card, canvas card, inspector. */

.studio {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  outline: none;
}

.studio-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--topbar-h);
  padding: 6px 14px 6px 18px;
  border-bottom: 1px solid var(--hair);
  flex-wrap: wrap;
}
.studio-top .field { margin: 0; flex-direction: row; align-items: center; gap: 6px; }
.studio-top .field-label { font-size: 11.5px; color: var(--text-3); }
.studio-top select.input { font-size: 12px; padding: 4px 7px; }
.studio-top .btn-small { background: none; color: var(--text-2); }
.studio-top .btn-small:hover { background: var(--surface-3); color: var(--text); }
.studio-top .btn-primary { margin-left: auto; }
.studio-title { font-weight: 600; letter-spacing: 0.01em; color: var(--text); margin-right: 8px; display: flex; align-items: center; gap: 9px; }
.studio-title::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 40%, transparent); }
.studio-name { width: 130px; }

.studio-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(300px, 1fr) 330px; gap: var(--gap); padding: var(--pad); }
.studio-left, .studio-right {
  min-height: 0; overflow-y: auto;
  background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--hair);
}
.studio-left { display: flex; flex-direction: column; }
.studio-right { padding: 12px 12px 30px; }
.studio-panel { padding: 4px 12px 30px; overflow-y: auto; }
.studio-left .left-tabs { display: flex; gap: 2px; margin: 10px 12px 6px; padding: 3px; border-radius: 9px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); }
.studio-left .left-tab { flex: 1; border: 0; background: none; color: var(--text-2); font-size: 12px; padding: 5px 8px; border-radius: 7px; cursor: pointer; }
.studio-left .left-tab:hover { color: var(--text); }
.studio-left .left-tab.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.studio-stage {
  min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px;
  background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--hair);
}
.studio-canvas {
  position: relative;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--hair-2), 0 10px 40px rgba(0, 0, 0, 0.6);
  background: repeating-conic-gradient(#131518 0% 25%, #16181b 0% 50%) 0 0 / 16px 16px;
}
.studio-view, .studio-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.studio-view { image-rendering: pixelated; }
.studio-overlay { touch-action: none; }
.studio-hint { font: 11px var(--mono); color: var(--text-3); text-align: center; max-width: 720px; }

.bg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bg-card { display: flex; flex-direction: column; gap: 4px; padding: 5px; background: var(--surface-2); border: 0; box-shadow: inset 0 0 0 1px var(--hair); border-radius: var(--radius-sm); color: var(--text-2); cursor: pointer; font-size: 11px; text-align: left; }
.bg-card canvas { border-radius: 4px; }
.bg-card canvas { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.bg-card:hover { background: var(--surface-3); color: var(--text); }
.bg-card.active { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); color: var(--text); }
.bg-image-icon { height: 34px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: #111; color: var(--ink-dim); }
.bg-controls { margin-top: 4px; }
.colour-swatch.wide { width: 100%; height: 26px; }
.range { width: 100%; accent-color: var(--green); }
.range-value { font: 11px var(--mono); color: var(--ink); text-transform: none; letter-spacing: 0; }

.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.layer-list { display: flex; flex-direction: column; gap: 3px; }
.layer-row { position: relative; display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 6px; border-radius: 8px; color: var(--text-2); cursor: pointer; font-size: 12.5px; transition: background 140ms var(--ease), color 140ms var(--ease); }
.layer-row:hover { background: var(--surface-2); color: var(--text); }
.layer-row.active { background: var(--accent-soft); color: var(--text); }
.layer-row.active::before { content: ""; position: absolute; left: -4px; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--accent); }
.layer-row.hidden .layer-name { opacity: 0.45; text-decoration: line-through; }
.layer-kind { font: 700 11px var(--mono); color: var(--green); width: 14px; text-align: center; }
.layer-name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.layer-btn { width: 22px; height: 22px; border-radius: 6px; background: none; border: 0; color: var(--text-3); cursor: pointer; font-size: 12px; padding: 0; }
.layer-btn:hover { background: var(--surface-3); }
.layer-btn:hover { color: var(--text); }
.layer-del:hover { color: var(--red); }

.preset-row, .align-row, .scale-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 9px; align-items: center; }
.scale-value { font: 700 13px var(--mono); min-width: 40px; text-align: center; }
.stop-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 6px; align-items: end; }
.effect { border-top: 1px solid var(--hair); padding-top: 6px; margin-top: 6px; }
.effect-head .check { font: 600 11.5px var(--font); color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.sprite-source { font: 11px var(--mono); word-break: break-all; margin: 4px 0 8px; }

.font-picker { position: relative; }
.font-current { width: 100%; text-align: left; font-size: 18px; padding: 5px 9px; background: var(--surface-2); color: var(--text); border: 0; box-shadow: inset 0 0 0 1px var(--hair-2); border-radius: 7px; cursor: pointer; }
.font-pop {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface-3);
  border: 0; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  padding: 4px;
}
.font-group { font: 700 10px var(--mono); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; margin: 6px 4px 3px; }
.font-option { display: block; width: 100%; text-align: left; font-size: 20px; line-height: 1.3; padding: 3px 8px; background: none; color: var(--ink); border: 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-option:hover { background: var(--green-bg); color: var(--green); }
.font-option.active { color: var(--green); }

.starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.starter-card { display: flex; flex-direction: column; gap: 5px; padding: 7px; background: var(--surface-2); border: 0; box-shadow: inset 0 0 0 1px var(--hair); border-radius: var(--radius-sm); color: var(--text); cursor: pointer; text-align: left; font-size: 12px; }
.starter-card:hover { background: var(--surface-3); box-shadow: inset 0 0 0 1.5px var(--accent); }
.starter-thumb { min-height: 60px; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); }
.starter-canvas { width: 100%; height: auto; image-rendering: pixelated; display: block; }

@media (max-width: 1100px) {
  .studio-main { grid-template-columns: 230px minmax(260px, 1fr) 270px; }
}

.shape-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 8px; }
