:root {
  --burgundy: #2a0a12;
  --burgundy2: #4a0f1c;
  --cream: #f4ecd8;
  --gold: #c9a227;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(201,162,39,0.12), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(232,180,188,0.08), transparent 55%),
    linear-gradient(160deg, #1a0509 0%, #2a0a12 45%, #3a0d18 100%);
  background-attachment: fixed;
  color: var(--cream);
  font-family: "Cormorant Garamond", serif;
  min-height: 100vh;
}
.font-display { font-family: "Fraunces", "Cormorant Garamond", serif; font-weight: 600; }
.font-serif { font-family: "Cormorant Garamond", serif; }
.mono { font-family: "Space Mono", monospace; }

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.18));
  border: 1px solid rgba(201,162,39,0.25);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
}

.wine-select {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(201,162,39,0.35);
  color: var(--cream);
  padding: 10px 12px;
  border-radius: 10px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  outline: none;
}
.wine-select:focus { border-color: var(--gold); }
.wine-select option { background: #2a0a12; color: var(--cream); }

.vint-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(201,162,39,0.15);
  border: 1px solid rgba(201,162,39,0.4);
  color: var(--gold); font-size: 1.4rem; line-height: 1;
  cursor: pointer; transition: all .15s;
}
.vint-btn:hover { background: rgba(201,162,39,0.3); transform: translateY(-1px); }

/* range slider */
.wine-slider {
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--burgundy2), var(--gold));
  outline: none;
}
.wine-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--gold));
  border: 2px solid #2a0a12; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.wine-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--gold));
  border: 2px solid #2a0a12; cursor: pointer;
}

.assemble-btn {
  background: linear-gradient(180deg, #d4af37, #b8891f);
  color: #2a0a12; font-family: "Fraunces", serif; font-weight: 600;
  font-size: 1.15rem; padding: 14px; border: none; border-radius: 12px;
  cursor: pointer; transition: all .18s; box-shadow: 0 8px 20px rgba(201,162,39,0.3);
}
.assemble-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(201,162,39,0.45); }
.assemble-btn:disabled { opacity: 0.6; cursor: wait; }

.random-btn {
  width: 54px; font-size: 1.4rem;
  background: rgba(232,180,188,0.12);
  border: 1px solid rgba(232,180,188,0.4);
  border-radius: 12px; cursor: pointer; transition: all .18s;
}
.random-btn:hover { transform: rotate(20deg) scale(1.05); background: rgba(232,180,188,0.25); }

.mini-btn {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(201,162,39,0.4);
  color: var(--cream); padding: 8px 14px; border-radius: 10px;
  font-family: "Space Mono", monospace; font-size: 0.8rem;
  cursor: pointer; transition: all .15s;
}
.mini-btn:hover { background: rgba(201,162,39,0.2); border-color: var(--gold); }
.mini-btn.gold { background: rgba(201,162,39,0.85); color: #2a0a12; font-weight: 700; }
.mini-btn.gold:hover { background: var(--gold); }

/* swirl loader */
.swirl {
  width: 60px; height: 60px; border-radius: 50%;
  border: 5px solid rgba(201,162,39,0.2);
  border-top-color: var(--gold);
  border-right-color: #e8b4bc;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tag-fade { animation: tagfade 0.6s ease; }
@keyframes tagfade { from { opacity: 0; transform: translateY(-4px);} to { opacity: 1; transform: none; } }

.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* confetti */
.confetti-wrap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti {
  position: absolute; top: -10px; width: 8px; height: 12px; border-radius: 2px;
  animation: fall 2.4s linear forwards;
}
@keyframes fall {
  to { transform: translateY(520px) rotate(540deg); opacity: 0; }
}

@media (max-width: 640px) {
  h1 { font-size: 2.6rem !important; }
}