/* ==========================================================================
   SceneBoard — Dark Theme Stylesheet
   Vertical 9:16 Friendly, Responsive, Zero-Framework Plain CSS
   ========================================================================== */

:root {
  --bg-main: #0b0f17;
  --bg-card: #131926;
  --bg-card-hover: #182030;
  --bg-card-alt: #1a2236;
  --bg-input: #0e1420;
  --border-subtle: #222d42;
  --border-focus: #3b82f6;
  --border-accent: #f59e0b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #fbbf24;

  --accent-amber: #f59e0b;
  --accent-amber-hover: #d97706;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-red: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Platform shell (godfatherofai.com header/account/credits) — same tokens as productvideo */
  --bg: var(--bg-main);
  --border: var(--border-subtle);
  --border-hover: rgba(59, 130, 246, 0.4);
  --ok: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --brand: #1a56db;
  --brand-light: #3b82f6;
  --brand-cyan: #06b6d4;
  --font-headline: var(--font-sans);
  --font-body: var(--font-sans);

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
  --shadow-lg: 0 12px 36px -4px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-subtle);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 80px;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top Navigation Bar */
.navbar {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0;
}

.navbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  color: #0b0f17;
}

.brand-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 11px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--text-accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-amber);
  color: #0b0f17;
  border-color: var(--accent-amber);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-amber-hover);
  border-color: var(--accent-amber-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: #374151;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-outline:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: #4b5563;
  background: rgba(255, 255, 255, 0.03);
}

.btn-success {
  background: var(--accent-green);
  color: #0b0f17;
  border-color: var(--accent-green);
  font-weight: 700;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* Hero Section / Idea Input */
.hero-section {
  padding: 48px 0 32px 0;
  text-align: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-accent);
  margin-bottom: 14px;
  font-weight: 600;
}

.hero-heading {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px auto;
}

/* Idea Form Box */
.idea-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 820px;
  margin: 0 auto 24px auto;
  box-shadow: var(--shadow-card);
}

.input-row {
  display: flex;
  gap: 12px;
}
@media (max-width: 640px) {
  .input-row {
    flex-direction: column;
  }
  .input-row .btn {
    white-space: normal;
    width: 100%;
  }
}

.idea-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.18s ease;
}

.idea-input:focus {
  border-color: var(--accent-amber);
}

.idea-input::placeholder {
  color: var(--text-muted);
}

/* Inspiration Chips */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

.preset-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--text-accent);
}

/* Storyboard Header & Overview */
.story-header {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.story-meta-badge {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 8px;
}

.story-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: #ffffff;
}

.story-synopsis {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 24px;
  border-left: 3px solid var(--accent-amber);
  padding-left: 14px;
}

/* Cast Sheet */
.cast-sheet {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 16px;
}

.cast-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cast-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-accent);
}

