:root {
  --bg: #f6f2ea;
  --text: #17120f;
  --muted: #5f574e;
  --accent: #007a61;
  --accent-deep: #005f4a;
  --border: #e0d7ca;
  --card: #ffffff;
  --shadow: 0 16px 34px rgba(36, 20, 0, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 16%, #f1d9bd 0%, transparent 39%),
    radial-gradient(circle at 86% 4%, #bfdcd3 0%, transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}

.drop-shell {
  width: min(1240px, 95vw);
  margin: 0 auto;
  padding: 1.2rem 0 1.6rem;
}

.back-link {
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 0.95rem;
}

.drop-header {
  text-align: center;
  margin: 0.8rem 0 1rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: var(--muted);
}

h1 {
  margin: 0.3rem 0 0.7rem;
  font-size: clamp(2rem, 4.3vw, 3rem);
  line-height: 1.08;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.drop-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 1rem;
  align-items: start;
}

.control-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.control-card label {
  display: block;
  margin-bottom: 0.36rem;
  font-weight: 600;
}

.field-wrap {
  margin-top: 0.65rem;
}

.control-card select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fdfcf8;
  color: #1f1f1f;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  padding: 0.54rem 0.6rem;
}

.settings-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: none;
}

.settings-link:hover,
.settings-link:focus-visible {
  text-decoration: underline;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.primary-btn,
.ghost-btn {
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 0.5rem 0.92rem;
}

.primary-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.ghost-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.result-label {
  margin: 0.95rem 0 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.result-text {
  margin: 0;
  min-height: 2rem;
  font-size: clamp(1.1rem, 2.5vw, 1.55rem);
  font-weight: 700;
  color: var(--accent-deep);
}

.meta-text {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.board-stage {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.25)),
    linear-gradient(180deg, #f3f8f6 0%, #e6efe8 100%);
  padding: 0.6rem;
  min-height: 520px;
  max-height: min(82vh, 980px);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.win-flyout {
  position: fixed;
  left: 50vw;
  top: 50vh;
  transform: translate(-50%, -50%);
  padding: 0.5rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 248, 226, 0.95);
  color: #2f250f;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.2rem, 2.8vw, 2rem);
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(16, 9, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
}

.win-flyout.is-active {
  animation: prize-flyout 2750ms cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
}

@keyframes prize-flyout {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82);
    filter: blur(1.6px);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
    filter: blur(0);
  }
  48% {
    opacity: 0.9;
    transform: translate(-50%, -52%) scale(1.22);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -54%) rotate(-3deg) scale(3.85);
    filter: blur(2.2px);
  }
}

#dropCanvas {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 47 / 75;
  border-radius: 12px;
  background:
    radial-gradient(circle at 48% 6%, #f8fbfa 0%, #eff6f2 35%, #e6efe8 100%);
  touch-action: none;
  cursor: crosshair;
}

@media (max-width: 900px) {
  .drop-layout {
    grid-template-columns: 1fr;
  }

  .board-stage {
    order: -1;
    min-height: 360px;
  }
}
