:root {
  --bg-main: #0B0F19;
  --bg-sidebar: #0E1424;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(245, 158, 11, 0.35);
  --border-indigo: rgba(99, 102, 241, 0.3);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --accent-gold: #F59E0B;
  --accent-gold-dark: #D97706;
  --accent-gold-gradient: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --accent-indigo: #6366F1;
  --accent-violet: #8B5CF6;
  --accent-cyan: #06B6D4;
  --accent-emerald: #10B981;
  --accent-blue: #3B82F6;

  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  margin: 0;
  padding: 30px 15px;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Thotfy Ambient Ambient Glow Orbs */
.thotfy-bg-glow-1 {
  position: fixed;
  top: -140px;
  left: 20%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, rgba(11, 15, 25, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.thotfy-bg-glow-2 {
  position: fixed;
  top: 30%;
  right: -100px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, rgba(11, 15, 25, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1040px;
}

/* Thotfy Card & Jumbotron Styling */
.jumbotron, .thotfy-card {
  background: var(--bg-card) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 36px !important;
  margin-bottom: 28px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  position: relative;
}

/* Header & Brand Layout */
.thotfy-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.thotfy-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.thotfy-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.thotfy-brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: #FFFFFF;
  padding: 2px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}

.thotfy-brand-logo:hover {
  transform: scale(1.06);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.55);
}

.thotfy-brand-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFFFFF 30%, #F59E0B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  line-height: 1.2;
}

.thotfy-brand-sub {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.thotfy-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FCD34D;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Status Pill */
#status {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 24px;
  background: rgba(14, 20, 36, 0.85);
  border: 1px solid var(--border-highlight);
  color: #FBBF24;
  margin: 12px 0 16px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

#drawStatus {
  color: #38BDF8;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.instructions-text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

/* Form inputs & controls */
.form-group label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.form-control {
  background-color: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
  background-color: rgba(15, 23, 42, 0.95) !important;
}

/* Buttons */
.btn-primary {
  background: var(--accent-gold-gradient) !important;
  color: #0B0F19 !important;
  font-weight: 700 !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 22px !important;
  font-size: 14px;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  box-sizing: border-box;
  text-decoration: none;
  white-space: normal;
}

.btn-primary:hover, .btn-primary:focus {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5) !important;
  color: #000000 !important;
  text-decoration: none;
}

.btn-file {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 24px !important;
  font-size: 14px !important;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.btn-secondary, button {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
}

button:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: var(--border-highlight);
  color: #FCD34D;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-nav-outline {
  background: rgba(14, 20, 36, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-nav-outline:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  text-decoration: none;
}

/* Canvases and Step Containers */
.hidden {
  display: none !important;
}

.caption {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.caption::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

.center {
  margin: 20px auto;
  width: 100%;
  max-width: 860px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.centerBorderless {
  margin: 16px auto;
  width: 100%;
  padding: 12px;
  text-align: center;
}

.centerImage {
  padding: 0;
  margin: 0 auto;
  display: block;
  max-width: 500px;
  width: 100%;
  border-radius: 50%;
  border: 2px solid var(--border-highlight);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.centerCanvasMedium {
  padding: 0;
  margin: 0 auto;
  display: block;
  max-width: 500px;
  width: 100%;
  border-radius: 50%;
  background-color: #000000;
  border: 2px solid var(--border-highlight);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.centerCanvasLarge {
  padding: 0;
  margin: 0 auto;
  display: block;
  max-width: 760px;
  width: 100%;
  border-radius: 50%;
  background-color: #FFFFFF;
  border: 3px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

/* Pins output textarea */
textarea {
  display: block;
  margin: 16px auto;
  width: 100%;
  max-width: 800px;
  background-color: #070B14;
  color: #38BDF8;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

#incrementalCurrentStep {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #FCD34D;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 14px;
  font-weight: 600;
}

.step-btn-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 18px auto 0 auto;
  width: 100%;
}

.examples-btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  width: 100%;
}

/* Download Container */
#downloadContainer {
  margin-top: 20px;
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

#downloadContainer button,
#downloadContainer .btn {
  min-width: 200px;
}

/* Responsive adjustments for Tablets & Mobile (<= 768px) */
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }

  .jumbotron, .thotfy-card {
    padding: 24px 16px !important;
    border-radius: var(--radius-md) !important;
  }

  .center {
    padding: 18px 12px !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
  }

  .thotfy-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .thotfy-header-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .step-btn-group {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .step-btn-group button,
  .step-btn-group .btn {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 12px 18px !important;
  }

  #downloadContainer {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  #downloadContainer button,
  #downloadContainer .btn {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 12px 18px !important;
  }

  .examples-btn-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .examples-btn-row button {
    width: 100% !important;
    padding: 10px 14px !important;
  }

  .btn-file {
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .centerImage,
  .centerCanvasMedium,
  .centerCanvasLarge {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* Small mobile devices (<= 480px) */
@media (max-width: 480px) {
  body {
    padding: 12px 6px;
  }

  .container {
    padding-left: 4px;
    padding-right: 4px;
  }

  .jumbotron, .thotfy-card {
    padding: 18px 12px !important;
    border-radius: var(--radius-sm) !important;
    margin-bottom: 14px;
  }

  .center {
    padding: 14px 8px !important;
    border-radius: var(--radius-sm) !important;
  }

  .thotfy-brand-wrapper {
    gap: 10px;
  }

  .thotfy-brand-logo {
    width: 38px !important;
    height: 38px !important;
  }

  .thotfy-brand-title {
    font-size: 19px !important;
  }

  .thotfy-brand-sub {
    font-size: 11px !important;
  }

  .thotfy-header-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .thotfy-header-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .thotfy-pill-badge {
    align-self: flex-start;
  }

  #status {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 12px;
  }

  #incrementalCurrentStep {
    font-size: 12px;
    padding: 6px 10px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    word-break: break-word;
  }

  textarea {
    font-size: 11px;
    padding: 8px;
  }
}

/* Footer branding */
.thotfy-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
}

.thotfy-footer a {
  color: #60A5FA;
  text-decoration: none;
  font-weight: 500;
}

.thotfy-footer a:hover {
  text-decoration: underline;
  color: #93C5FD;
}