/* HTXpunk Wheel — neon stage + 3D spectacle */
@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@500;600;700&display=swap");

:root {
  --bg0: #05060f;
  --bg1: #0b1024;
  --panel: rgba(12, 16, 36, 0.82);
  --panel-border: rgba(0, 246, 255, 0.28);
  --ink: #eef6ff;
  --muted: #8b9bb8;
  --face: rgba(6, 10, 24, 0.9);
  --btn: linear-gradient(180deg, #1a2140, #0e1428);
  --accent: #00f6ff;
  --accent2: #f000b8;
  --gold: #ffd84a;
  --ok: #3dff9a;
  --warn: #ff4d6d;
  --font: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --display: "Orbitron", "Segoe UI", sans-serif;
  --mono: ui-monospace, Consolas, "Courier New", monospace;
  --glow: 0 0 24px rgba(0, 246, 255, 0.35);
  --glow-pink: 0 0 28px rgba(240, 0, 184, 0.4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(240, 0, 184, 0.18), transparent 55%),
    radial-gradient(900px 500px at 80% 100%, rgba(0, 246, 255, 0.12), transparent 50%),
    radial-gradient(700px 400px at 10% 80%, rgba(255, 216, 74, 0.08), transparent 45%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 40%, #070a16);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 246, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 246, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-shadow: 0 0 10px rgba(0, 246, 255, 0.7); }

.app {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 14px 32px;
}

.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, rgba(240, 0, 184, 0.35), rgba(0, 246, 255, 0.2));
  border: 1px solid var(--panel-border);
  border-bottom: none;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--glow);
}

.titlebar .badge {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.12em;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 0 0 16px 16px;
  padding: 18px 16px 20px;
  backdrop-filter: blur(12px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

h1 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

h2 {
  margin: 20px 0 10px;
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid rgba(0, 246, 255, 0.2);
  padding-bottom: 6px;
}

label {
  display: block;
  margin: 10px 0 4px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #c5d4f0;
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 246, 255, 0.22);
  border-radius: 10px;
  background: var(--face);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 246, 255, 0.15);
}

