:root {
  --ink: #1a1433;
  --paper: #fff9f4;
  --pop: #ff6b9d;
  --pop2: #7c5cff;
  --pop3: #00d4aa;
  --shadow: rgba(26, 20, 51, 0.12);
  --radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(165deg, #fff4e8 0%, #f0e8ff 45%, #e8fff8 100%);
  position: relative;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 107, 157, 0.35) 0%, transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(124, 92, 255, 0.28) 0%, transparent 40%),
    radial-gradient(circle at 70% 88%, rgba(0, 212, 170, 0.22) 0%, transparent 38%);
  animation: blobShift 18s ease-in-out infinite alternate;
}

@keyframes blobShift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-2%, 2%) scale(1.05);
  }
}

.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 1.25rem 1.5rem;
}

.hero-badge {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pop2);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  box-shadow: 0 8px 24px var(--shadow);
  animation: wiggle 4s ease-in-out infinite;
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-1deg);
  }
  50% {
    transform: rotate(1.5deg);
  }
}

.hero-title {
  margin: 0;
  font-family: "Shrikhand", cursive;
  font-size: clamp(2.8rem, 10vw, 4.5rem);
  font-weight: 400;
  line-height: 1.05;
  background: linear-gradient(120deg, var(--pop), var(--pop2), var(--pop3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 rgba(255, 255, 255, 0.6));
}

.hero-sub {
  margin: 0.75rem 0 0;
  font-size: 1.1rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.92;
}

.panel {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 0 1rem 2rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px var(--shadow);
  margin-bottom: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(26, 20, 51, 0.75);
}

.field-grow {
  flex: 1 1 220px;
  min-width: 0;
}

.field input[type="text"] {
  font: inherit;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border: 2px solid rgba(124, 92, 255, 0.25);
  border-radius: 12px;
  background: #fff;
}

.field input[type="color"] {
  width: 3rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.field input[type="range"] {
  width: 140px;
}

.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 12px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-tool {
  background: #fff;
  border: 2px solid rgba(26, 20, 51, 0.12);
}

.btn-tool[aria-pressed="true"] {
  border-color: var(--pop2);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px dashed rgba(26, 20, 51, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--pop), var(--pop2));
  color: #fff;
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.35);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.btn-small {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.canvas-wrap {
  background: #fff;
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: 0 16px 48px var(--shadow);
  line-height: 0;
}

#draw {
  width: 100%;
  height: auto;
  max-height: min(62vh, 620px);
  border-radius: 12px;
  touch-action: none;
  cursor: crosshair;
  background: #fff;
}

.submit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-top: 1.25rem;
}

.hint {
  margin: 0.75rem 0 0;
  min-height: 1.4em;
  font-size: 0.95rem;
}

.hint.error {
  color: #c41e3a;
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(26, 20, 51, 0.45);
  backdrop-filter: blur(4px);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  max-width: 420px;
  padding: 2rem 1.75rem;
  background: var(--paper);
  border-radius: 22px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(26, 20, 51, 0.25);
  overflow: hidden;
}

.modal-card h2 {
  margin: 0 0 0.5rem;
  font-family: "Shrikhand", cursive;
  font-size: 2rem;
  font-weight: 400;
  color: var(--pop2);
}

.modal-card p {
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.modal-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, var(--pop) 2px, transparent 3px),
    radial-gradient(circle, var(--pop2) 2px, transparent 3px),
    radial-gradient(circle, var(--pop3) 2px, transparent 3px);
  background-size: 24px 24px, 32px 32px, 28px 28px;
  opacity: 0.35;
  animation: confettiDrift 6s linear infinite;
}

@keyframes confettiDrift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(24px);
  }
}

.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1rem 1rem 2rem;
  font-size: 0.9rem;
}

.foot a {
  color: rgba(26, 20, 51, 0.55);
}

/* Admin */
.admin-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-login-card,
.admin-shell {
  width: 100%;
  max-width: 960px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 16px 48px var(--shadow);
}

.admin-login-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.muted {
  color: rgba(26, 20, 51, 0.6);
}

.small {
  font-size: 0.85rem;
}

.error {
  color: #b00020;
  font-weight: 600;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.admin-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-actions form {
  margin: 0;
}

.submission-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.submission-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px var(--shadow);
}

.submission-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f4f4f4;
}

.submission-meta {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Wizard (5 themes) */
.wizard-card {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem 1.75rem;
  box-shadow: 0 16px 48px var(--shadow);
}

.wizard-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}

.wizard-lead {
  margin: 0 0 1rem;
  line-height: 1.45;
  opacity: 0.9;
}

.wizard-actions {
  margin-top: 0.75rem;
}

.draw-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.draw-user {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.progress {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.4rem;
}

.progress li {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(26, 20, 51, 0.08);
  color: rgba(26, 20, 51, 0.55);
  border: 2px solid transparent;
}

.progress li.is-done {
  background: rgba(0, 212, 170, 0.25);
  color: var(--ink);
  border-color: rgba(0, 212, 170, 0.55);
}

.progress li.is-current {
  background: linear-gradient(135deg, var(--pop), var(--pop2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.35);
}

.theme-banner {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(255, 107, 157, 0.12), rgba(124, 92, 255, 0.12));
  border: 1px solid rgba(124, 92, 255, 0.2);
}

.theme-kicker {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pop2);
  margin-bottom: 0.35rem;
}

.theme-text {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
}

.admin-body-wide {
  align-items: flex-start;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.admin-shell-wide {
  max-width: 1180px;
}

.participant-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.participant-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 10px 32px var(--shadow);
}

.participant-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.participant-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-wip {
  background: rgba(255, 193, 7, 0.25);
  color: #6a4b00;
}

.badge-done {
  background: rgba(0, 212, 170, 0.25);
  color: #064a3a;
}

.theme-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.theme-slot {
  border: 1px solid rgba(26, 20, 51, 0.1);
  border-radius: 12px;
  padding: 0.65rem 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.65);
}

.theme-slot-label {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(26, 20, 51, 0.85);
}

.theme-slot-label .num {
  display: inline-block;
  min-width: 1.25rem;
  font-weight: 800;
  color: var(--pop2);
}

.theme-slot-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #f4f4f4;
}

.theme-slot-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.theme-slot-empty {
  font-size: 0.85rem;
  padding: 2rem 0.5rem;
  text-align: center;
  border-radius: 8px;
  background: rgba(26, 20, 51, 0.04);
}
