:root {
  --bg: #1a1430;
  --card: #2a2148;
  --ink: #f7f2ff;
  --muted: #c9b8ef;
  --accent: #ffb703;
  --good: #2dd4a8;
  --bad: #ff6b81;
  --btn: #6c5ce7;
  --radius: 16px;
  --gap: 12px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  background: radial-gradient(1200px 600px at 20% -10%, #3d2e6b, var(--bg));
  color: var(--ink);
  line-height: 1.35;
  padding: 16px;
}
body.prank-flip { transform: rotate(180deg); transition: transform 0.4s ease; }
body.prank-yellow { filter: sepia(0.35) saturate(1.4) hue-rotate(5deg); }

.wrap {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}
header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hud {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pill {
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.seed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.seed-row input {
  flex: 1 1 140px;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid #4a3c78;
  background: #1e1736;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 1rem;
}
button, .btn {
  min-height: 48px;
  min-width: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--btn);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 14px;
  cursor: pointer;
}
button.secondary { background: #3d3470; }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.65; cursor: default; }

#narrator, #verdict, #prank, #absurd {
  margin: 0;
  color: var(--muted);
}
#verdict { color: var(--accent); font-weight: 700; min-height: 1.4em; }
#prank { color: #ffd6a5; font-weight: 600; }
#absurd { color: #9be7ff; }

#prompt {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

#dice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.die {
  background: #fff8e7;
  color: #2a2148;
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
  box-shadow: 0 4px 0 #d4a017;
  transition: transform 0.2s ease;
}
.die.rolling { animation: wobble 0.7s ease; }
.die.asleep { opacity: 0.45; filter: grayscale(0.4); }
.die.shy { opacity: 0.15; transform: translateY(-40px); }
.die.extra-die {
  position: absolute;
  animation: bounce-out 1.4s forwards;
  background: #ffe08a;
}
.die-face { font-size: 2rem; display: block; line-height: 1; }
.die-name {
  display: block;
  font-size: 0.65rem;
  margin-top: 4px;
  font-weight: 700;
  line-height: 1.1;
}

@keyframes wobble {
  0% { transform: rotate(0) translateY(0); }
  20% { transform: rotate(-12deg) translateY(-8px); }
  40% { transform: rotate(10deg) translateY(2px); }
  60% { transform: rotate(-8deg) translateY(-4px); }
  80% { transform: rotate(6deg) translateY(0); }
  100% { transform: rotate(0); }
}
@keyframes bounce-out {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(80px, -120px) rotate(40deg) scale(0.4); opacity: 0; }
}

#choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.choice {
  background: #45368a;
  text-align: left;
  font-size: 1.1rem;
}
.choice.was-answer { outline: 3px solid var(--good); }
.choice.picked-good { background: #1f8a6a; }
.choice.picked-bad { background: #a83d52; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#share-out {
  white-space: pre-wrap;
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
}

.duck {
  position: fixed;
  bottom: 20%;
  left: -60px;
  font-size: 2.5rem;
  animation: waddle 2.2s linear forwards;
  z-index: 50;
  pointer-events: none;
}
@keyframes waddle {
  0% { left: -60px; transform: translateY(0); }
  25% { transform: translateY(-8px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-6px); }
  100% { left: 110%; transform: translateY(0); }
}

footer {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding-bottom: 24px;
}

@media (min-width: 480px) {
  #choices { grid-template-columns: 1fr 1fr; }
  #dice { grid-template-columns: repeat(6, 1fr); }
  .die-name { font-size: 0.55rem; }
}

.daily-banner {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #3a2f6e;
  color: #ffe08a;
  font-weight: 700;
  font-size: 0.95rem;
}
#btn-next { margin-top: 10px; width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
