:root {
  --live-font-scale: 1;
  --bg: #f5f0e5;
  --bg-2: #e6efe9;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #1e2a22;
  --muted: #52615a;
  --accent: #de6f2b;
  --accent-2: #1f8a5f;
  --danger: #a13b34;
  --ring: rgba(31, 138, 95, 0.35);
  --shadow: 0 14px 34px rgba(30, 42, 34, 0.16);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Barlow", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 12% 10%, #f8d9ba 0%, transparent 60%),
    radial-gradient(1000px 520px at 90% 0%, #c6e5d4 0%, transparent 65%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.35;
}

.orb-a {
  width: 320px;
  height: 320px;
  background: #f2a86f;
  top: -80px;
  right: -40px;
  animation: driftA 18s ease-in-out infinite;
}

.orb-b {
  width: 380px;
  height: 380px;
  background: #80cfab;
  left: -80px;
  bottom: -120px;
  animation: driftB 20s ease-in-out infinite;
}

.app-shell {
  width: min(1680px, 96vw);
  margin: 18px auto 26px;
  display: grid;
  gap: 22px;
}

.hero h1 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.subtitle {
  margin-top: 0.5rem;
  max-width: 68ch;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.row {
  margin-bottom: 14px;
}

.hidden {
  display: none !important;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid rgba(30, 42, 34, 0.2);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 10px 12px;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px var(--ring);
}

textarea {
  resize: vertical;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e58c54);
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
}

.status {
  min-height: 1.2em;
  margin: 12px 0 0;
  font-weight: 600;
}

.status.error {
  color: var(--danger);
}

.draw-panel {
  min-height: 78vh;
}

.draw-stage {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
  min-height: calc(78vh - 80px);
}

.draw-bowl {
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(145deg, #ffffff 0%, #f2efe7 100%);
  border: 1px solid rgba(30, 42, 34, 0.12);
  min-height: 280px;
  position: sticky;
  top: 16px;
}

.bowl-label {
  display: block;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 12px;
}

.draw-card {
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(135deg, #1f8a5f, #2ca06f);
  color: #fff;
  font-weight: 700;
  font-size: 1.12rem;
  box-shadow: 0 8px 18px rgba(31, 138, 95, 0.35);
}

.draw-card.hidden {
  opacity: 0;
}

.draw-card.enter {
  animation: cardEnter 0.45s ease forwards;
}

.groups-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-content: start;
}

.group-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(30, 42, 34, 0.12);
  padding: 14px;
  min-height: 220px;
}

.group-card h3 {
  margin: 0 0 8px;
  font-size: calc(1.08rem * var(--live-font-scale));
}

.group-card ul {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 7px;
  font-size: calc(1.03rem * var(--live-font-scale));
}

.group-card li {
  opacity: 0;
  transform: translateY(8px);
}

.group-card li.arrived {
  animation: itemDrop 0.48s ease forwards;
}

@keyframes cardEnter {
  from {
    transform: translateY(-12px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes itemDrop {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes driftA {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-24px, 20px);
  }
}

@keyframes driftB {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(20px, -28px);
  }
}

@media (max-width: 880px) {
  .draw-panel {
    min-height: auto;
  }

  .draw-stage {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .draw-bowl {
    position: static;
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: 94vw;
    margin-top: 18px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}
