/* ============================================
   LOTTERY SYSTEM - PREMIUM CSS
   ============================================ */

/* CSS Variables / Design Tokens */
:root {
  --bg-primary: #0a0a2e;
  --bg-secondary: #12123a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  --accent-gold: #FFD700;
  --accent-gold-dark: #C5A000;
  --accent-rose: #FF6B8A;
  --accent-violet: #8B5CF6;
  --accent-cyan: #06D6A0;
  --accent-blue: #3B82F6;
  --gradient-gold: linear-gradient(135deg, #FFD700, #FFA500, #FF6B35);
  --gradient-rose: linear-gradient(135deg, #FF6B8A, #FF3CAC);
  --gradient-violet: linear-gradient(135deg, #8B5CF6, #6D28D9);
  --gradient-cyan: linear-gradient(135deg, #06D6A0, #00B4D8);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.3);
  --shadow-gold: 0 0 30px rgba(255, 215, 0, 0.3);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ============ Particles Canvas ============ */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============ Header ============ */
.main-header {
  position: relative;
  text-align: center;
  padding: 60px 20px 40px;
  z-index: 1;
}

.header-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.15), transparent 70%);
  pointer-events: none;
}

.glitch-text {
  font-size: 3.5rem;
  font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  text-shadow: none;
  animation: titlePulse 3s ease-in-out infinite;
  position: relative;
}

@keyframes titlePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.subtitle-text {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-top: 12px;
  font-weight: 300;
  letter-spacing: 6px;
  animation: fadeInUp 1s ease 0.3s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ Section Title ============ */
.section-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.title-icon {
  font-size: 1.8rem;
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============ Prize Selector ============ */
.prize-selector-section {
  position: relative;
  z-index: 1;
  padding: 20px 40px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.prize-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.prize-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 28px;
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.prize-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-gold);
  transform: scaleX(0);
  transition: transform var(--transition-smooth);
}

.prize-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
  border-color: rgba(139, 92, 246, 0.3);
}

.prize-card:hover::before {
  transform: scaleX(1);
}

.prize-card-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.prize-card-level.level-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
  color: var(--accent-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.prize-card-level.level-2 {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(169, 169, 169, 0.2));
  color: #C0C0C0;
  border: 1px solid rgba(192, 192, 192, 0.3);
}

.prize-card-level.level-3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(184, 115, 51, 0.2));
  color: #CD7F32;
  border: 1px solid rgba(205, 127, 50, 0.3);
}

