* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #07070a;
  --card: rgba(18, 18, 28, 0.78);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f7ff;
  --muted: #b8bfd8;
  --accent: #8b5cf6;
  --accent2: #ec4899;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #151321, #07070a 55%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.glow {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  z-index: 0;
}

.glow1 {
  top: -100px;
  left: -100px;
  background: var(--accent);
}

.glow2 {
  bottom: -120px;
  right: -80px;
  background: var(--accent2);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 950px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.hero {
  text-align: center;
  margin-bottom: 24px;
}

.brand {
  letter-spacing: 0.35em;
  font-size: 0.8rem;
  color: #dacdff;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
  margin-bottom: 12px;
}

.subtext {
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto 18px;
  line-height: 1.6;
}

.music-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.music-btn,
.spotify-btn,
.upload-btn,
.small-btn {
  border: none;
  outline: none;
  cursor: pointer;
  text-decoration: none;
  color: white;
  font-weight: 700;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.music-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  padding: 12px 18px;
}

.spotify-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  padding: 12px 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  border-radius: 28px;
  padding: 22px;
}

.upload-row {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.upload-btn {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  padding: 14px 22px;
  display: inline-block;
}

#imageInput {
  display: none;
}

.hint {
  text-align: center;
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 300px;
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#imageCanvas {
  max-width: 100%;
  display: none;
  cursor: crosshair;
  border-radius: 18px;
}

.canvas-placeholder {
  color: #9ea7cb;
  text-align: center;
  padding: 30px;
}

.result {
  margin-top: 20px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}

.hidden {
  display: none;
}

.swatch-wrap {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.swatch {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.result-label {
  color: #b8bfd8;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

#toneName {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  margin-bottom: 4px;
}

.undertone {
  color: #d8def8;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.info-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.info-title {
  display: block;
  color: #b7bfd8;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.info-box p {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.small-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  padding: 10px 14px;
}

.disclaimer {
  margin-top: 14px;
  color: #aab3d5;
  line-height: 1.5;
  font-size: 0.92rem;
}

@media (max-width: 700px) {
  .result-grid {
    grid-template-columns: 1fr;
  }

  .swatch-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}