* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

/* ẢNH NỀN */
.bg-fallback {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 1;
  transition: opacity 0.8s ease-out;
}

.bg-fallback.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* VIDEO NỀN */
.bg-video {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  display: none;
  opacity: 0;
  transition: opacity 0.8s ease-in;
}

.bg-video.loaded {
  display: block !important;
  opacity: 1;
}

/* LỚP PHỦ MỜ */
.bg-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
  pointer-events: none;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 0 !important;
  margin: 0;
  color: #fff;
  text-align: center;
  width: 100vw;
  overflow-x: hidden;
}

.main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  gap: 35px;
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 24px;
  padding: 35px 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow: hidden;
  margin: 0 auto;
  margin-bottom: 100px;
}

@media (min-width: 768px) {
  .main-container {
    max-width: 650px;
    padding: 30px;
    gap: 25px;
    margin-bottom: 0;
  }
}

.header-text {
  width: 100%;
  text-align: center;
  text-shadow: 3px 3px 10px rgba(0,0,0,0.9);
}

h1 {
  font-size: 2.2rem;
  color: #fff;
  font-weight: bold;
}

.header-text p {
  font-size: 1rem;
  margin-top: 8px;
  opacity: 0.95;
}

@media (min-width: 768px) {
  h1 { font-size: 3.2rem; }
  .header-text p { font-size: 1.2rem; }
}

.wheel-container {
  position: relative;
  width: 340px;
  height: 340px;
  margin: 0 auto;
  filter: drop-shadow(0 0 20px rgba(0,0,0,0.7));
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .wheel-container {
    width: 600px;
    height: 600px;
  }
}

#wheel, #centerCanvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

#wheel {
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  z-index: 1;
}

#centerCanvas {
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
}

.pointer {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-top: 60px solid #ffd700;
  z-index: 10;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.6));
}

@media (min-width: 768px) {
  .pointer {
    top: -25px;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
    border-top: 70px solid #ffd700;
  }
}

.spin-btn {
  padding: 14px 40px;
  font-size: 1.3rem;
  font-weight: bold;
  color: #333;
  background: #ffd700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255,215,0,0.5);
  transition: all 0.3s;
  z-index: 5;
}

@media (min-width: 768px) {
  .spin-btn {
    padding: 18px 60px;
    font-size: 1.6rem;
  }
}

.spin-btn:hover {
  background: #ffc107;
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(255,193,7,0.6);
}

.spin-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
  transform: none;
}

.popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 15px;
}

.popup {
  background: white;
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  animation: popupShow 0.5s ease-out;
}

@media (min-width: 768px) {
  .popup { max-width: 480px; }
}

@keyframes popupShow {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.popup-header {
  background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
  color: white;
  padding: 18px 15px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: bold;
}

@media (min-width: 768px) {
  .popup-header { padding: 20px; font-size: 1.5rem; }
}

.popup-body {
  padding: 20px 18px;
  text-align: center;
}

@media (min-width: 768px) {
  .popup-body { padding: 30px 25px; }
}

.prize-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin: 0 auto 12px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
  .prize-img { width: 100px; height: 100px; }
}

.prize-name {
  font-size: 1.4rem;
  font-weight: bold;
  margin: 8px 0;
  color: #333;
}

@media (min-width: 768px) {
  .prize-name { font-size: 1.6rem; }
}

.prize-desc {
  color: #666;
  margin-bottom: 18px;
  line-height: 1.5;
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  .prize-desc { font-size: 1rem; }
}

.claim-btn {
  padding: 10px 30px;
  font-size: 1rem;
  font-weight: bold;
  color: white;
  background: #4CAF50;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: 0.3s;
}

@media (min-width: 768px) {
  .claim-btn { padding: 12px 35px; font-size: 1.1rem; }
}

.claim-btn:hover {
  background: #45a049;
  transform: scale(1.05);
}

.close-popup {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.6rem;
  color: white;
  cursor: pointer;
  opacity: 0.8;
}

.close-popup:hover {
  opacity: 1;
}

.contact-bar {
  position: fixed;
  z-index: 9999;
  display: flex;
  gap: 18px;
  padding: 10px;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  transition: all 0.4s ease;
}

@media (min-width: 769px) {
  .contact-bar {
    flex-direction: column;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 768px) {
  .contact-bar {
    flex-direction: row;
    justify-content: center;
    left: 50%;
    bottom: 15px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  }
}

.contact-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  text-decoration: none;
  overflow: visible;
}

.contact-btn img {
  width: 30px;
  height: 30px;
  z-index: 10;
  filter: brightness(0) invert(1);
}

.contact-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.ring {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  opacity: 0.9;
  animation: spin 1.8s linear infinite;
  z-index: 1;
}

.ring-inner {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-bottom-color: currentColor;
  border-left-color: currentColor;
  opacity: 0.7;
  animation: spin 1.8s linear infinite reverse;
  z-index: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.telegram { background: #229ED9; color: #6CCFFC; }
.facebook { background: #1877F2; color: #5BA8FF; }
.zalo     { background: #00ADEF; color: #4DD0FF; }

@media (max-width: 768px) {
  .contact-btn { width: 50px; height: 50px; }
  .contact-btn img { width: 26px; height: 26px; }
  .ring { width: 64px; height: 64px; }
  .ring-inner { width: 56px; height: 56px; }
}

@media (max-width: 480px) {
  .contact-bar { gap: 12px; padding: 8px; }
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1002;
}