/* ── Reset & Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563EB;
  --primary-light: #3B82F6;
  --primary-dark: #1D4ED8;
  --accent: #FF6B6B;
  --accent2: #FFC65A;
  --accent3: #4ECDC4;
  --success: #22C55E;
  --bg: #EFF6FF;
  --bg2: #DBEAFE;
  --surface: #FFFFFF;
  --text: #1E1B2E;
  --text-muted: #6B6790;
  --border: #BFDBFE;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(37, 99, 235, 0.12);
  --shadow-lg: 0 8px 40px rgba(37, 99, 235, 0.18);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito Sans', 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Screens ─────────────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* ── Nav ─────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 18px; font-weight: 800; color: var(--primary);
  letter-spacing: -0.3px;
}
.nav-actions { display: flex; gap: 8px; }
.nav-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s;
}
.nav-btn:hover { background: var(--bg2); color: var(--primary); border-color: var(--primary); }

/* ── HOME SCREEN ─────────────────────────────────────────────────── */
.home-hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 50%, #E0F2FE 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
}
.hero-content {
  max-width: 680px; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 20px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; border-radius: 100px;
  padding: 6px 16px; font-size: 13px; font-weight: 700;
  letter-spacing: 0.2px;
}
.logo-area {
  display: flex; align-items: center; gap: 14px; justify-content: center;
}
.logo-spotlight { font-size: 56px; line-height: 1; filter: drop-shadow(0 4px 12px rgba(37,99,235,0.3)); }
.logo-title {
  font-family: 'Nunito', sans-serif;
  font-size: 52px; font-weight: 900; color: var(--primary);
  letter-spacing: -1.5px; line-height: 1;
}
.hero-subtitle {
  font-size: 24px; font-weight: 700; color: var(--text);
  letter-spacing: -0.4px;
}
.hero-desc {
  font-size: 16px; color: var(--text-muted);
  max-width: 480px; line-height: 1.6;
}
.hero-desc em { color: var(--primary); font-style: normal; font-weight: 700; }

/* Form Card */
.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  width: 100%;
}
.home-form { text-align: left; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 13px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.optional-tag {
  font-size: 11px; background: var(--bg2); color: var(--text-muted);
  padding: 2px 8px; border-radius: 100px;
  text-transform: none; font-weight: 600; letter-spacing: 0;
  margin-left: 6px; vertical-align: middle;
}
.topic-textarea {
  width: 100%; border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 16px; font-family: inherit;
  color: var(--text); background: var(--bg);
  resize: vertical; transition: border-color 0.2s;
  line-height: 1.5;
}
.topic-textarea:focus {
  outline: none; border-color: var(--primary);
  background: white; box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-input {
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--bg);
  transition: border-color 0.2s; width: 100%;
}
.form-input:focus { outline: none; border-color: var(--primary); background: white; }
.form-select {
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--bg);
  cursor: pointer; width: 100%; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6790' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.form-select:focus { outline: none; border-color: var(--primary); background-color: white; }
.form-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px;
}
.home-form { display: flex; flex-direction: column; gap: 20px; }

.btn-generate {
  width: 100%; padding: 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white; border: none; border-radius: var(--radius-sm);
  font-size: 18px; font-weight: 800; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all 0.25s; letter-spacing: -0.2px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.btn-secondary {
  padding: 10px 20px;
  background: white; color: var(--primary);
  border: 2px solid var(--primary); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--bg2); }

.examples-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.examples-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.example-chip {
  background: white; border: 1.5px solid var(--border);
  border-radius: 100px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s;
  font-family: inherit;
}
.example-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--bg2); }

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SCENE SCREEN ────────────────────────────────────────────────── */
.scene-layout {
  min-height: 100vh; padding-top: 60px;
}
.scene-sidebar {
  background: white; border-right: 1px solid var(--border);
  padding: 24px 12px; display: flex; flex-direction: column; gap: 4px;
  position: fixed; top: 60px; bottom: 0; left: 0; width: 220px;
  overflow-y: auto;
}
.scene-nav-item {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s;
}
.scene-nav-item:hover { background: var(--bg2); color: var(--primary); }
.scene-nav-item.active { background: var(--bg2); color: var(--primary); }
.scene-nav-item.back-btn { color: var(--text-muted); font-weight: 600; }
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: 8px 4px; }

