/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: rgba(255, 215, 0, 0.03);
  --border: rgba(255, 215, 0, 0.08);
  --border-hover: rgba(255, 215, 0, 0.22);
  --text: #e8e8ed;
  --text-muted: #9e9484;
  --gold: #d4a012;
  --gold-light: #f0c040;
  --gold-glow: rgba(212, 160, 18, 0.25);
  --radius: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.35;
  will-change: transform;
  transform: translateZ(0);
}

.glow-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 160, 18, 0.4) 0%, transparent 70%);
  top: -200px;
  left: -150px;
  animation: drift1 12s ease-in-out infinite alternate;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 200, 50, 0.3) 0%, transparent 70%);
  bottom: -180px;
  right: -120px;
  animation: drift2 14s ease-in-out infinite alternate;
}

.glow-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(180, 130, 10, 0.25) 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: drift3 10s ease-in-out infinite alternate;
}

.glow-cursor {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(50px);
  will-change: transform;
  transform: translateZ(0);
}

@keyframes drift1 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(80px, 60px) scale(1.15);
  }

  100% {
    transform: translate(-40px, 100px) scale(0.95);
  }
}

@keyframes drift2 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(-70px, -50px) scale(1.1);
  }

  100% {
    transform: translate(60px, -80px) scale(0.9);
  }
}

@keyframes drift3 {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-40%, -60%) scale(1.2);
  }

  100% {
    transform: translate(-60%, -40%) scale(0.85);
  }
}

/* ===== CONTAINER ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeDown 0.6s ease-out both;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #fff 20%, var(--gold-light) 50%, #fff 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 6s ease-in-out infinite;
}

.hero p {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

@keyframes textShimmer {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 200% center;
  }
}

/* ===== SETTINGS GRID ===== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeUp 0.5s ease-out both;
  animation-delay: calc(var(--delay) * 0.05s);
}

.settings-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  background: rgba(255, 215, 0, 0.06);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 24px var(--gold-glow);
}

.settings-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-preview-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-preview {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.settings-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  animation: fadeUp 0.5s ease-out both;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 215, 0, 0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.settings-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  animation: fadeUp 0.5s ease-out both;
}

.settings-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

/* ===== BACK BUTTON ===== */
.back-wrapper {
  text-align: center;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  animation: fadeUp 0.5s ease-out 0.6s both;
}

.back-button:hover {
  color: #fff;
  background: rgba(255, 215, 0, 0.06);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px var(--gold-glow);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.3);
}

@media (max-width: 768px), (pointer: coarse) {
  .bg-canvas {
    display: none;
  }

  body {
    background: radial-gradient(circle at 20% 0%, #18120a 0%, #050505 55%);
  }

  .settings-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(20, 20, 20, 0.85);
  }

  .hero,
  .hero h1,
  .settings-card,
  .settings-loading,
  .settings-empty,
  .back-button {
    animation: none !important;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 40px 16px 60px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .settings-card {
    padding: 16px;
  }

  .settings-preview-wrapper {
    height: 280px;
  }

  .back-button {
    padding: 12px 24px;
    font-size: 0.85rem;
  }
}
