:root {
  --gold: #ffb347;
  --gold-light: #ffdca3;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -10%, #3a170f 0%, #1c0d09 55%, #0a0503 100%);
  color: #f1e9e4;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  text-align: center;
  margin: 2rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, #ff7b3f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#status {
  opacity: 0.75;
  min-height: 1.2em;
  font-size: 0.9rem;
}

#progress {
  width: min(90vw, 420px);
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #ff7b3f);
  transition: width 0.4s ease;
}

#progress-label {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.65;
}

#complete-banner {
  margin: 0.25rem 0 0;
  font-weight: 700;
  color: var(--gold-light);
  text-shadow: 0 0 16px rgba(255, 179, 71, 0.7);
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1rem 1.5rem;
}

.pookalam-frame {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 32px;
  padding: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 90px rgba(255, 140, 40, 0.12);
}

#pookalam {
  display: block;
  width: min(92vw, 600px);
  height: min(92vw, 600px);
  touch-action: none;
}

#pookalam.disabled {
  cursor: not-allowed;
}

.ring-guide {
  fill: none;
  stroke: rgba(120, 200, 150, 0.22);
  stroke-width: 1.5;
}

.slot {
  cursor: pointer;
}

.slot * {
  pointer-events: all;
}

.shape-part {
  fill: none;
  stroke: rgba(255, 210, 160, 0.32);
  stroke-width: 1.25;
  transition: fill 0.2s, stroke 0.2s, filter 0.2s;
}

.slot:hover .shape-part {
  stroke: rgba(255, 179, 71, 0.85);
}

.slot.filled .shape-part {
  stroke: rgba(0, 0, 0, 0.35);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.slot.filled:hover .shape-part {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 8px rgba(255, 200, 120, 0.85));
}

.slot.filled .part-center {
  stroke: rgba(0, 0, 0, 0.15);
}

.pop-wrap {
  transform-box: fill-box;
  transform-origin: center;
}

.pop-wrap.pop {
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
  0% {
    transform: scale(0.4);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

#palette {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 640px;
}

.petal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 76px;
  padding: 0.5rem 0.3rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  color: #ddd;
  font-size: 0.68rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s;
}

.petal-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 179, 71, 0.5);
}

.petal-card.selected {
  border-color: var(--gold);
  background: rgba(255, 179, 71, 0.12);
  box-shadow: 0 0 18px rgba(255, 179, 71, 0.35);
}

.petal-icon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}

#admin-panel {
  margin: 0.5rem 0 2rem;
  color: #9a8f89;
  font-size: 0.85rem;
}

#admin-panel summary {
  cursor: pointer;
}

#admin-panel[open] {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

#admin-panel input,
#admin-panel button {
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
}

#admin-panel button {
  cursor: pointer;
}

#admin-panel button:hover {
  border-color: var(--gold);
}
