/* AlphaBay LTU — branded giveaway wheel */

:root {
  --bg0: #07070e;
  --bg1: #0f0f1a;
  --panel: #141422;
  --border: #2a2a44;
  --text: #f2f2f5;
  --muted: #8b8ba3;
  --orange: #f47920;
  --orange-hot: #ff8f3d;
  --red: #e74c3c;
  --green: #2ecc71;
  --gold: #f1c40f;
  --blue: #3d8bfd;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

.wheel-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 35% 40%, rgba(244, 121, 32, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 75% 70%, rgba(46, 204, 113, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 40% at 10% 90%, rgba(231, 76, 60, 0.1), transparent 45%),
    linear-gradient(160deg, #0a0a14 0%, #12121f 45%, #0b0b12 100%);
  pointer-events: none;
}

.wheel-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(244, 121, 32, 0.25);
  background: rgba(10, 10, 18, 0.72);
  backdrop-filter: blur(10px);
}

.wheel-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 10px rgba(244, 121, 32, 0.45));
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.brand-title .a {
  background: linear-gradient(90deg, #ff6b4a, #f47920);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-title .b {
  background: linear-gradient(90deg, #f1c40f, #2ecc71);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-title .l {
  margin-left: 6px;
  color: #fff;
  font-weight: 700;
}
.brand-sub {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 2px;
}

.wheel-top-actions {
  display: flex;
  gap: 8px;
}

.btn-ghost {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-ghost:hover {
  border-color: var(--orange);
  color: var(--orange-hot);
}

.wheel-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  align-items: start;
}

.wheel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.wheel-frame {
  position: relative;
  width: min(96vw, 620px);
  aspect-ratio: 1;
}

.wheel-pointer {
  position: absolute;
  right: -2px;
  top: 50%;
  z-index: 5;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-right: 28px solid var(--orange);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
}
.wheel-pointer::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb06a, var(--orange));
  box-shadow: 0 0 0 3px #1a120c, 0 0 12px rgba(244,121,32,0.7);
}

.wheel-ring {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow:
    0 0 0 6px #1a1a2e,
    0 0 0 10px rgba(244, 121, 32, 0.55),
    0 0 40px rgba(244, 121, 32, 0.25),
    inset 0 0 40px rgba(0,0,0,0.35);
  overflow: hidden;
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  transition: transform 0s;
  will-change: transform;
}

.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #2a2a3e, #0c0c14 70%);
  border: 3px solid rgba(244, 121, 32, 0.85);
  box-shadow:
    0 0 0 4px #0a0a12,
    0 0 24px rgba(244, 121, 32, 0.45),
    inset 0 0 12px rgba(0,0,0,0.6);
  display: grid;
  place-items: center;
  z-index: 4;
  pointer-events: none;
}

.hub-logo {
  width: 68%;
  height: 68%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.spin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.btn-spin {
  appearance: none;
  border: none;
  cursor: pointer;
  min-width: 180px;
  padding: 16px 36px;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(135deg, #ff6a3d 0%, var(--orange) 45%, #c85e0a 100%);
  box-shadow:
    0 8px 24px rgba(244, 121, 32, 0.4),
    inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s;
}
.btn-spin:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.06);
}
.btn-spin:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}
.btn-spin:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-spin--sm {
  min-width: 120px;
  padding: 12px 24px;
  font-size: 0.95rem;
}

.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  user-select: none;
  cursor: pointer;
}
.chk input { accent-color: var(--orange); width: 16px; height: 16px; }

.spin-hint {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
}

.wheel-side {
  background: rgba(20, 20, 34, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 420px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.side-head h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ddd;
}
.count {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(244, 121, 32, 0.2);
  color: var(--orange-hot);
  font-size: 0.78rem;
}

.side-tools { display: flex; gap: 6px; }
.btn-mini {
  appearance: none;
  border: 1px solid var(--border);
  background: #1a1a2c;
  color: var(--text);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}
.btn-mini:hover { border-color: var(--orange); color: var(--orange-hot); }

.entries-box {
  flex: 1;
  min-height: 280px;
  width: 100%;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0c0c16;
  color: var(--text);
  padding: 12px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.45;
  outline: none;
}
.entries-box:focus {
  border-color: rgba(244, 121, 32, 0.7);
  box-shadow: 0 0 0 3px rgba(244, 121, 32, 0.15);
}

.btn-primary-wide {
  width: 100%;
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #c85e0a);
}
.btn-primary-wide:hover { filter: brightness(1.08); }

.side-note {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 6px;
}

.winner-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
}
.winner-modal.hidden { display: none; }

.winner-card {
  position: relative;
  width: min(92vw, 380px);
  text-align: center;
  padding: 32px 24px 28px;
  border-radius: 20px;
  background: linear-gradient(165deg, #1a1a2e, #10101a);
  border: 1px solid rgba(244, 121, 32, 0.55);
  box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 40px rgba(244,121,32,0.2);
  overflow: hidden;
}
.winner-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 30%, rgba(244,121,32,0.28), transparent 55%);
  pointer-events: none;
}
.winner-logo {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 16px rgba(244,121,32,0.5));
  animation: popIn 0.45s cubic-bezier(.2,1.4,.4,1) both;
}
.winner-kicker {
  position: relative;
  color: var(--orange-hot);
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.winner-name {
  position: relative;
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 800;
  margin-bottom: 8px;
  word-break: break-word;
  animation: popIn 0.5s 0.08s cubic-bezier(.2,1.4,.4,1) both;
}
.winner-shop {
  position: relative;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 35;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.7) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 900px) {
  .wheel-layout {
    grid-template-columns: 1fr;
  }
  .wheel-side {
    min-height: 280px;
  }
  .entries-box {
    min-height: 180px;
  }
}

/* Admin vs viewer */
.admin-only[hidden] { display: none !important; }

.wheel-role-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  vertical-align: middle;
}
.wheel-role-badge.is-admin {
  background: rgba(244, 121, 32, 0.25);
  color: var(--orange-hot);
  border: 1px solid rgba(244, 121, 32, 0.45);
}
.wheel-role-badge.is-live {
  background: rgba(46, 204, 113, 0.18);
  color: var(--green);
  border: 1px solid rgba(46, 204, 113, 0.4);
}

.viewer-note {
  display: none;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 8px;
  max-width: 360px;
}

body.wheel-viewer .viewer-note { display: block; }
body.wheel-viewer .wheel-layout {
  grid-template-columns: 1fr;
  justify-items: center;
}
body.wheel-viewer .wheel-stage {
  width: 100%;
  max-width: 520px;
}
body.wheel-admin .viewer-note { display: none; }
