/* ==========================================================================
   OPC 超级派 · 抽奖系统样式表
   视觉基因：暗黑像素网格 + OPCπ 四色体素 + 薄荷绿霓虹光效
   ========================================================================== */

:root {
  --bg: #191919;
  --bg-elev: #202126;
  --bg-card: rgba(30, 32, 39, 0.88);
  --ink: #f5f7fa;
  --ink-muted: rgba(235, 240, 248, 0.68);
  --dark-ink: #121317;

  --mint: #00e5a0;
  --blue: #0066ff;
  --pink: #ff0055;
  --orange: #ff6600;
  --gold: #f0b232;
  --purple: #7c4dff;

  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.22);
  --line-mint: rgba(0, 229, 160, 0.42);
  --grid-line: rgba(255, 255, 255, 0.042);

  --radius: 24px;
  --radius-sm: 16px;
  --pad: clamp(20px, 4vw, 70px);
  --max-w: 1480px;

  --font-sans: "IBM Plex Sans", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

/* Typography */
.brand-title {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0;
}

.brand-title .grad {
  background: linear-gradient(90deg, var(--mint), #4db8ff, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-title {
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 700;
  margin: 0 0 8px;
}

.text-muted {
  color: var(--ink-muted);
}

.text-mint {
  color: var(--mint);
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--pad);
}

.page-header {
  padding: 24px var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(14, 16, 22, 0.72);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
}

.header-sub {
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.pixel-bar {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.pixel-bar i {
  width: 24px;
  height: 4px;
  border-radius: 1px;
}

.pixel-bar i:nth-child(1) { background: var(--mint); }
.pixel-bar i:nth-child(2) { background: var(--blue); }
.pixel-bar i:nth-child(3) { background: var(--pink); }
.pixel-bar i:nth-child(4) { background: var(--orange); }

/* Buttons */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
  font-family: inherit;
}

.pill-btn-primary {
  background: var(--mint);
  color: var(--dark-ink);
  box-shadow: 0 0 24px rgba(0, 229, 160, 0.28);
}

.pill-btn-primary:hover:not(:disabled) {
  background: #2affbe;
  transform: translateY(-2px);
  box-shadow: 0 0 34px rgba(0, 229, 160, 0.45);
}

.pill-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pill-btn-outline {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.24);
}

.pill-btn-outline:hover {
  background: var(--blue);
  border-color: var(--blue);
  transform: translateY(-2px);
}

.pill-btn-pink {
  background: var(--pink);
  color: var(--white);
  box-shadow: 0 0 24px rgba(255, 0, 85, 0.28);
}

.pill-btn-pink:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 34px rgba(255, 0, 85, 0.45);
}

.pill-btn-lg {
  padding: 18px 40px;
  font-size: 18px;
}

.pill-btn-sm {
  padding: 9px 18px;
  font-size: 13px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.3s var(--ease), border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(0, 229, 160, 0.45);
}

.glass-card {
  background: rgba(18, 20, 27, 0.86);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 20px;
}

/* Admin page layout */
.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 32px;
}

@media (max-width: 1024px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* Prize stage */
.prize-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.round-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(0, 229, 160, 0.1);
  border: 1px solid var(--line-mint);
  color: var(--mint);
  font-size: 14px;
  font-weight: 700;
}

.prize-title {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
}

.prize-subtitle {
  font-size: clamp(16px, 1.5vw, 22px);
  color: var(--ink-muted);
  margin: 0;
}

.prize-image-wrap {
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.prize-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
}

.prize-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(0, 229, 160, 0.2), transparent 60%);
  z-index: -1;
  animation: pulse-glow 3s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { opacity: 0.6; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* Draw button */
.draw-btn {
  min-width: 260px;
  position: relative;
  overflow: hidden;
}

.draw-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.draw-btn:hover::after {
  transform: translateX(100%);
}

/* Rolling winner */
.winner-display {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.winner-avatar {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  object-fit: cover;
  border: 3px solid var(--mint);
  box-shadow: 0 0 40px rgba(0, 229, 160, 0.3);
  background: var(--bg-elev);
}

.winner-avatar.rolling {
  animation: rolling-shake 0.15s linear infinite;
}

@keyframes rolling-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-3px) rotate(-2deg); }
  75% { transform: translateX(3px) rotate(2deg); }
}

.winner-name {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  margin: 0;
}

