/* Creepy Text Generator – Light Theme v4
   Heavy WordPress theme reset — prevents host theme from bleeding in. */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Inter:wght@300;400;500;600&display=swap');

/* ═══════════════════════════════════════════════
   NUCLEAR RESET — kills ANY WordPress theme style
   that touches elements inside #ctg-app
   ═══════════════════════════════════════════════ */
#ctg-app,
#ctg-app div,
#ctg-app span,
#ctg-app p,
#ctg-app h1,
#ctg-app h2,
#ctg-app h3,
#ctg-app ul,
#ctg-app li,
#ctg-app button,
#ctg-app input,
#ctg-app textarea,
#ctg-app label,
#ctg-app footer,
#ctg-app header {
  all: revert;
  box-sizing: border-box !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* After revert, lock the base */
#ctg-app *,
#ctg-app *::before,
#ctg-app *::after {
  box-sizing: border-box !important;
}

/* ── Root wrapper ── */
#ctg-app {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  background: #f7f7fb !important;
  color: #1a1a2e !important;
  position: relative !important;
  padding: 0 0 48px !important;
  margin: 0 !important;
  -webkit-font-smoothing: antialiased !important;
  line-height: 1.5 !important;
  width: 100% !important;
  overflow: visible !important;
  border: none !important;
  box-shadow: none !important;
}

/* kill any pseudo glow overlays left from dark theme */
#ctg-app::before,
#ctg-app::after { display: none !important; }
#ctg-bg3        { display: none !important; }
#ctg-inner      { position: relative !important; z-index: 1 !important; }

/* ── Header ── */
#ctg-header {
  text-align: center !important;
  padding: 48px 16px 28px !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

.ctg-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 0 14px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  color: #7c3aed !important;
  background: #ede9fe !important;
  border: 1px solid #ddd6fe !important;
  border-radius: 999px !important;
  padding: 5px 14px !important;
  line-height: 1 !important;
}

.ctg-badge svg {
  width: 11px !important;
  height: 11px !important;
  color: #dc2626 !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}

#ctg-title {
  font-family: 'Cinzel', serif !important;
  font-size: clamp(1.8rem, 5.5vw, 3rem) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  background: linear-gradient(135deg, #9b1c1c 0%, #be185d 45%, #6d28d9 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  border: none !important;
  box-shadow: none !important;
  text-align: center !important;
}

#ctg-subtitle {
  font-size: 15px !important;
  color: #6b7280 !important;
  max-width: 440px !important;
  margin: 0 auto !important;
  line-height: 1.7 !important;
  text-align: center !important;
  font-family: 'Inter', sans-serif !important;
  border: none !important;
}

/* ── Input section ── */
#ctg-input-section {
  max-width: 672px !important;
  margin: 0 auto 20px !important;
  padding: 0 16px !important;
}

.ctg-input-box {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05) !important;
}

/* ─── TEXTAREA — full override of WordPress theme ─── */
#ctg-app textarea#ctg-input,
#ctg-app .ctg-textarea {
  display: block !important;
  width: 100% !important;
  background: transparent !important;
  background-color: transparent !important;
  /* kill ALL borders the theme might set */
  border: none !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-left: none !important;
  border-image: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  /* kill theme left-bar accent */
  border-radius: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  /* typography */
  resize: none !important;
  color: #111827 !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
  padding: 18px 20px 12px !important;
  font-family: 'Inter', sans-serif !important;
  caret-color: #7c3aed !important;
  overflow: auto !important;
  min-height: 100px !important;
}

#ctg-app textarea#ctg-input::placeholder,
#ctg-app .ctg-textarea::placeholder {
  color: #9ca3af !important;
  opacity: 1 !important;
}

#ctg-app textarea#ctg-input:focus,
#ctg-app .ctg-textarea:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ── Controls bar ── */
.ctg-controls {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 10px 20px 14px !important;
  border: none !important;
  border-top: 1px solid #f3f4f6 !important;
  background: #fafafa !important;
  flex-wrap: wrap !important;
}

.ctg-intensity-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 1 !important;
  min-width: 180px !important;
}

.ctg-intensity-row svg {
  width: 15px !important;
  height: 15px !important;
  color: #d97706 !important;
  flex-shrink: 0 !important;
}

.ctg-intensity-label {
  font-size: 12px !important;
  color: #6b7280 !important;
  white-space: nowrap !important;
}

#ctg-app input[type="range"].ctg-slider {
  flex: 1 !important;
  max-width: 140px !important;
  accent-color: #dc2626 !important;
  cursor: pointer !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  -webkit-appearance: auto !important;
  appearance: auto !important;
}

.ctg-intensity-num {
  font-size: 12px !important;
  color: #6b7280 !important;
  min-width: 24px !important;
  text-align: right !important;
}

.ctg-char-count {
  font-size: 12px !important;
  color: #9ca3af !important;
  white-space: nowrap !important;
}

/* ── Hint ── */
.ctg-hint {
  text-align: center !important;
  font-size: 13px !important;
  color: #9ca3af !important;
  font-style: italic !important;
  margin: 0 0 20px !important;
  padding: 0 16px !important;
}

/* ── Grid wrapper ── */
#ctg-grid-wrap {
  max-width: 1152px !important;
  margin: 0 auto !important;
  padding: 0 16px !important;
}

