:root {
  --bg-color: #070709;
  --text-primary: #f0f0f5;
  --text-secondary: #c5c5d0;
  --text-muted: #9e9ea9;
  --accent-glow: linear-gradient(135deg, #ff007a, #7928ca, #4200ff);
  --card-bg: rgba(255, 255, 255, 0.035);
  --card-border: rgba(255, 255, 255, 0.09);
  --code-bg: rgba(255, 0, 122, 0.08);
  --code-border: rgba(255, 0, 122, 0.25);
  --pink-accent: #ff007a;
  --pink-light: #ff3399;
  --danger-accent: #ff3366;
  --success-glow: linear-gradient(135deg, #00e676, #00b0ff);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 2.5rem 1rem;
}

/* Ambient Background Orbs */
.glow-orb {
  position: fixed;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(121, 40, 202, 0.18) 0%, rgba(0,0,0,0) 70%);
  top: -300px;
  left: -250px;
  z-index: 0;
  animation: float 12s ease-in-out infinite alternate;
  pointer-events: none;
}

.glow-orb-2 {
  position: fixed;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(255, 0, 122, 0.15) 0%, rgba(0,0,0,0) 70%);
  bottom: -300px;
  right: -250px;
  z-index: 0;
  animation: float 16s ease-in-out infinite alternate-reverse;
  pointer-events: none;
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Navigation Bar */
nav {
  position: relative;
  z-index: 2;
  width: 95%;
  max-width: 1100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 2rem 0;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  text-decoration: none;
}

.nav-logo span {
  background: var(--accent-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main Glass Container */
.container {
  position: relative;
  z-index: 2;
  width: 95%;
  max-width: 1100px;
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 3.5rem 3rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  margin-bottom: 2rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.app-name {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffffff 30%, #a5a5a5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-name .accent {
  background: var(--accent-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 300;
  max-width: 680px;
  margin: 0 auto;
}

/* Settings Glass Panel */
.glass-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 1.75rem;
  margin-bottom: 1.75rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

label span {
  color: var(--pink-light);
  font-weight: 600;
}

input[type="text"], select {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.3s;
  width: 100%;
}

input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--pink-accent);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 12px rgba(255, 0, 122, 0.25);
}

select option {
  background: #070709;
  color: var(--text-primary);
}

/* Custom Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  outline: none;
  margin-top: 14px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pink-light);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 0, 122, 0.5);
  transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Drag and Drop Zone */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  margin-bottom: 1.5rem;
}

.upload-icon-wrapper {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.upload-icon {
  width: 32px;
  height: 32px;
  color: var(--pink-light);
}

.drop-zone-text {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 500;
}

.drop-zone:hover {
  border-color: var(--pink-accent);
  background: rgba(255, 0, 122, 0.05);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255, 0, 122, 0.15);
}

.drop-zone:hover .upload-icon-wrapper {
  transform: scale(1.15) rotate(5deg);
  border-color: rgba(255, 0, 122, 0.4);
}

/* Status Indicator */
.status-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 0, 122, 0.1);
  border: 1px solid var(--code-border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--pink-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.status-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--pink-light);
}

/* Action Toolbar */
.action-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  padding: 1.25rem 1.75rem;
  border-radius: 18px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.rendered-info {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.rendered-info span {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
  margin-left: 4px;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Action Buttons */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

.cta-button.primary-download {
  background: linear-gradient(135deg, #ff007a, #7928ca);
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(255, 0, 122, 0.35);
}

.cta-button.primary-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(255, 0, 122, 0.55);
  background: linear-gradient(135deg, #ff1a8c, #8a3bd8);
}

.cta-button.danger-ghost {
  background: rgba(255, 51, 102, 0.08);
  color: var(--danger-accent);
  border: 1px solid rgba(255, 51, 102, 0.25);
}

.cta-button.danger-ghost:hover {
  background: rgba(255, 51, 102, 0.18);
  border-color: rgba(255, 51, 102, 0.45);
}

/* Rendered Preview Cards Grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.preview-grid canvas,
.preview-grid img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-grid canvas:hover,
.preview-grid img:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 0, 122, 0.4);
}

/* Animations & Utilities */
.hidden { display: none !important; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 40px) scale(1.1); }
}

@media (max-width: 768px) {
  .app-name { font-size: 2.5rem; }
  .container { padding: 2.5rem 1.5rem; }
  .action-toolbar { flex-direction: column; align-items: stretch; }
  .btn-group { flex-direction: column; }
  .cta-button { width: 100%; }
}