@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800;900&display=swap');

:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.85);
  --border-glass: rgba(255, 255, 255, 0.1);
  --common-color: #3b82f6;
  --rare-color: #8b5cf6;
  --epic-color: #ec4899;
  --legendary-color: #eab308;
  --primary-accent: #6366f1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  user-select: none;
}

body {
  background: var(--bg-dark);
  color: #f3f4f6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15), transparent 70%),
    radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.1), transparent 50%);
}

/* Glassmorphism Header */
.app-header {
  width: 100%;
  max-width: 480px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #fff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.72rem;
  color: #9ca3af;
  font-weight: 500;
}

.sound-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: #9ca3af;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sound-toggle:hover, .sound-toggle.active {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border-color: #6366f1;
}

/* Main Container */
.main-wrapper {
  width: 100%;
  max-width: 480px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 3rem;
}

/* CS2 ROULETTE ENGINE STYLES */
.roulette-wrapper {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.25rem 0.5rem;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.roulette-header {
  text-align: center;
  margin-bottom: 0.75rem;
}

.roulette-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #f9fafb;
}

.roulette-header p {
  font-size: 0.78rem;
  color: #9ca3af;
}

.roulette-viewport {
  position: relative;
  width: 100%;
  height: 185px;
  overflow: hidden;
  border-radius: 14px;
  background: #070a12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
}

/* Center Pointer Line (Selector) */
.selector-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #f59e0b, #ef4444, #f59e0b);
  z-index: 30;
  box-shadow: 0 0 15px #ef4444, 0 0 30px #f59e0b;
}

.selector-pointer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 14px solid #f59e0b;
}

.selector-pointer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 14px solid #f59e0b;
}

.roulette-track {
  display: flex;
  gap: 12px;
  height: 100%;
  align-items: center;
  padding: 0 10px;
  will-change: transform;
  transform: translateX(0px);
}

/* CS2 Skin Card */
.skin-card {
  flex: 0 0 130px;
  height: 165px;
  background: rgba(30, 41, 59, 0.7);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skin-card.rarity-COMMON {
  border-bottom: 4px solid var(--common-color);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(59, 130, 246, 0.15) 100%);
}
.skin-card.rarity-RARE {
  border-bottom: 4px solid var(--rare-color);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(139, 92, 246, 0.15) 100%);
}
.skin-card.rarity-EPIC {
  border-bottom: 4px solid var(--epic-color);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(236, 72, 153, 0.15) 100%);
}
.skin-card.rarity-LEGENDARY {
  border-bottom: 4px solid var(--legendary-color);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(234, 179, 8, 0.25) 100%);
}

.skin-card.winning-highlight {
  transform: scale(1.05);
  box-shadow: 0 0 25px currentColor;
}

.rarity-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  letter-spacing: 0.5px;
}

.rarity-COMMON .rarity-badge { color: var(--common-color); border: 1px solid var(--common-color); }
.rarity-RARE .rarity-badge { color: var(--rare-color); border: 1px solid var(--rare-color); }
.rarity-EPIC .rarity-badge { color: var(--epic-color); border: 1px solid var(--epic-color); }
.rarity-LEGENDARY .rarity-badge { color: var(--legendary-color); border: 1px solid var(--legendary-color); }

.card-icon {
  width: 65px;
  height: 65px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}

.card-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  color: #f3f4f6;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Action Buttons */
.btn-spin {
  width: 100%;
  max-width: 480px;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 16px;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4), 0 0 15px rgba(139, 92, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.btn-spin:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(99, 102, 241, 0.6);
}

.btn-spin:disabled {
  background: linear-gradient(135deg, #374151, #4b5563);
  box-shadow: none;
  opacity: 0.7;
  cursor: not-allowed;
}

/* Modal Overlay Base */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

/* GRAND VICTORY MODAL STYLES */
.victory-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  border: 2px solid var(--legendary-color);
  border-radius: 28px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 0 50px rgba(234, 179, 8, 0.4), 0 25px 50px rgba(0, 0, 0, 0.9);
  transform: scale(0.9) translateY(30px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.modal-overlay.active .victory-card {
  transform: scale(1) translateY(0);
}

.victory-banner {
  background: linear-gradient(90deg, #f59e0b, #ef4444, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.4rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  0% { filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.5)); }
  100% { filter: drop-shadow(0 0 20px rgba(236, 72, 153, 0.9)); }
}

.victory-prize-display {
  width: 100%;
  padding: 1.5rem;
  border-radius: 20px;
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid var(--common-color);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.victory-prize-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.6));
}

.victory-prize-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
}

.btn-claim-victory {
  width: 100%;
  padding: 1.1rem;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 16px;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.5);
  transition: all 0.2s ease;
}

.btn-claim-victory:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(16, 185, 129, 0.7);
}

/* Modal Form Card */
.modal-card {
  width: 100%;
  max-width: 420px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 30px rgba(99, 102, 241, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.modal-header p {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

.form-group {
  margin-bottom: 0.9rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: 0.3rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: #6366f1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.btn-submit {
  width: 100%;
  padding: 0.95rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

/* REFERRAL HUB CARD STYLES */
.referral-card {
  width: 100%;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.referral-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.referral-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.referral-info h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.referral-info p {
  font-size: 0.78rem;
  color: #cbd5e1;
}

.referral-input-box {
  display: flex;
  gap: 0.5rem;
}

.referral-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  color: #a7f3d0;
  font-size: 0.8rem;
  font-family: monospace;
}

.btn-copy-ref {
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-copy-ref:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-share-tg {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #0088cc, #00a8e8);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 8px 20px rgba(0, 136, 204, 0.4);
}

/* ACTIVE WINNINGS ITEM CARD */
.winning-item-card {
  width: 100%;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.winning-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.winning-item-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.winning-item-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #ffffff;
}

.winning-item-code {
  font-family: monospace;
  font-size: 0.8rem;
  color: #f59e0b;
  font-weight: 700;
}

.btn-view-qr {
  padding: 0.5rem 0.85rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid #6366f1;
  border-radius: 10px;
  color: #818cf8;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-view-qr:hover {
  background: #6366f1;
  color: #fff;
}