.winner-name.rolling {
  color: var(--mint);
  animation: text-flicker 0.1s linear infinite;
}

@keyframes text-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Winners list */
.winners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.winner-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
}

.winner-mini img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg-elev);
}

.winner-mini span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-mini {
  position: relative;
}

.winner-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 0, 85, 0.15);
  color: #ff4d79;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
  opacity: 0.7;
}

.winner-remove:hover {
  opacity: 1;
  background: rgba(255, 0, 85, 0.35);
  border-color: #ff4d79;
  transform: scale(1.1);
}

/* Round tabs */
.round-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.round-tab {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  font-family: inherit;
}

.round-tab:hover {
  border-color: var(--mint);
}

.round-tab.active {
  background: var(--mint);
  color: var(--dark-ink);
  border-color: var(--mint);
  box-shadow: 0 0 24px rgba(0, 229, 160, 0.28);
}

.round-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Progress */
.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--blue));
  border-radius: 999px;
  transition: width 0.5s var(--ease);
}

/* QR section */
.qr-wrap {
  background: white;
  padding: 16px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-wrap canvas,
.qr-wrap img {
  display: block;
}

/* Stats */
.stat-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

/* Join page */
.join-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.join-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--pad);
}

.join-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
}

.avatar-upload {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  position: relative;
  cursor: pointer;
}

.avatar-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.avatar-upload:hover .avatar-preview {
  border-color: var(--mint);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  font-size: 40px;
  color: var(--ink-muted);
}

.avatar-hint {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--mint);
  color: var(--dark-ink);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 20px rgba(0, 229, 160, 0.15);
}

.form-input::placeholder {
  color: rgba(235, 240, 248, 0.4);
}

.join-btn {
  width: 100%;
  margin-top: 8px;
}

/* Empty state */
.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--ink-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* Confetti */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Floating cubes decoration */
.floating-cube {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  animation: cube-float 6s ease-in-out infinite alternate;
}

.cube-1 { top: 10%; right: 5%; width: 40px; animation-delay: 0s; }
.cube-2 { bottom: 15%; left: 5%; width: 56px; animation-delay: 1.5s; }
.cube-3 { top: 60%; right: 8%; width: 28px; animation-delay: 3s; }

@keyframes cube-float {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-20px) rotate(15deg); }
}

/* Voxel cube SVG */
.voxel-cube {
  fill: currentColor;
}

/* Utility */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 13, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--line-mint);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(0, 229, 160, 0.2);
}

.modal-card h2 {
  font-size: 32px;
  margin: 0 0 12px;
}

.modal-card p {
  color: var(--ink-muted);
  margin: 0 0 24px;
}

/* Footer */
.page-footer {
  border-top: 1px solid var(--line);
  padding: 20px var(--pad);
  background: #08090d;
  color: var(--ink-muted);
  font-size: 13px;
  text-align: center;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--line-mint);
  color: var(--mint);
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 3000;
  transition: transform 0.3s var(--ease);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .page-header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-grid {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .winners-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .floating-cube {
    display: none;
  }
}


/* ==========================================================================
   Fullscreen Draw Show - 炫酷全屏抽奖动效
   ========================================================================== */

.draw-show {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #08090d;
}

.draw-show.open {
  display: flex;
}

.draw-show-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 229, 160, 0.12), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(0, 102, 255, 0.10), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255, 0, 85, 0.10), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(0, 102, 255, 0.08), transparent 70%),
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  animation: draw-bg-pulse 2s ease-in-out infinite alternate;
}

/* Network lines behind rotating avatars */
.draw-lines {
  position: absolute;
  width: min(90vw, 90vh);
  height: min(90vw, 90vh);
  max-width: 1000px;
  max-height: 1000px;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
  animation: draw-lines-pulse 3s ease-in-out infinite alternate;
}

.draw-lines line {
  stroke-dasharray: 6 4;
  animation: line-dash 1.2s linear infinite;
}

@keyframes draw-lines-pulse {
  0% { opacity: 0.55; }
  100% { opacity: 0.9; }
}

@keyframes line-dash {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -10; }
}

@keyframes draw-bg-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.05); opacity: 1; }
}

.draw-show-top {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
}

.draw-show-round {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--mint);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.draw-show-prize {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  color: var(--white);
  text-shadow: 0 0 40px rgba(0, 229, 160, 0.4);
}