textarea { min-height: 72px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  margin: 6px 6px 6px 0;
  border: 1px solid rgba(0, 246, 255, 0.35);
  border-radius: 999px;
  background: var(--btn);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.btn:hover {
  border-color: var(--accent);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(120deg, #f000b8, #7a00ff 50%, #00c2ff);
  border-color: transparent;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover {
  box-shadow: var(--glow-pink);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  font-size: 13px;
  padding: 6px 12px;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.row > * { flex: 1; min-width: 140px; }

.option-card {
  position: relative;
  border: 1px solid rgba(0, 246, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
}

.option-card .remove {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  padding: 2px 10px;
  border-radius: 8px;
}

.hint { color: var(--muted); font-size: 0.92rem; margin: 4px 0 10px; }

.error {
  color: #ffd0d8;
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
}

.success {
  color: #c8ffe4;
  background: rgba(61, 255, 154, 0.1);
  border: 1px solid rgba(61, 255, 154, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
}

.link-box {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 246, 255, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0;
  color: #b8fff8;
}

/* ——— 3D stage (spin page) ——— */
.stage {
  position: relative;
  margin: 8px auto 4px;
  padding: 8px 0 18px;
  perspective: 1100px;
  perspective-origin: 50% 40%;
}

.stage-floor {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: min(420px, 92vw);
  height: 48px;
  transform: translateX(-50%) rotateX(70deg);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 246, 255, 0.35), transparent 70%);
  filter: blur(6px);
  opacity: 0.75;
  pointer-events: none;
}

.wheel-wrap {
  position: relative;
  width: min(400px, 88vw);
  height: min(400px, 88vw);
  margin: 0 auto;
  transform-style: preserve-3d;
  transform: rotateX(16deg) translateZ(0);
  transition: transform 0.35s ease;
  filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.55));
}

.wheel-wrap.is-spinning {
  transform: rotateX(22deg) scale(1.03);
  animation: stage-wobble 0.18s ease-in-out infinite alternate;
}

.wheel-wrap.is-landed {
  animation: stage-land 0.55s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes stage-wobble {
  from { transform: rotateX(20deg) rotateZ(-0.6deg) scale(1.02); }
  to   { transform: rotateX(24deg) rotateZ(0.6deg) scale(1.04); }
}

@keyframes stage-land {
  0%   { transform: rotateX(22deg) scale(1.05); }
  40%  { transform: rotateX(14deg) scale(0.97); }
  70%  { transform: rotateX(18deg) scale(1.02); }
  100% { transform: rotateX(16deg) scale(1); }
}

.wheel-aura {
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, rgba(240,0,184,0.15), rgba(0,246,255,0.25), rgba(255,216,74,0.15), rgba(240,0,184,0.15));
  filter: blur(18px);
  opacity: 0.55;
  z-index: 0;
  animation: aura-spin 12s linear infinite;
  pointer-events: none;
}

.wheel-wrap.is-spinning .wheel-aura {
  opacity: 0.9;
  animation-duration: 1.2s;
  filter: blur(22px);
}

@keyframes aura-spin {
  to { transform: rotate(360deg); }
}

#wheelCanvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  transform: translate(-50%, -50%) translateZ(40px);
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  background:
    radial-gradient(circle at 30% 28%, #fff 0%, #ffe9a8 22%, #ffb703 48%, #c1121f 78%, #3a0a0a 100%);
  font-family: var(--display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #1a0505;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.35),
    0 10px 24px rgba(0, 0, 0, 0.55),
    0 0 30px rgba(255, 183, 3, 0.45);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}

.spin-btn:hover:not(:disabled) {
  transform: translate(-50%, -50%) translateZ(40px) scale(1.06);
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(255, 183, 3, 0.7);
}

.spin-btn:active:not(:disabled) {
  transform: translate(-50%, -50%) translateZ(40px) scale(0.96);
}

.spin-btn:disabled {
  filter: grayscale(0.85) brightness(0.7);
  cursor: not-allowed;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.spin-btn.pulse:not(:disabled) {
  animation: spin-pulse 1.6s ease-in-out infinite;
}

@keyframes spin-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(0,0,0,0.35), 0 10px 24px rgba(0,0,0,0.55), 0 0 24px rgba(255,183,3,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(0,0,0,0.35), 0 10px 24px rgba(0,0,0,0.55), 0 0 42px rgba(255,183,3,0.85); }
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 4px;
}

.result-box {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(240, 0, 184, 0.18), rgba(0, 246, 255, 0.12)),
    rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 216, 74, 0.45);
  box-shadow: 0 0 30px rgba(255, 216, 74, 0.15);
  white-space: pre-wrap;
  line-height: 1.5;
  min-height: 3em;
  transform-origin: center top;
}

.result-box.reveal {
  animation: result-pop 0.65s cubic-bezier(0.18, 0.9, 0.25, 1);
}

@keyframes result-pop {
  0%   { opacity: 0; transform: translateY(16px) scale(0.92); filter: blur(4px); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.03); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.result-label {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 216, 74, 0.55);
}

.meta {
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.spin-log {
  list-style: none;
  padding: 0;
  margin: 0;
}

.spin-log li {
  border: 1px solid rgba(0, 246, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
}

.footer-nav {
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

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

/* Designer / results share the neon panel look; keep forms readable */
body.page-designer .wheel-wrap,
body.page-results .wheel-wrap {
  display: none;
}

@media (max-width: 480px) {
  .app { padding: 10px 8px 24px; }
  .panel { padding: 14px 12px 16px; }
  .spin-btn { width: 68px; height: 68px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-aura,
  .wheel-wrap.is-spinning,
  .spin-btn.pulse {
    animation: none !important;
  }
  .wheel-wrap {
    transform: none;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.4));
  }
}
