:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --accent: #38bdf8;
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  --border: #475569;
  --success: #22c55e;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  padding: 1.5rem;
}

.studio-container {
  max-width: 1400px;
  margin: 0 auto;
}

.studio-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.brand h1 {
  font-family: 'Fredoka', cursive;
  font-size: 2rem;
  letter-spacing: 0.5px;
}

.badge {
  background: var(--primary);
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.studio-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.studio-main {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .studio-main {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
}

.card-header h2 {
  font-size: 1.15rem;
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

textarea, select, input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

textarea:focus, select:focus {
  border-color: var(--primary);
}

.row {
  display: flex;
  gap: 1rem;
}

.primary-btn {
  background: var(--primary);
  color: #000;
  font-weight: 800;
  font-size: 1rem;
  border: none;
  padding: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s, transform 0.1s;
}

.primary-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.scenes-timeline {
  margin-top: 1.25rem;
  border-top: 1px dashed var(--border);
  padding-top: 1rem;
}

.scenes-timeline h3 {
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

.scene-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
}

.scene-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
}

/* Canvas Viewport */
.canvas-viewport {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-wrapper {
  width: 100%;
  height: 100%;
}

#animationCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.player-controls {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.action-btn {
  background: var(--bg-input);
  color: var(--text-light);
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.action-btn:disabled, .export-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.export-btn {
  margin-left: auto;
  background: var(--success);
  color: #fff;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: var(--bg-input);
  color: var(--text-muted);
}

.export-progress {
  margin-top: 1rem;
  height: 24px;
  background: var(--bg-input);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.15s;
}

#exportText {
  position: relative;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
}

.hidden {
  display: none !important;
}
