:root {
  /* BACKGROUNDS */
  --bg: #080c14;
  --bg2: #0d1220;
  --surface: #0f1520;
  --border: rgba(255, 255, 255, 0.07);

  /* ACCENT COLORS */
  --accent: #4f8cff;
  --accent2: #a259ff;
  --gold: #f5c842;
  --green: #2dce7a;
  --red: #ff4d6d;

  /* TEXT */
  --text: #e8edf5;
  --muted: #6b7a99;

  /* LAYOUT */
  --nav-h: 64px;
  --topbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --page-pad: 20px;
  --grid-cols: 2;
  --card-w: 160px;

  /* BORDER RADIUS */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* FONTS */
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

#root {
  height: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  font-family: var(--font-body);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
}

input, textarea {
  font-family: var(--font-body);
  border: none;
  background: none;
  color: var(--text);
  outline: none;
}

img {
  display: block;
  max-width: 100%;
}

::-webkit-scrollbar {
  display: none;
}

/* Noise texture overlay */
.atmosphere-noise {
  position: fixed;
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* Glow orbs */
.atmosphere-glow-1 {
  position: fixed;
  width: 260px;
  height: 260px;
  top: -80px;
  left: -60px;
  background: radial-gradient(circle, rgba(79, 140, 255, 0.13), transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.atmosphere-glow-2 {
  position: fixed;
  width: 200px;
  height: 200px;
  top: 35%;
  right: -50px;
  background: radial-gradient(circle, rgba(162, 89, 255, 0.10), transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* Skeleton shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.06) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-lg);
}

/* Pulse animation for generating status */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Progress bar glow */
@keyframes progressGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(162, 89, 255, 0.4); }
  50% { box-shadow: 0 0 16px rgba(162, 89, 255, 0.6); }
}

/* ─── USAGE METER ─── */
.usage-meter {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 12px 0;
}

.usage-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 8px;
}

.usage-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 600ms ease;
}

.usage-remaining {
  font-size: 11px;
  font-weight: 300;
  color: var(--muted);
  text-align: right;
  margin-top: 6px;
}

.usage-limit-link {
  color: var(--accent);
  cursor: pointer;
}

/* ─── PROGRESS BAR ─── */
.progress-bar-container {
  width: 100%;
}

.progress-stage-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 400ms ease;
}

.progress-pct {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-align: right;
  margin-top: 6px;
}

/* ─── SCENE PREVIEW STRIP ─── */
@keyframes sceneCardIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.scene-preview-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 12px 0;
}

.scene-preview-card {
  flex-shrink: 0;
  width: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  animation: sceneCardIn 200ms ease both;
}

.scene-preview-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.scene-preview-placeholder {
  width: 80px;
  height: 80px;
  background: var(--surface);
}

.scene-preview-label {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  padding: 2px 4px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