.scene-main {
  margin-left: 220px; padding: 40px 48px;
  max-width: calc(1200px + 220px); min-height: 100vh;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.scene-header { margin-bottom: 32px; }
.scene-badge-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.scene-badge {
  padding: 4px 12px; border-radius: 100px; font-size: 12px; font-weight: 700;
  background: var(--bg2); color: var(--primary); border: 1px solid var(--border);
}
.scene-badge.grade { background: #FFF3E0; color: #E65100; border-color: #FFE0B2; }
.scene-badge.students { background: #E8F5E9; color: #2E7D32; border-color: #C8E6C9; }

.scene-title {
  font-family: 'Nunito', sans-serif;
  font-size: 36px; font-weight: 900; color: var(--text);
  letter-spacing: -1px; line-height: 1.1; margin-bottom: 12px;
}
.scene-summary {
  font-size: 17px; color: var(--text-muted); line-height: 1.65; max-width: 680px;
}

.teacher-intro-box {
  background: linear-gradient(135deg, #FFF3E0, #FFF8E1);
  border: 1.5px solid #FFE0B2; border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 32px;
}
.teacher-intro-label { font-size: 12px; font-weight: 800; color: #E65100; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.8px; }
.teacher-intro-box p { font-size: 15px; color: #5D4037; line-height: 1.65; }

.section-title {
  font-family: 'Nunito', sans-serif;
  font-size: 22px; font-weight: 800; color: var(--text);
  margin-bottom: 20px;
}
.section-desc { font-size: 15px; color: var(--text-muted); margin-bottom: 24px; margin-top: -8px; }

.characters-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}
.character-card {
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: all 0.2s; position: relative; overflow: hidden;
}
.character-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent3));
}
.character-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.char-emoji { font-size: 32px; margin-bottom: 10px; }
.char-name {
  font-family: 'Nunito', sans-serif;
  font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 6px;
}
.char-role { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; }
.char-sample-line {
  background: var(--bg); border-radius: 8px; padding: 10px 12px;
  font-size: 13px; color: var(--text-muted); font-style: italic;
  border-left: 3px solid var(--primary);
}

/* Script — full play format */
.script-list { display: flex; flex-direction: column; gap: 0; max-width: 680px; }
.script-line {
  padding: 10px 24px 10px 24px;
  background: white;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.script-line:nth-child(even) { background: #FAFAFA; }
.script-line:hover { border-left-color: var(--primary); background: var(--bg2); }
.script-line.highlighted { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); border-left-color: var(--primary); }
.script-char {
  font-size: 12px; font-weight: 900; color: var(--primary);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 2px;
}
.script-direction {
  font-size: 13px; color: var(--text-muted); font-style: italic;
  margin-bottom: 4px; display: block;
}
.script-text { font-size: 16px; color: var(--text); line-height: 1.6; }
.script-scene-break {
  text-align: center; font-size: 12px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
  padding: 16px 0 8px; border-top: 1px solid var(--border); margin-top: 8px;
}

/* Roles */
.roles-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.role-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: center;
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.role-char-name { font-size: 15px; font-weight: 800; color: var(--primary); }
.role-char-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.role-input {
  border: 2px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--bg); width: 100%;
  transition: border-color 0.2s;
}
.role-input:focus { outline: none; border-color: var(--primary); background: white; }

/* Costumes */
.tab-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.tab-header-row .section-title { margin-bottom: 0; }
.costumes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.costume-card {
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 0; transition: all 0.2s; overflow: hidden;
}
.costume-img-wrap { position: relative; }
.costume-card .costume-img {
  width: 100%; height: 260px; object-fit: contain;
  display: block; border-bottom: 1.5px solid var(--border);
  background: #FAFAFA; padding: 8px;
}
.costume-print-img-btn {
  position: absolute; bottom: 10px; right: 10px;
  background: var(--primary); color: white;
  border: none; border-radius: 8px; padding: 7px 14px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; opacity: 0; transition: opacity 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.costume-img-wrap:hover .costume-print-img-btn { opacity: 1; }
.costume-img-placeholder {
  height: 160px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: var(--bg); border-bottom: 1.5px solid var(--border);
}
.char-placeholder-emoji { font-size: 48px; }
.costume-img-missing { font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.5; }
.costume-card .costume-char-name,
.costume-card .costume-color-scheme,
.costume-card .costume-items,
.costume-card .costume-tip,
.costume-card .costume-badge-btn { padding-left: 24px; padding-right: 24px; }
.costume-card .costume-char-name { padding-top: 20px; }
.costume-card .costume-badge-btn { padding-bottom: 20px; margin-top: 12px; }
.costume-card:hover { box-shadow: var(--shadow); }
.costume-char-name { font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.costume-color-scheme {
  display: inline-block; font-size: 12px; font-weight: 700;
  background: var(--bg2); color: var(--primary); padding: 3px 10px;
  border-radius: 100px; margin-bottom: 14px;
}
.costume-items { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.costume-items li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 14px; color: var(--text);
}
.costume-items li::before { content: '•'; color: var(--primary); font-weight: 900; flex-shrink: 0; margin-top: 1px; }
.costume-tip {
  background: #FFF8E1; border: 1px solid #FFE0B2; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; color: #5D4037;
}
.costume-tip::before { content: '💡 '; }
.costume-badge-btn {
  margin-top: 12px; width: 100%;
  background: none; border: 1.5px dashed var(--border); border-radius: 8px;
  padding: 10px; font-size: 13px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.costume-badge-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Set */
.set-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 2px solid var(--border); padding-bottom: -1px; }
.set-tab-btn {
  padding: 10px 20px; background: none; border: none;
  font-size: 15px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 3px solid transparent; margin-bottom: -2px; font-family: inherit;
  transition: all 0.15s;
}
.set-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.set-panel { display: none; }
.set-panel.active { display: block; }
.projection-bg {
  border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
  border: 2px solid var(--border); position: relative; background: #0d0b1e;
  min-height: 240px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.projection-img {
  width: 100%; display: block; border-radius: var(--radius);
  max-height: 420px; object-fit: cover;
}
.projection-download {
  position: absolute; bottom: 12px; right: 12px;
  background: rgba(0,0,0,0.6); color: white; border-radius: 8px;
  padding: 7px 14px; font-size: 13px; font-weight: 700; text-decoration: none;
  backdrop-filter: blur(4px); transition: background 0.2s;
}
.projection-download:hover { background: rgba(0,0,0,0.85); }
.projection-placeholder {
  text-align: center; padding: 40px 32px;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.proj-placeholder-icon { font-size: 40px; }
.proj-placeholder-title { font-size: 16px; font-weight: 800; color: rgba(255,255,255,0.7); }
.proj-placeholder-desc { font-size: 14px; color: rgba(255,255,255,0.45); max-width: 440px; line-height: 1.6; }
.proj-billing-note {
  background: rgba(255,193,7,0.15); border: 1px solid rgba(255,193,7,0.3);
  border-radius: 8px; padding: 10px 16px; font-size: 13px;
  color: #FFD54F; max-width: 420px; line-height: 1.5;
}
.proj-billing-note strong { color: #FFE082; }
.bg-description {
  font-size: 15px; color: var(--text); background: white;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 20px; line-height: 1.6;
}
.build-steps { display: flex; flex-direction: column; gap: 14px; }
.build-step {
  display: grid; grid-template-columns: 40px 1fr; gap: 16px; align-items: start;
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px;
}
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; flex-shrink: 0;
}
.step-instruction { font-size: 15px; color: var(--text); line-height: 1.5; margin-bottom: 6px; }
.step-materials { display: flex; gap: 6px; flex-wrap: wrap; }
.step-material {
  font-size: 12px; font-weight: 600; background: var(--bg2); color: var(--primary);
  padding: 3px 10px; border-radius: 100px;
}
.time-estimate { font-size: 14px; color: var(--text-muted); margin-top: 12px; display: flex; align-items: center; gap: 6px; }
.props-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.prop-card {
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px;
}
.prop-name { font-weight: 800; color: var(--text); margin-bottom: 4px; }
.prop-how { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.5; }
.prop-char { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--bg2); display: inline-block; padding: 2px 10px; border-radius: 100px; }

/* Empty State */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 16px; line-height: 1.6; }

/* ── LIBRARY ─────────────────────────────────────────────────────── */
.page-layout { max-width: 1100px; margin: 0 auto; padding: 84px 32px 48px; }
.page-header { margin-bottom: 32px; }
.page-title {
  font-family: 'Nunito', sans-serif; font-size: 36px; font-weight: 900;
  color: var(--text); letter-spacing: -1px; margin-bottom: 8px;
}
.page-desc { font-size: 16px; color: var(--text-muted); }
.library-filters { display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.library-filters .form-input { flex: 1; min-width: 200px; }
.library-filters .form-select { min-width: 140px; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.library-card {
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 24px; cursor: pointer; transition: all 0.2s;
}
.library-card:hover { box-shadow: var(--shadow); border-color: var(--primary); transform: translateY(-2px); }
.lib-subject { font-size: 12px; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.lib-title { font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 8px; line-height: 1.2; }
.lib-summary { font-size: 14px; color: var(--text-muted); line-height: 1.55; margin-bottom: 14px; }
.lib-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-tag {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 100px;
  background: var(--bg2); color: var(--text-muted);
}

/* ── MUSIC ───────────────────────────────────────────────────────── */
.music-form { margin-bottom: 28px; display: flex; flex-direction: column; gap: 20px; }
.music-form .form-row { grid-template-columns: 1fr 1fr; }
.music-result { }
.music-card {
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 32px; margin-bottom: 20px;
}
.music-title { font-family: 'Nunito', sans-serif; font-size: 28px; font-weight: 900; color: var(--text); margin-bottom: 4px; }
.music-tune-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg2); color: var(--primary); font-size: 13px; font-weight: 700;
  padding: 4px 12px; border-radius: 100px; margin-bottom: 24px;
}
.music-verse { margin-bottom: 24px; }
.music-verse-num {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 10px;
}
.music-lyrics { font-size: 18px; color: var(--text); line-height: 2; font-weight: 600; }
.music-action {
  background: #FFF8E1; border: 1px solid #FFE0B2; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; color: #5D4037; margin-top: 8px; display: inline-block;
}
.music-chorus { background: var(--bg2); border-radius: var(--radius-sm); padding: 20px 24px; margin-bottom: 24px; }
.music-chorus .music-verse-num { color: var(--primary); }
.teaching-tip-box {
  background: #E8F5E9; border: 1px solid #C8E6C9; border-radius: var(--radius-sm);
  padding: 16px 20px; font-size: 14px; color: #2E7D32; line-height: 1.6;
}
.teaching-tip-box::before { content: '🌟 Teacher Tip: '; font-weight: 800; }

/* ── RESOURCES ───────────────────────────────────────────────────── */
.resources-result { display: flex; flex-direction: column; gap: 20px; }
.resource-suggestion {
  background: white; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 28px;
  transition: all 0.2s; cursor: pointer;
}
.resource-suggestion:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.res-title { font-family: 'Nunito', sans-serif; font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.res-subject-badge {
  font-size: 12px; font-weight: 800; color: var(--primary); text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 10px; display: block;
}
.res-concept { font-size: 15px; color: var(--text-muted); line-height: 1.65; margin-bottom: 14px; }
.res-why { font-size: 14px; color: var(--text); background: var(--bg2); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.res-characters { display: flex; gap: 8px; flex-wrap: wrap; }
.res-char-tag {
  background: #EFF6FF; border: 1px solid #BFDBFE; color: var(--primary);
  font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 100px;
}
.use-this-btn {
  margin-top: 16px; padding: 10px 20px;
  background: var(--primary); color: white;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.use-this-btn:hover { background: var(--primary-dark); }

/* ── TOAST ───────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1E1B2E; color: white;
  padding: 14px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; z-index: 999;
  animation: slideUp 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } }

/* ── Print Modal ─────────────────────────────────────────────────── */
.print-modal {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.print-modal.hidden { display: none; }
.print-modal-inner {
  background: white; border-radius: var(--radius); max-width: 600px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
#print-modal-body { padding: 32px; }
.print-modal-actions {
  display: flex; gap: 12px; padding: 20px 32px;
  border-top: 1px solid var(--border); background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Badge styles (used inside print-modal-body) */
.badge-print {
  text-align: center; font-family: 'Nunito', Arial, sans-serif;
}
.badge-print .bp-logo { font-size: 11px; color: #2563EB; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.badge-print .bp-img { width: 160px; height: 160px; object-fit: cover; border-radius: 16px; margin: 8px auto; display: block; border: 3px solid var(--border); }
.badge-print .bp-emoji { font-size: 72px; margin: 8px 0; display: block; }
.badge-print .bp-label { font-size: 12px; color: #999; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.badge-print .bp-name { font-size: 36px; font-weight: 900; color: #1E1B2E; margin-bottom: 6px; }
.badge-print .bp-desc { font-size: 14px; color: #6B6790; line-height: 1.6; max-width: 280px; margin: 0 auto 16px; }
.badge-print .bp-cut { border-top: 2px dashed #BFDBFE; padding-top: 12px; font-size: 12px; color: #bbb; margin-top: 8px; }

/* Character cut-out styles */
.char-cutout { text-align: center; font-family: 'Nunito', Arial, sans-serif; }
.char-cutout .cc-header { font-size: 12px; color: #2563EB; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.char-cutout .cc-name { font-size: 32px; font-weight: 900; color: #1E1B2E; margin-bottom: 4px; }
.char-cutout .cc-instructions { font-size: 13px; color: #999; margin-bottom: 16px; }
.char-cutout .cc-border {
  display: inline-block; border: 3px dashed #2563EB; border-radius: 16px;
  padding: 12px; margin-bottom: 12px;
}
.char-cutout .cc-border img { width: 440px; max-width: 100%; display: block; border-radius: 8px; }

/* ── Print ───────────────────────────────────────────────────────── */
@media print {
  /* When printing from the modal, hide everything except the modal body */
  body > *:not(#print-modal) { display: none !important; }
  #print-modal { position: static !important; background: none !important; padding: 0 !important; display: block !important; }
  .print-modal-inner { box-shadow: none !important; max-height: none !important; border-radius: 0 !important; }
  .no-print, .print-modal-actions { display: none !important; }

  /* When printing other pages without the modal open */
  .print-modal.hidden ~ * .nav,
  .nav, .scene-sidebar, .btn-generate, .btn-secondary { display: none !important; }
  .scene-main { margin-left: 0 !important; padding: 24px !important; }
  .tab-content { display: block !important; }
}

/* ── Voice + Lesson Plan Upload Row ─────────────────────────────── */
.voice-upload-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 4px 0;
}
.voice-record-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: white; border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px;
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; font-family: inherit; transition: all 0.2s; flex-shrink: 0;
}
.voice-record-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--bg2); }
.voice-record-btn.voice-active {
  background: #FFF0F0; border-color: #FF6B6B; color: #FF6B6B;
  animation: pulse-border 1.2s ease infinite;
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255,107,107,0); }
}
.or-text {
  font-size: 12px; font-weight: 600; color: var(--text-muted); flex-shrink: 0;
}
.upload-plan-label {
  display: inline-flex; align-items: center; gap: 8px;
  background: white; border: 2px dashed var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px;
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.upload-plan-label:hover { border-color: var(--primary); color: var(--primary); background: var(--bg2); }
.lesson-plan-name {
  font-size: 12px; font-weight: 700; color: var(--success);
  background: #E8F5E9; padding: 4px 12px; border-radius: 100px;
}

/* ── Tab Header Actions ──────────────────────────────────────────── */
.tab-header-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

/* ── Drawing Upload Section ──────────────────────────────────────── */
.drawing-upload-section {
  margin-top: 32px; padding: 24px;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--bg); text-align: center;
}
.drawing-upload-title {
  font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 6px;
}
.drawing-upload-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; max-width: 480px; margin-left: auto; margin-right: auto;
}
.drawing-upload-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: white; border: 2px solid var(--primary);
  border-radius: var(--radius-sm); padding: 10px 22px;
  font-size: 14px; font-weight: 700; color: var(--primary);
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.drawing-upload-btn:hover { background: var(--bg2); }

/* ── Drawing Result ──────────────────────────────────────────────── */
.drawing-result { margin-top: 4px; text-align: left; }
.drawing-analyzing {
  padding: 24px; text-align: center;
  font-size: 15px; color: var(--text-muted); font-weight: 600;
}
.drawing-error {
  padding: 16px; text-align: center; border-radius: var(--radius-sm);
  font-size: 14px; color: #c0392b; background: #fdf2f2; border: 1px solid #f5c6cb;
}
.drawing-result-card {
  display: grid; grid-template-columns: 160px 1fr; gap: 20px;
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-top: 16px;
}
.drawing-student-img img {
  width: 140px; height: 140px; object-fit: contain;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: white; display: block;
}
.drawing-img-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-align: center; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.drawing-encouragement {
  font-size: 13px; font-weight: 700; color: var(--primary);
  background: var(--bg2); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px;
}
.drawing-description {
  font-size: 13px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.6;
}
.drawing-inspired-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--primary); margin-bottom: 6px;
}
.drawing-char-name {
  font-family: 'Nunito', sans-serif; font-size: 17px; font-weight: 800;
  color: var(--text); margin-bottom: 4px;
}
.drawing-color {
  font-size: 12px; font-weight: 700; color: var(--primary);
  background: var(--bg2); display: inline-block; padding: 2px 10px;
  border-radius: 100px; margin-bottom: 8px;
}
.drawing-set-desc { font-size: 13px; color: var(--text); margin-bottom: 8px; line-height: 1.5; }
.drawing-items { list-style: none; margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.drawing-items li { font-size: 13px; color: var(--text); }
.drawing-items li::before { content: '• '; color: var(--primary); }
.drawing-tip {
  font-size: 12px; background: #FFF8E1; border: 1px solid #FFE0B2;
  border-radius: 8px; padding: 8px 12px; color: #5D4037; margin-bottom: 8px;
}

/* ── Script Edit Mode ────────────────────────────────────────────── */
.script-editable {
  outline: 2px solid var(--primary) !important;
  border-radius: 4px; padding: 2px 4px; cursor: text;
  min-height: 1em; background: #FAFEFF;
}
.script-direction-editable {
  outline: 1px dashed #FFB74D !important;
  border-radius: 3px; cursor: text;
}

/* ── Resource Image Upload ───────────────────────────────────────── */
.resource-upload-hint {
  font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px;
}
.resource-img-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: border-color 0.2s;
  min-height: 80px; display: flex; flex-direction: column; align-items: center;
}
.resource-img-upload-area:hover { border-color: var(--primary); }
.resource-img-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px; cursor: pointer; text-align: center;
}
.resource-upload-icon { font-size: 32px; }
.resource-upload-text { font-size: 14px; font-weight: 700; color: var(--text-muted); }
.resource-upload-sub { font-size: 12px; color: var(--text-muted); }
.resource-img-previews {
  display: flex; flex-wrap: wrap; gap: 10px; width: 100%;
}
.resource-img-thumb {
  width: 90px; height: 90px; border-radius: 10px; overflow: hidden;
  border: 2px solid var(--border); position: relative; flex-shrink: 0;
}
.resource-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.resource-img-remove {
  position: absolute; top: 3px; right: 3px;
  background: rgba(0,0,0,0.55); color: white; border: none;
  border-radius: 50%; width: 20px; height: 20px;
  font-size: 13px; font-weight: 900; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.resource-img-remove:hover { background: rgba(200,0,0,0.8); }
.resource-img-add {
  width: 90px; height: 90px; border-radius: 10px;
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s; flex-shrink: 0; flex-direction: column;
  gap: 4px;
}
.resource-img-add:hover { border-color: var(--primary); color: var(--primary); background: var(--bg2); }

/* ── Prop image ──────────────────────────────────────────────────── */
.prop-img-wrap { margin-bottom: 8px; }
.prop-img {
  width: 100%; height: 120px; object-fit: contain;
  border-radius: 8px; background: #FAFAFA; border: 1px solid var(--border);
  display: block;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .scene-sidebar { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; top: auto; bottom: auto; }
  .scene-main { margin-left: 0; padding: 24px; }
  .logo-title { font-size: 38px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .logo-area { flex-direction: column; gap: 8px; }
  .logo-title { font-size: 32px; }
  .hero-subtitle { font-size: 20px; }
  .card { padding: 20px; }
}