.cast-badge {
  font-size: 11px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.cast-card {
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.cast-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cast-role {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: normal;
}

.cast-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

/* Sticky Action & Progress Bar */
.sticky-bar {
  position: sticky;
  top: 61px;
  z-index: 40;
  background: rgba(14, 20, 32, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.progress-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  max-width: 500px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.progress-text {
  color: var(--text-primary);
}

.progress-status {
  color: var(--text-accent);
}

.progress-track {
  height: 7px;
  background: #1e293b;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  border-radius: 9999px;
  width: 0%;
  transition: width 0.3s ease;
}

.render-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Scene Timeline / Sequence */
.scenes-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Scene Block Card */
.scene-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.scene-card.has-clip {
  border-color: rgba(16, 185, 129, 0.4);
}

.scene-header {
  background: var(--bg-card-alt);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.scene-number-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scene-number-badge {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.scene-duration-badge {
  background: rgba(245, 158, 11, 0.12);
  color: var(--text-accent);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

.scene-aspect-badge {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

.scene-body {
  padding: 22px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
}

@media (max-width: 860px) {
  .scene-body {
    grid-template-columns: 1fr;
  }
}

.scene-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-muted);
}

.detail-action {
  font-size: 14.5px;
  color: var(--text-primary);
  line-height: 1.55;
}

.detail-dialogue {
  background: rgba(14, 20, 32, 0.6);
  border-left: 2px solid var(--accent-amber);
  padding: 8px 12px;
  font-style: italic;
  font-size: 13.5px;
  color: #cbd5e1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.detail-camera {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Dense Prompt Box */
.prompt-box-wrapper {
  background: #090d14;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prompt-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a78bfa;
  display: flex;
  align-items: center;
  gap: 6px;
}

.prompt-text {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
  user-select: all;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  border-radius: var(--radius-sm);
  max-height: 110px;
  overflow-y: auto;
  word-break: break-word;
}

/* Upload Zone (Vertical 9:16 Optimized) */
.scene-upload-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-zone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(14, 20, 32, 0.5);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.upload-zone.dragover {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
}

.upload-zone.filled {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.5);
  padding: 0;
  background: #000;
}

.upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.upload-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  max-width: 220px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Video Preview inside Upload Zone */
.video-preview-wrapper {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.video-preview-player {
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: #000;
  border-radius: var(--radius-md);
}

.video-preview-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.clip-duration-tag {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  font-family: var(--font-mono);
}

.btn-remove-clip {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 600;
}

.btn-remove-clip:hover {
  background: #dc2626;
}

/* Modal for Render Final Cut */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* 9:16 Canvas Live Preview in Modal */
.render-preview-frame {
  width: 200px;
  height: 355px; /* 9:16 ratio */
  background: #000;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.render-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.render-status-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.render-status-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.render-progress-bar {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.render-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  width: 0%;
  transition: width 0.15s ease;
}

.modal-footer {
  padding: 16px 24px;
  background: var(--bg-card-alt);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Completed Player */
.completed-video-player {
  width: 220px;
  height: 390px; /* 9:16 */
  border-radius: var(--radius-md);
  background: #000;
  margin-bottom: 18px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer info */
.page-footer {
  margin-top: 60px;
  border-top: 1px solid var(--border-subtle);
  padding: 30px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.page-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.page-footer a:hover {
  color: var(--text-accent);
}

/* ==========================================================================
   Platform shell — header, account, credits (same pattern as /productvideo/)
   ========================================================================== */

.hidden {
  display: none !important;
}

/* Header Navbar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px auto 28px;
  max-width: 1240px;
  padding: 12px 24px;
  background: rgba(13, 19, 33, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .top {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-lg);
    gap: 12px;
    padding: 14px 18px;
    margin: 14px auto 20px;
  }
}

.top .brand {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: #fff;
}

.top nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .top nav { justify-content: center; gap: 4px; }
}

.top nav a {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.top nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.top nav a.nav-active {
  color: #fff;
  background: rgba(26, 86, 219, 0.28);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Account / credits row */
.user-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 auto 20px;
  max-width: 1240px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.user-row-left, .user-row-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.money-hint {
  opacity: 0.7;
  font-size: 0.8rem;
}

.pill {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill-warn {
  background: rgba(248, 113, 113, 0.15) !important;
  color: #fca5a5 !important;
  border-color: rgba(248, 113, 113, 0.45) !important;
}

.auth-banner {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin: 0 auto 24px;
  max-width: 1240px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-banner p { font-size: 0.95rem; color: #fca5a5; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.credits-low {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 0 auto 20px;
  max-width: 1240px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
}
.credits-low p { margin: 4px 0 0; color: var(--text-secondary); font-size: 0.9rem; max-width: 520px; }

.purchase-toast {
  margin: 0 auto 16px;
  max-width: 1240px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  font-weight: 600;
}

.btn.needs-credits {
  opacity: 0.95;
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
}

/* Credit packs modal */
.credits-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.credits-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}
.credits-modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  background: #0e121c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.credits-modal-card h2 { margin: 0 0 6px; font-size: 1.35rem; }
.credits-modal-x {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #a1a1aa;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.credit-packs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
@media (max-width: 640px) { .credit-packs { grid-template-columns: 1fr; } }
.credit-pack {
  position: relative;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 14px 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.credit-pack:hover { border-color: rgba(99, 102, 241, 0.6); transform: translateY(-1px); }
.credit-pack.best { border-color: rgba(99, 102, 241, 0.7); background: rgba(99, 102, 241, 0.12); }
.cp-badge {
  position: absolute;
  top: -9px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #6366f1;
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
}
.cp-name { display: block; font-size: 0.75rem; opacity: 0.7; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.cp-credits { display: block; font-size: 1.15rem; font-weight: 800; margin: 4px 0 2px; }
.cp-price { display: block; font-size: 1.05rem; font-weight: 700; color: #a5b4fc; }
.cp-note { display: block; font-size: 0.72rem; opacity: 0.6; margin-top: 6px; }
.checkout-status { color: #a5b4fc; margin-top: 12px; }

/* Admin-only: credits-per-generation control */
.admin-credit-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 auto 20px;
  max-width: 1240px;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.08);
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.admin-credit-panel input[type="number"] {
  width: 70px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
}
