:root{
  --bg: #0f1020;
  --card-bg: rgba(255,255,255,0.06);
  --card-border: rgba(255,255,255,0.12);
  --text-main: #f5f5fa;
  --text-muted: #b8b8cc;
  --accent: #8b7bff;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0,0,0,0.35);
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
}

body{
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Decorative background blobs */
.bg-decor{
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.blob{
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.blob-1{
  width: 500px; height: 500px;
  background: #ff5c8a;
  top: -150px; left: -150px;
}
.blob-2{
  width: 450px; height: 450px;
  background: #4dd0ff;
  bottom: -180px; right: -120px;
}
.blob-3{
  width: 380px; height: 380px;
  background: #8b7bff;
  top: 40%; left: 60%;
  transform: translate(-50%, -50%);
}

/* Header */
.site-header{
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 20px 24px;
}
.brand{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand-icon{
  font-size: 2rem;
  color: var(--accent);
}
.site-header h1{
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 600;
  margin: 0;
}
.site-header h1 strong{
  font-weight: 800;
  background: linear-gradient(90deg, #ff5c8a, #4dd0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle{
  max-width: 640px;
  margin: 16px auto 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* Main app layout */
.app{
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px){
  .app{
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

/* Wheel */
.wheel-section{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 20px;
}
@media (max-width: 900px){
  .wheel-section{ position: static; }
}

.wheel-wrap{
  width: min(400px, 86vw);
  aspect-ratio: 1 / 1;
  position: relative;
}

.wheel{
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(
    from 0deg,
    hsl(0,100%,50%), hsl(30,100%,50%), hsl(60,100%,50%), hsl(90,100%,50%),
    hsl(120,100%,50%), hsl(150,100%,50%), hsl(180,100%,50%), hsl(210,100%,50%),
    hsl(240,100%,50%), hsl(270,100%,50%), hsl(300,100%,50%), hsl(330,100%,50%),
    hsl(360,100%,50%)
  );
  box-shadow: var(--shadow), inset 0 0 0 8px rgba(15,16,32,0.85), inset 0 0 30px rgba(0,0,0,0.4);
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.wheel-inner-ring{
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08), inset 0 0 20px rgba(0,0,0,0.5);
  pointer-events: none;
}

.wheel-lines{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.wheel-lines line{
  stroke: rgba(255,255,255,0.6);
  stroke-width: 2;
  stroke-dasharray: 4 5;
}

.wheel-center{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(15,16,32,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
  pointer-events: none;
}

.handle{
  position: absolute;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid rgba(0,0,0,0.25);
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  padding: 0;
  transition: box-shadow 0.15s ease;
  z-index: 3;
}
.handle:active{ cursor: grabbing; }
.handle:focus-visible{
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.handle-complement{
  width: 22px; height: 22px;
  border-width: 3px;
  opacity: 0.9;
  z-index: 2;
}

.wheel-hint{
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
}

/* Panel */
.panel{
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.swatches{
  display: flex;
  align-items: center;
  gap: 16px;
}
@media (max-width: 560px){
  .swatches{ flex-direction: column; }
  .vs-icon{ transform: rotate(90deg); }
}

.vs-icon{
  color: var(--text-muted);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.swatch-card{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(10px);
  min-width: 0;
}

.swatch{
  width: 64px; height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35), inset 0 0 0 2px rgba(255,255,255,0.15);
  transition: background-color 0.1s ease;
}

.swatch-info h2{
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
  color: var(--text-muted);
  font-weight: 600;
}

.swatch-info dl{
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.swatch-info dl div{
  display: flex;
  gap: 8px;
  font-size: 0.88rem;
}
.swatch-info dt{
  color: var(--text-muted);
  width: 40px;
  font-weight: 500;
}
.swatch-info dd{
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.preview{
  display: flex;
  height: 130px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.preview-half{
  flex: 1;
  transition: background-color 0.1s ease;
}

.extra-controls{
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.extra-controls label{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.extra-controls label span{
  margin-left: auto;
  font-weight: 700;
  color: var(--text-main);
}

input[type="range"]{
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #000, #fff);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
input[type="range"]::-moz-range-thumb{
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  cursor: pointer;
}

.palette-row{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.palette-label{
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.palette-buttons{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.palette-buttons button{
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255,255,255,0.1);
  color: var(--text-main);
  transition: transform 0.15s ease, background 0.15s ease;
}
.palette-buttons button:hover{
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.copy-btn{
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5c8a, #8b7bff, #4dd0ff);
  background-size: 200% 100%;
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-position 0.4s ease, transform 0.15s ease;
}
.copy-btn:hover{
  background-position: 100% 0;
  transform: translateY(-2px);
}
.copy-feedback{
  color: #7dffb0;
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 0;
  font-weight: 600;
}

/* About section */
.about{
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto 60px;
  padding: 0 20px;
  text-align: center;
}
.about h2{
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.about p{
  color: var(--text-muted);
  line-height: 1.7;
}
.about-examples{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
}
.example{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 10px 16px;
  border-radius: 999px;
}
.dot{
  width: 14px; height: 14px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3);
}

/* Footer */
.site-footer{
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer i{
  color: #ff5c8a;
}