.ctg-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 14px !important;
  list-style: none !important;
}

@media (min-width: 560px) {
  .ctg-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (min-width: 860px) {
  .ctg-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ── Card ── */
.ctg-card {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.04) !important;
  transition: box-shadow 0.18s, border-color 0.18s !important;
  padding: 0 !important;
  margin: 0 !important;
}

.ctg-card:hover {
  border-color: #c4b5fd !important;
  box-shadow: 0 2px 8px rgba(109,40,217,0.09), 0 4px 20px rgba(109,40,217,0.06) !important;
}

.ctg-card-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 14px 14px 6px !important;
  background: transparent !important;
  border: none !important;
}

.ctg-card-meta {
  flex: 1 !important;
  min-width: 0 !important;
}

.ctg-card-title-row {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  flex-wrap: wrap !important;
}

.ctg-card-name {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #111827 !important;
  line-height: 1.3 !important;
  font-family: 'Inter', sans-serif !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Tags ── */
.ctg-tag {
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  border: 1px solid transparent !important;
  line-height: 1.5 !important;
  display: inline-block !important;
  font-family: 'Inter', sans-serif !important;
}

.ctg-tag-CURSED { background: #fee2e2 !important; color: #991b1b !important; border-color: #fecaca !important; }
.ctg-tag-HORROR { background: #fef2f2 !important; color: #b91c1c !important; border-color: #fecaca !important; }
.ctg-tag-DARK   { background: #ede9fe !important; color: #5b21b6 !important; border-color: #ddd6fe !important; }
.ctg-tag-GOTHIC { background: #f3f4f6 !important; color: #374151 !important; border-color: #d1d5db !important; }
.ctg-tag-SCRIPT { background: #eef2ff !important; color: #3730a3 !important; border-color: #c7d2fe !important; }
.ctg-tag-RANSOM { background: #fffbeb !important; color: #92400e !important; border-color: #fde68a !important; }
.ctg-tag-FLIP   { background: #ecfeff !important; color: #0e7490 !important; border-color: #a5f3fc !important; }
.ctg-tag-WIDE   { background: #ecfdf5 !important; color: #065f46 !important; border-color: #a7f3d0 !important; }
.ctg-tag-CAPS   { background: #fdf2f8 !important; color: #9d174d !important; border-color: #fbcfe8 !important; }
.ctg-tag-HOLLOW { background: #eff6ff !important; color: #1e40af !important; border-color: #bfdbfe !important; }
.ctg-tag-GLITCH { background: #fefce8 !important; color: #713f12 !important; border-color: #fde68a !important; }
.ctg-tag-SHADOW { background: #f5f3ff !important; color: #4c1d95 !important; border-color: #ddd6fe !important; }

.ctg-card-desc {
  font-size: 11px !important;
  color: #9ca3af !important;
  margin: 3px 0 0 !important;
  line-height: 1.45 !important;
  font-family: 'Inter', sans-serif !important;
}

/* ── Action buttons ── */
.ctg-card-actions {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  flex-shrink: 0 !important;
}

#ctg-app .ctg-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  transition: all 0.15s !important;
  white-space: nowrap !important;
  background: #f9fafb !important;
  color: #6b7280 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

#ctg-app .ctg-btn svg {
  width: 11px !important;
  height: 11px !important;
}

#ctg-app .ctg-btn-regen { padding: 6px 7px !important; }
#ctg-app .ctg-btn-copy  { padding: 6px 10px !important; }

#ctg-app .ctg-btn:hover {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border-color: #d1d5db !important;
}

#ctg-app .ctg-btn-copy.ctg-copied {
  background: #7c3aed !important;
  color: #fff !important;
  border-color: #7c3aed !important;
}

#ctg-app .ctg-btn:disabled {
  opacity: 0.35 !important;
  cursor: default !important;
  pointer-events: none !important;
}

/* ── Output box ── */
.ctg-card-body {
  padding: 0 14px 14px !important;
}

.ctg-output {
  min-height: 62px !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
  line-height: 1.75 !important;
  word-break: break-all !important;
  overflow-wrap: break-word !important;
  letter-spacing: 0.02em !important;
  background: #f9fafb !important;
  border: 1px solid #f3f4f6 !important;
  color: #111827 !important;
  cursor: text !important;
  -webkit-user-select: all !important;
  user-select: all !important;
  transition: background 0.15s !important;
  font-family: 'Inter', sans-serif !important;
  overflow: visible !important;
  /* Prevent host theme from clipping unicode output */
  white-space: pre-wrap !important;
  text-overflow: clip !important;
  display: block !important;
}

.ctg-output:hover {
  background: #f3f4f6 !important;
  border-color: #e5e7eb !important;
}

.ctg-output.ctg-empty {
  color: #9ca3af !important;
  font-style: italic !important;
  font-size: 12px !important;
  display: flex !important;
  align-items: center !important;
  white-space: normal !important;
}

/* ── Footer ── */
#ctg-footer {
  text-align: center !important;
  padding: 32px 0 0 !important;
  font-size: 11px !important;
  color: #d1d5db !important;
  font-family: 'Inter', sans-serif !important;
  background: transparent !important;
  border: none !important;
}

/* ── Spin animation ── */
@keyframes ctg-spin { to { transform: rotate(360deg); } }
