:root {
  color-scheme: dark;
  --bg: #030106;
  --panel: rgba(18,8,28,0.76);
  --panel-strong: rgba(28,11,42,0.9);
  --line: rgba(237,84,255,0.35);
  --pink: #ff4fed;
  --purple: #9b5cff;
  --blue: #30d7ff;
  --text: #fff8ff;
  --muted: #bdaec7;
  --danger: #ff6d9a;
  --shadow-pink: rgba(255,79,237,0.42);
  --shadow-blue: rgba(48,215,255,0.32)
}
* {
  box-sizing: border-box
}
html {
  min-height: 100%;
  background: var(--bg)
}
body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at 50% 16%,rgba(122,41,255,0.2),transparent 28rem), radial-gradient(circle at 84% 82%,rgba(255,79,237,0.15),transparent 24rem), linear-gradient(180deg,#07020b 0%,#000 100%)
}
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(180deg,rgba(228,3,3,0.55) 0 16.66%,rgba(255,140,0,0.55) 16.66% 33.33%,rgba(255,237,0,0.5) 33.33% 50%,rgba(0,128,38,0.5) 50% 66.66%,rgba(0,77,255,0.5) 66.66% 83.33%,rgba(117,7,135,0.55) 83.33% 100% );
  filter: blur(18px) saturate(1.2);
  opacity: 0.3;
  transform: rotate(-8deg) scale(1.18)
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 20%,rgba(3,1,6,0.36),rgba(3,1,6,0.88) 62%), linear-gradient(180deg,rgba(0,0,0,0.38),rgba(0,0,0,0.78))
}
body.grass-glow {
  box-shadow: inset 0 0 150px rgba(57,255,111,0.34)
}
button, textarea, select {
  font: inherit
}
button {
  border: 0
}
.app-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(320px,380px);
  gap: clamp(18px,3vw,44px);
  align-items: center;
  padding: clamp(20px,4vw,54px);
  overflow: hidden
}
.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,0.028) 1px,transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle,black 0%,transparent 72%)
}
.info-button {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(48,215,255,0.5);
  background: rgba(12, 6, 20, 0.88);
  color: var(--blue);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(48,215,255,0.25);
}
.info-button:hover {
  transform: translateY(-1px);
}
.wheel-panel {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: calc(100vh - 108px);
  gap: 22px
}
.app-title {
  text-align: center;
  max-width: min(760px,92vw)
}
.app-title p, .section-heading p, .dialog-kicker {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase
}
.app-title h1, .section-heading h2, .title-button {
  margin: 0;
  font-size: clamp(32px,5vw,58px);
  line-height: 1;
  text-shadow: 0 0 22px var(--shadow-pink), 0 0 42px rgba(155,92,255,0.38)
}
.app-title h1 {
  font-size: clamp(34px,4.2vw,64px)
}
.wheel-stage {
  position: relative;
  width: min(68vh,58vw,690px);
  min-width: 330px;
  aspect-ratio: 1;
  display: grid;
  place-items: center
}
#wheelCanvas {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: drop-shadow(0 0 10px rgba(155,92,255,0.18));
  will-change: transform
}
#wheelCanvas:active, body.wheel-dragging #wheelCanvas {
  cursor: grabbing
}
.wheel-glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle,rgba(255,79,237,0.35),transparent 68%);
  filter: blur(16px);
  opacity: 0.7
}
body.wheel-active .wheel-glow, body.wheel-dragging .wheel-glow {
  animation: glow-pulse 700ms ease-in-out infinite alternate
}
.pointer {
  position: absolute;
  top: -16px;
  left: 50%;
  z-index: 4;
  width: 42px;
  height: 68px;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 10px var(--shadow-blue)) drop-shadow(0 0 24px var(--shadow-pink))
}
.pointer::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 4px;
  height: 31px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(var(--blue),white)
}
.pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 36px solid #f8fbff
}
.spin-button {
  position: relative;
  min-width: 178px;
  min-height: 58px;
  padding: 0 34px;
  border-radius: 999px;
  color: white;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.03em;
  background: linear-gradient(#111,#111) padding-box, linear-gradient(135deg,var(--blue),var(--pink),var(--purple)) border-box;
  border: 2px solid transparent;
  box-shadow: 0 0 22px var(--shadow-pink), 0 0 34px var(--shadow-blue), inset 0 0 18px rgba(255,255,255,0.08);
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease
}
.spin-button::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: linear-gradient(135deg,rgba(48,215,255,0.2),rgba(255,79,237,0.28));
  z-index: 0
}
.spin-button span {
  position: relative;
  z-index: 1
}
.spin-button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1);
  box-shadow: 0 0 30px var(--shadow-pink), 0 0 54px var(--shadow-blue)
}
.spin-button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: scale(0.98)
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px
}
.status-message {
  min-height: 28px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
  text-align: center
}
.control-panel {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 18px
}
.panel-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg,rgba(255,255,255,0.07),rgba(255,255,255,0.025)), var(--panel);
  box-shadow: 0 0 28px rgba(255,79,237,0.12), inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 18px;
  backdrop-filter: blur(18px)
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px
}
.section-heading h2, .title-button {
  font-size: 26px
}
.title-button {
  padding: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: text-shadow 150ms ease
}
.title-button:hover, .title-button:focus-visible {
  outline: none;
  text-shadow: 0 0 22px var(--shadow-pink)
}
.pill {
  min-width: 42px;
  padding: 7px 11px;
  border: 1px solid rgba(48,215,255,0.4);
  border-radius: 999px;
  color: #dbf8ff;
  background: rgba(48,215,255,0.09);
  text-align: center;
  font-size: 14px;
  font-weight: 800
}
#optionsInput {
  width: 100%;
  min-height: 236px;
  resize: vertical;
  border: 1px solid rgba(255,79,237,0.48);
  border-radius: 12px;
  outline: none;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(4,1,8,0.74);
  box-shadow: inset 0 0 18px rgba(255,79,237,0.08);
  line-height: 1.45
}
#optionsInput:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(48,215,255,0.12), inset 0 0 18px rgba(255,79,237,0.08)
}
.error-message {
  min-height: 22px;
  margin: 9px 0 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700
}
.secondary-button, .ghost-button {
  min-height: 42px;
  border-radius: 11px;
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease
}
.secondary-button {
  background: linear-gradient(135deg,rgba(48,215,255,0.9),rgba(255,79,237,0.84))
}
.ghost-button {
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06)
}
.secondary-button:hover, .ghost-button:hover {
  transform: translateY(-1px)
}
.reset-button {
  width: 100%
}
.history-more-button {
  width: 100%;
  margin-top: 10px
}
.history-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px
}
.history-action-button {
  width: 100%
}
.history-list {
  min-height: 144px;
  margin: 0;
  padding: 0;
  display: grid;
  align-content: start;
  grid-auto-rows: min-content;
  gap: 9px;
  list-style: none
}
.history-list li, .empty-history {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: var(--muted)
}
.history-list strong {
  color: var(--text)
}
.history-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700
}
.result-dialog {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  color: var(--text)
}
.result-dialog[hidden] {
  display: none
}
.dialog-card {
  width: min(430px,100%);
  border: 1px solid rgba(255,79,237,0.56);
  border-radius: 22px;
  padding: 32px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%,rgba(255,79,237,0.28),transparent 58%), rgba(16,4,24,0.96);
  box-shadow: 0 0 40px var(--shadow-pink), 0 0 80px rgba(48,215,255,0.18);
  animation: dialog-pop 420ms cubic-bezier(0.2,1.35,0.4,1)
}
.dialog-card h2 {
  margin: 0 0 10px;
  font-size: clamp(34px,7vw,56px);
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-shadow: 0 0 24px var(--shadow-pink)
}
.winner-comment {
  min-height: 28px;
  margin: 0 0 22px;
  color: #e9dcff;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 0 18px rgba(48,215,255,0.22)
}
.result-effect {
  min-height: 36px;
  margin: -8px 0 14px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.result-gif {
  width: 280px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.28);
  filter: drop-shadow(0 0 16px rgba(255,79,237,0.5));
}
.info-copy {
  margin: 4px 0 20px;
  color: #e9dcff;
  line-height: 1.5;
  font-weight: 700;
}
.dialog-card.skill-shake {
  animation: dialog-pop 320ms cubic-bezier(0.2,1.35,0.4,1), meme-shake 480ms 260ms ease-in-out
}
.dialog-card.grass-card {
  border-color: rgba(57,255,111,0.78);
  box-shadow: 0 0 44px rgba(57,255,111,0.34), 0 0 80px rgba(48,215,255,0.14)
}
.dialog-card.cooked-card {
  border-color: rgba(255,149,57,0.84);
  box-shadow: 0 0 48px rgba(255,149,57,0.36), 0 0 80px rgba(255,79,237,0.16)
}
@keyframes dialog-pop {
  from {
    transform: translateY(10px) scale(0.96);
    opacity: 0
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1
  }
}
@keyframes meme-shake {
  0%, 100% {
    transform: translateX(0) rotate(0deg)
  }
  20% {
    transform: translateX(-10px) rotate(-2deg)
  }
  40% {
    transform: translateX(9px) rotate(2deg)
  }
  60% {
    transform: translateX(-7px) rotate(-1deg)
  }
  80% {
    transform: translateX(6px) rotate(1deg)
  }
}
@keyframes glow-pulse {
  from {
    opacity: 0.55;
    transform: scale(0.96)
  }
  to {
    opacity: 1;
    transform: scale(1.04)
  }
}
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: hidden
}
.confetti-piece {
  position: absolute;
  top: -16px;
  width: 9px;
  height: 15px;
  border-radius: 3px;
  animation: confetti-fall 1100ms ease-out forwards
}
@keyframes confetti-fall {
  to {
    transform: translate3d(var(--x),105vh,0) rotate(720deg);
    opacity: 0
  }
}
.floating-meme-layer {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  overflow: hidden
}
.floating-meme {
  position: absolute;
  left: var(--left);
  top: var(--top);
  color: white;
  font-size: clamp(18px,3vw,34px);
  font-weight: 1000;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000, 0 0 20px rgba(255,79,237,0.5);
  animation: meme-float 1300ms ease-out forwards
}
@keyframes meme-float {
  0% {
    transform: translate3d(0,0,0) scale(0.74) rotate(-8deg);
    opacity: 0
  }
  15% {
    opacity: 1
  }
  100% {
    transform: translate3d(var(--x),-130px,0) scale(1.18) rotate(8deg);
    opacity: 0
  }
}
.rig-panel {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 232px;
  padding: 12px;
  display: none;
  gap: 8px;
  border: 1px solid rgba(255,79,237,0.8);
  border-radius: 12px;
  background: rgba(12,3,18,0.96);
  box-shadow: 0 0 28px rgba(255,79,237,0.2);
  z-index: 30
}
body.rig-open .rig-panel {
  display: grid
}
.rig-title {
  color: var(--pink);
  font-weight: 900
}
.rig-panel label {
  color: var(--muted);
  font-size: 13px
}
.rig-panel select, .rig-panel button {
  min-height: 34px;
  border: 1px solid rgba(255,79,237,0.58);
  border-radius: 8px;
  background: #050106;
  color: var(--text)
}
.rig-panel button {
  cursor: pointer
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0
}
@media (max-width:1020px) {
  body {
    overflow: auto
  }
  .app-shell {
    grid-template-columns: 1fr;
    align-items: start;
    overflow: visible
  }
  .wheel-panel {
    min-height: auto
  }
  .wheel-stage {
    width: min(82vw,620px)
  }
  .control-panel {
    width: min(680px,100%);
    justify-self: center
  }
}
@media (max-width:560px) {
  .app-shell {
    padding: 18px 14px 28px
  }
  .wheel-stage {
    width: min(92vw,430px);
    min-width: 0
  }
  .pointer {
    top: -10px;
    transform: translateX(-50%) scale(0.78)
  }
}
.info-inline-button {
  display: inline-block;
  margin: 0 2px;
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 0.92em;
  font-weight: 800;
  cursor: pointer;
}
.info-inline-button:hover {
  transform: translateY(-1px);
}