.draw-countdown {
  position: absolute;
  z-index: 10;
  font-size: clamp(120px, 20vw, 280px);
  font-weight: 700;
  color: var(--mint);
  text-shadow: 0 0 80px rgba(0, 229, 160, 0.6);
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

.draw-countdown.active {
  animation: countdown-pop 0.9s ease-out forwards;
}

@keyframes countdown-pop {
  0% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 1; transform: scale(1.2); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* Rotating participant ring */
.draw-ring {
  position: absolute;
  width: min(90vw, 90vh);
  height: min(90vw, 90vh);
  max-width: 1000px;
  max-height: 1000px;
  border-radius: 50%;
  z-index: 1;
  animation: draw-ring-spin 10s linear infinite;
}

.draw-ring.reverse {
  animation-direction: reverse;
}

.draw-ring.forward {
  animation-direction: normal;
}

.draw-ring.turbo {
  animation-duration: 1.4s;
}

.draw-ring-inner {
  width: min(62vw, 62vh);
  height: min(62vw, 62vh);
  max-width: 680px;
  max-height: 680px;
  z-index: 1;
  opacity: 0.55;
  animation: draw-ring-spin 6s linear infinite reverse;
}

.draw-ring-inner.turbo {
  animation-duration: 1s;
}

@keyframes draw-ring-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.draw-ring-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, -50%);
  transition: transform 0.3s var(--ease);
}

.draw-ring-avatar {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s var(--ease);
}

.draw-ring-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.draw-ring-avatar svg {
  width: 44px;
  height: 44px;
}

.draw-ring-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  background: rgba(8, 9, 13, 0.65);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.draw-ring-item.active .draw-ring-avatar {
  border-color: var(--mint);
  box-shadow: 0 0 30px rgba(0, 229, 160, 0.55);
  transform: scale(1.25);
}

.draw-ring-item.active .draw-ring-name {
  color: var(--mint);
  background: rgba(0, 229, 160, 0.15);
  transform: scale(1.15);
}

.draw-ring-item-sm .draw-ring-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.draw-ring-item-sm .draw-ring-avatar svg {
  width: 28px;
  height: 28px;
}

.draw-ring-item-sm .draw-ring-name {
  display: none;
}

/* Center roulette */
.draw-roulette {
  position: relative;
  z-index: 5;
  width: min(38vw, 38vh);
  height: min(38vw, 38vh);
  max-width: 360px;
  max-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s var(--ease);
}

.draw-roulette.show {
  opacity: 1;
  transform: scale(1);
}

.draw-roulette-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 32px;
  border: 4px solid var(--mint);
  background: var(--bg-elev);
  box-shadow: 0 0 60px rgba(0, 229, 160, 0.4), inset 0 0 40px rgba(0, 229, 160, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: roulette-glow 0.2s linear infinite alternate;
}

@keyframes roulette-glow {
  0% { box-shadow: 0 0 40px rgba(0, 229, 160, 0.3), inset 0 0 30px rgba(0, 229, 160, 0.05); }
  100% { box-shadow: 0 0 80px rgba(0, 229, 160, 0.6), inset 0 0 50px rgba(0, 229, 160, 0.15); }
}

.draw-roulette-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.draw-roulette-avatar svg {
  width: 50%;
  height: 50%;
}

.draw-roulette-name {
  margin-top: 24px;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  color: var(--white);
  text-shadow: 0 0 20px rgba(0, 229, 160, 0.4);
  min-height: 1.2em;
}

.draw-roulette-name.flash {
  animation: name-flash 0.12s linear infinite alternate;
}

@keyframes name-flash {
  0% { opacity: 1; color: var(--white); }
  100% { opacity: 0.7; color: var(--mint); }
}

/* Winner reveal */
.draw-winner {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(8, 9, 13, 0.92);
  backdrop-filter: blur(10px);
}

.draw-winner.show {
  display: flex;
  animation: winner-reveal-in 0.6s var(--ease) forwards;
}