.prize-card-level.level-other {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(109, 40, 217, 0.2));
  color: var(--accent-violet);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.prize-card-image {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.prize-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prize-card-image .no-image {
  font-size: 3rem;
  opacity: 0.3;
}

.prize-card-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.prize-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.prize-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prize-card-remaining {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.prize-card-remaining strong {
  color: var(--accent-cyan);
  font-size: 1.1rem;
}

.prize-card-action {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: var(--gradient-violet);
  color: white;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.prize-card-action:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.prize-card.exhausted {
  opacity: 0.4;
  pointer-events: none;
}

.prize-card.exhausted .prize-card-action {
  background: rgba(255, 255, 255, 0.1);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 1.1rem;
}

/* ============ Lottery Section ============ */
.lottery-section {
  position: relative;
  z-index: 1;
  padding: 20px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lottery-container {
  position: relative;
  display: flex;
  justify-content: center;
}

.wheel-wrapper {
  position: relative;
  width: 500px;
  height: 500px;
}

#wheel-canvas {
  width: 500px;
  height: 500px;
  border-radius: 50%;
  box-shadow: 
    0 0 0 8px rgba(255, 215, 0, 0.3),
    0 0 0 12px rgba(139, 92, 246, 0.2),
    0 0 60px rgba(139, 92, 246, 0.2);
  transition: filter 0.3s;
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.spin-button {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid rgba(255, 215, 0, 0.5);
  background: radial-gradient(circle, #1a1a4e, #0d0d35);
  color: var(--accent-gold);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-smooth);
  box-shadow: 
    0 0 20px rgba(255, 215, 0, 0.2),
    inset 0 0 20px rgba(255, 215, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-button:hover {
  transform: scale(1.1);
  box-shadow: 
    0 0 40px rgba(255, 215, 0, 0.4),
    inset 0 0 30px rgba(255, 215, 0, 0.2);
  border-color: var(--accent-gold);
}

.spin-button:active {
  transform: scale(0.95);
}

.spin-button.spinning {
  pointer-events: none;
  opacity: 0.6;
}

.spin-text {
  line-height: 1.3;
  text-align: center;
}

.wheel-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 36px solid var(--accent-gold);
  z-index: 10;
  filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.5));
}

/* Wheel Lights */
.wheel-lights {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  height: 520px;
  border-radius: 50%;
  z-index: -1;
}

.wheel-light {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

.wheel-light.alt {
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
}

/* Draw controls */
.draw-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.draw-count-label {
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.draw-count-input {
  width: 60px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  text-align: center;
  font-family: var(--font-family);
}

.draw-count-input:focus {
  outline: none;
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* ============ Buttons ============ */
.btn {
  padding: 10px 24px;
  border-radius: var(--radius-full);
  border: none;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--gradient-violet);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-glow {
  animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 25px rgba(139, 92, 246, 0.6); }
}

.btn-back {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* ============ Winner Modal ============ */
.winner-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.winner-modal.show {
  display: flex;
}

.winner-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.winner-modal-content {
  position: relative;
  background: linear-gradient(145deg, #1a1a4e, #12123a);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
  animation: modalIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 
    0 0 60px rgba(255, 215, 0, 0.15),
    0 25px 60px rgba(0, 0, 0, 0.5);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.winner-modal-header {
  margin-bottom: 24px;
}

.trophy-icon {
  font-size: 4rem;
  animation: trophyBounce 1s ease infinite;
  margin-bottom: 12px;
}

@keyframes trophyBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-5deg); }
  75% { transform: scale(1.1) rotate(5deg); }
}

.winner-modal-header h2 {
  font-size: 2rem;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.winner-prize-info {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  font-size: 1.1rem;
  color: var(--accent-gold);
}

.winner-list {
  margin-bottom: 32px;
}

.winner-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  animation: winnerSlideIn 0.5s ease both;
}

.winner-item:nth-child(1) { animation-delay: 0.1s; }
.winner-item:nth-child(2) { animation-delay: 0.2s; }
.winner-item:nth-child(3) { animation-delay: 0.3s; }
.winner-item:nth-child(4) { animation-delay: 0.4s; }
.winner-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes winnerSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.winner-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gradient-violet);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.winner-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.winner-dept {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Confetti */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(600px) rotate(720deg);
    opacity: 0;
  }
}

/* ============ History Sidebar ============ */
.history-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all var(--transition-fast);
}

.history-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.history-sidebar {
  position: fixed;
  right: -420px;
  top: 0;
  width: 400px;
  height: 100%;
  background: linear-gradient(180deg, #1a1a4e, #12123a);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 200;
  transition: right var(--transition-smooth);
  overflow-y: auto;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

.history-sidebar.open {
  right: 0;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-header h3 {
  font-size: 1.2rem;
}

.history-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.history-list {
  padding: 16px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all var(--transition-fast);
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.history-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-prize {
  font-size: 0.8rem;
  color: var(--accent-gold);
  margin-top: 2px;
}

.history-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============ Admin Link ============ */
.admin-link {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: all var(--transition-fast);
}

.admin-link:hover {
  background: var(--bg-card-hover);
  transform: rotate(90deg) scale(1.1);
}

/* ============ ADMIN PAGE STYLES ============ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #12123a, #0d0d30);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 50;
  overflow-y: auto;
}

.admin-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}

.admin-logo h2 {
  font-size: 1.3rem;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-logo p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-nav {
  list-style: none;
}

.admin-nav li {
  margin: 2px 8px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.admin-nav a.active {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
  font-weight: 600;
}

.admin-nav-icon {
  font-size: 1.2rem;
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 32px 40px;
}

.admin-page-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.admin-page-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: all var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.stat-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Admin Cards / Sections */
.admin-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-card-title {
  font-size: 1.2rem;
  font-weight: 700;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-helper {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

.data-table tbody tr {
  transition: all var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table-prize-image {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-sm-edit {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.btn-sm-edit:hover {
  background: rgba(59, 130, 246, 0.25);
}

.btn-sm-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.btn-sm-delete:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-gold { background: rgba(255, 215, 0, 0.15); color: var(--accent-gold); }
.badge-silver { background: rgba(192, 192, 192, 0.15); color: #C0C0C0; }
.badge-bronze { background: rgba(205, 127, 50, 0.15); color: #CD7F32; }
.badge-violet { background: rgba(139, 92, 246, 0.15); color: var(--accent-violet); }
.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-cyan); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #EF4444; }

/* Login card */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 400px;
  max-width: 90%;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
}

.login-card h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.login-card .form-input {
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.1rem;
  padding: 14px;
}

.login-error {
  color: #EF4444;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

/* Color preview */
.color-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-preview input[type="color"] {
  width: 50px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
}

/* Toggle switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle.active {
  background: var(--accent-violet);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: all var(--transition-fast);
}

.toggle.active::after {
  left: 25px;
}

/* Modal styles (generic) */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: linear-gradient(145deg, #1a1a4e, #12123a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  animation: toastIn 0.4s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.toast-success {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

.toast-error {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}

.toast-info {
  background: rgba(59, 130, 246, 0.9);
  color: white;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .glitch-text {
    font-size: 2rem;
    letter-spacing: 2px;
  }

  .subtitle-text {
    font-size: 1rem;
    letter-spacing: 3px;
  }

  .prize-selector-section {
    padding: 20px 16px 40px;
  }

  .prize-cards {
    grid-template-columns: 1fr;
  }

  .wheel-wrapper {
    width: 320px;
    height: 320px;
  }

  #wheel-canvas {
    width: 320px;
    height: 320px;
  }

  .spin-button {
    width: 70px;
    height: 70px;
    font-size: 0.85rem;
  }

  .admin-sidebar {
    display: none;
  }

  .admin-main {
    margin-left: 0;
    padding: 20px 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .history-sidebar {
    width: 100%;
    right: -100%;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Selection */
::selection {
  background: rgba(139, 92, 246, 0.4);
  color: white;
}