@keyframes winner-reveal-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.draw-winner-label {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 700;
  margin-bottom: 24px;
  background: linear-gradient(90deg, var(--mint), #4db8ff, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(0, 229, 160, 0.3);
  animation: winner-label-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes winner-label-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.draw-winner-avatar {
  width: min(28vw, 28vh);
  height: min(28vw, 28vh);
  max-width: 280px;
  max-height: 280px;
  border-radius: 40px;
  border: 5px solid var(--mint);
  background: var(--bg-elev);
  box-shadow: 0 0 80px rgba(0, 229, 160, 0.5);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: winner-avatar-pop 0.6s var(--ease) forwards;
}

@keyframes winner-avatar-pop {
  0% { transform: scale(0) rotate(-10deg); }
  60% { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

.draw-winner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.draw-winner-avatar svg {
  width: 50%;
  height: 50%;
}

.draw-winner-name {
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 700;
  color: var(--white);
  margin-top: 28px;
  text-shadow: 0 0 30px rgba(0, 229, 160, 0.4);
}

.draw-winner-prize {
  font-size: clamp(20px, 2.5vw, 32px);
  color: var(--ink-muted);
  margin-top: 12px;
  margin-bottom: 36px;
}

.draw-winner-prize span {
  color: var(--mint);
  font-weight: 700;
}

.draw-show-hint {
  display: none !important;
}

/* Duration selector */
.draw-duration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.draw-duration-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}

.duration-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}

.duration-pill:hover {
  border-color: var(--mint);
}

.duration-pill.active {
  background: var(--mint);
  color: var(--dark-ink);
  border-color: var(--mint);
  box-shadow: 0 0 16px rgba(0, 229, 160, 0.35);
}

/* Particles */
.draw-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.draw-particles::before,
.draw-particles::after {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    radial-gradient(circle, rgba(0, 229, 160, 0.35) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(0, 102, 255, 0.35) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 0, 85, 0.35) 1px, transparent 1.5px);
  background-size: 120px 120px, 180px 180px, 240px 240px;
  animation: particles-drift 18s linear infinite;
  opacity: 0.4;
}

.draw-particles::after {
  animation-duration: 24s;
  animation-direction: reverse;
  opacity: 0.25;
}

@keyframes particles-drift {
  0% { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(360deg) scale(1.1); }
}

/* Winner reveal flash */
.draw-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0;
  pointer-events: none;
  z-index: 25;
  transform: scale(0.2);
}

.draw-flash.bang {
  animation: flash-bang 0.55s ease-out forwards;
}

@keyframes flash-bang {
  0% { opacity: 0; transform: scale(0.2); }
  30% { opacity: 1; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(2); }
}

/* Scan lines overlay */
.draw-show::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 4;
  opacity: 0.3;
}

/* Responsive */
@media (max-width: 768px) {
  .draw-ring-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .draw-ring-avatar svg {
    width: 28px;
    height: 28px;
  }

  .draw-ring-name {
    font-size: 10px;
    max-width: 70px;
  }

  .draw-ring-item-sm .draw-ring-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .draw-ring-item-sm .draw-ring-avatar svg {
    width: 20px;
    height: 20px;
  }

  .draw-show-top {
    top: 24px;
  }

  .draw-show-hint {
    bottom: 24px;
  }
}

/* Participant number badges */
.draw-ring-number {
  font-size: 10px;
  font-weight: 700;
  color: var(--mint);
  background: rgba(0, 229, 160, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 160, 0.25);
  margin-top: -2px;
}

.draw-ring-item.active .draw-ring-number {
  color: var(--bg);
  background: var(--mint);
  border-color: var(--mint);
  transform: scale(1.15);
}

.draw-roulette-name {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
}

.roulette-number,
.winner-number {
  font-size: 0.55em;
  font-weight: 700;
  color: var(--mint);
  background: rgba(0, 229, 160, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 160, 0.3);
  vertical-align: middle;
}

.draw-winner-name {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.winner-badge-number {
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
  background: var(--mint);
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 8px;
}

#successNumber {
  letter-spacing: 0.05em;
}

.screenshot-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.screenshot-hint svg {
  flex-shrink: 0;
  color: var(--mint);
}

.avatar-placeholder.compressing {
  font-size: 13px;
  color: var(--ink-muted);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.round-tabs.disabled {
  pointer-events: none;
  opacity: 0.5;
  filter: grayscale(0.6);
}

.draw-stop-btn {
  margin-top: 32px;
  animation: stop-pulse 1.2s ease-in-out infinite alternate;
}

.draw-stop-btn.hidden {
  display: none;
}

@keyframes stop-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.4); }
  100% { box-shadow: 0 0 0 16px rgba(255, 0, 85, 0); }
}
