* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 8px;
  padding-bottom: 50px;
  position: relative;
  overflow-x: hidden;
  background: #0a0a1a;
}

/* ==================== DYNAMIC BACKGROUND ==================== */
#dynamic-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  background-size: cover;
  background-position: center;
}

/* ==================== ANIMATED PARTICLES ==================== */
#particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* cho tuyết nằm trên nền nhưng dưới wheel/panel */
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: floatParticle linear infinite;
  opacity: 0.8;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
}

@keyframes floatParticle {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 0.8;
  }

  90% {
    opacity: 0.8;
  }

  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Sparkle effect */
.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {

  0%,
  100% {
    opacity: 0;
    transform: scale(0);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==================== LAYOUT ==================== */
#main-container {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 60px auto 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* Cho phép canh trái/giữa/phải theo config */
  gap: 60px;
  /* Tăng gap từ 40px lên 60px để tránh overlap */
  padding: 0 20px 0 20px;
  /* padding dynamic từ config sẽ override */
}

/* ==================== LOGO ==================== */
#logo-link {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  cursor: pointer;
  transition: transform 0.3s ease;
}

#logo-link:hover {
  transform: translateX(-50%) scale(1.05);
}

#logo {
  max-width: 90px;
  width: auto;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* ==================== WHEEL ==================== */
#spin_the_wheel {
  position: relative;
  overflow: visible;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;

  /* --- MOBILE DEFAULT --- */
  width: 90vw;
  height: 90vw;
  max-width: 420px;
  max-height: 420px;
  min-width: 280px;
  min-height: 280px;
}

/* --- TABLET & DESKTOP --- */
@media (min-width: 768px) {
  #spin_the_wheel {
    /* Dùng vmin để đảm bảo vừa lọt màn hình cả ngang lẫn dọc */
    width: 60vmin;
    height: 60vmin;
    max-width: 550px;
    max-height: 550px;
  }
}

/* --- IPAD/TABLET LANDSCAPE (Khoảng 1024px - 1366px) --- */
@media (min-width: 1024px) and (orientation: landscape) {
  #main-container {
    flex-direction: row;
    /* Xếp ngang: Bánh xe trái - Quà phải */
    align-items: center;
    justify-content: center;
    gap: 40px;
  }

  #spin_the_wheel {
    width: 65vh;
    /* Ưu tiên chiều cao màn hình khi xoay ngang */
    height: 65vh;
  }

  #gift-panel {
    max-height: 70vh;
    /* Giới hạn chiều cao bảng quà */
  }
}

#wheel {
  display: block;
  width: 100%;
  height: 100%;
  /* Canvas sẽ được set size động trong JS với DPR support */
}

/* Wheel Arrow Indicator - Mũi tên chỉ vào sector đang quay */
/* Improved design from wheel-16.html - SVG teardrop shape */
.wheel-arrow {
  position: absolute;
  top: -6%;
  left: 50%;
  transform: translateX(-50%);
  width: 13%;
  height: 16%;
  z-index: 10;
  /* SVG teardrop shape - professional look */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="%23FF6B6B" d="M384 192c0 87.4-117 243-168.3 307.2c-12.3 15.3-35.1 15.3-47.4 0C117 435 0 279.4 0 192C0 86 86 0 192 0s192 86 192 192z"/></svg>');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease, height 0.3s ease;
}

/* Arrow nhỏ lại khi modal hiển thị */
.wheel-arrow.small {
  width: 6%;
  height: 8%;
  top: -3%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.wheel-arrow.active {
  opacity: 1;
}

/* Arrow glow effect khi đang quay */
.wheel-arrow.spinning {
  animation: arrowPulse 1s ease-in-out infinite;
}

@keyframes arrowPulse {

  0%,
  100% {
    transform: translateX(-50%) scale(1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  }

  50% {
    transform: translateX(-50%) scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(255, 107, 107, 0.6));
  }
}

#spin {
  font: 1em/0 "Lato", sans-serif;
  user-select: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26%;
  height: 26%;
  margin: -13%;
  background: #fff url('/logo-web-nka.png') center center / 60% 60% no-repeat;
  color: #fff;
  box-shadow: 0 0 0 5px currentColor, 0 0px 10px 3px rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  transition: 0.8s;
  font-weight: bold;
  overflow: hidden;
  /* Đảm bảo logo không tràn ra ngoài */
}

#spin.spin-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

#spin::after {
  content: "";
  position: absolute;
  top: -12px;
  border: 7px solid transparent;
  border-bottom-color: currentColor;
  border-top: none;
}

/* ==================== GATE OVERLAY ==================== */
#gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 4000;
  transition: opacity 0.3s ease;
}

#gate-overlay.hidden {
  display: none !important;
  /* Ẩn hoàn toàn thay vì chỉ opacity */
}

.gate-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(78, 205, 196, 0.3);
  border-radius: 14px;
  padding: 18px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(78, 205, 196, 0.15);
}

.gate-content h2 {
  text-align: center;
  color: #4ECDC4;
  font-size: 18px;
  margin: 0 0 15px 0;
}

#gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#gate-form label {
  font-weight: 600;
  color: #d4d4d8;
  font-size: 13px;
}

#gate-form input,
#gate-form select {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
  font-family: 'Lato', sans-serif;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

#gate-form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 35px;
}

#gate-form input:focus,
#gate-form select:focus {
  outline: none;
  border-color: #4ECDC4;
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

#gate-form select option {
  background: #1a1a1a;
  color: #fff;
  padding: 10px;
}

#gate-submit {
  margin-top: 5px;
  padding: 12px;
  background: linear-gradient(135deg, #4ECDC4 0%, #45B7D1 100%);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#gate-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(78, 205, 196, 0.35);
}

.gate-note {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: #a1a1aa;
  text-align: center;
}

#gate-message {
  font-weight: 600;
}

#gate-message.error {
  color: #ff5252;
}

#gate-message.success {
  color: #4ECDC4;
}

/* ==================== CONTROLS ==================== */
#controls {
  position: fixed;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 1000;
}

.control-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.control-btn:hover {
  transform: scale(1.1);
  background: rgba(78, 205, 196, 0.3);
}

.sound-on {
  background: rgba(78, 205, 196, 0.4);
}

.sound-off {
  background: rgba(100, 100, 100, 0.4);
}

/* ==================== CONFETTI ==================== */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #FF6B6B;
  top: -10px;
  border-radius: 2px;
}

@keyframes firework {
  0% {
    transform: translate(0, 0) rotate(var(--rotation));
    opacity: 1;
  }

  100% {
    transform: translate(var(--x), var(--y)) rotate(var(--rotation));
    opacity: 0;
  }
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti-fall {
  position: absolute;
  top: -20px;
  animation: confetti-fall linear forwards;
}

/* ==================== MODAL ==================== */
.modal {
  display: none;
  position: fixed;
  z-index: 5000;
  /* Cao hơn gate-overlay (4000) để luôn hiển thị trên cùng */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0c29 100%);
  border-radius: 14px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(78, 205, 196, 0.25);
  animation: slideUpScale 0.4s ease;
  overflow: hidden;
  border: 2px solid rgba(78, 205, 196, 0.4);
}

.modal-header {
  background: linear-gradient(135deg, #4ECDC4 0%, #45B7D1 100%);
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.confetti-icon {
  font-size: 22px;
  animation: bounce 0.6s ease infinite;
}

.modal-header h2 {
  color: white;
  font-size: 20px;
  font-weight: bold;
  margin: 0;
  flex: 1;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 50%;
}

.close-btn:hover {
  transform: scale(1.1) rotate(90deg);
}

.modal-body {
  padding: 25px 18px;
  text-align: center;
}

.winner-name {
  color: #e4e4e7;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 12px;
}

.gift-icon {
  font-size: 60px;
  margin-bottom: 15px;
  animation: bounce 0.8s ease;
  filter: drop-shadow(0 0 12px rgba(78, 205, 196, 0.5));
}

.prize-name {
  color: #4ECDC4;
  font-size: 26px;
  font-weight: bold;
  margin-top: 12px;
  text-shadow: 0 0 12px rgba(78, 205, 196, 0.7);
  background: linear-gradient(135deg, #4ECDC4 0%, #45B7D1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Modal Footer - 2x2 Grid Button Layout */
.modal-footer {
  padding: 0 20px 25px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Button Row - 2 nút lớn song song như mockup */
.button-row {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  width: 100%;
}

.cta-button {
  flex: 1;
  width: 50%;
  /* Đảm bảo bằng nhau */
  padding: 16px 14px;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  text-align: center;
  min-height: 60px;
  height: 60px;
  /* Fixed height để bằng nhau */
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.22);
}

.cta-button:active {
  transform: translateY(0);
}

.modal-footer {
  padding: 15px;
  text-align: center;
  border-top: 1px solid rgba(78, 205, 196, 0.2);
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.visit-button {
  background: linear-gradient(135deg, #4ECDC4 0%, #45B7D1 100%);
  color: white;
  border: none;
  padding: 12px 40px;
  border-radius: 8px;
  font-size: 12px;
  /* Nhỏ hơn button ĐÓNG */
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(78, 205, 196, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 180px;
  /* Đảm bảo bằng kích thước button ĐÓNG */
  height: 44px;
  /* Đảm bảo cùng chiều cao */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.visit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(78, 205, 196, 0.45);
}

.visit-button:active {
  transform: translateY(0);
}

.close-button {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  /* Màu đỏ */
  color: white;
  border: none;
  padding: 12px 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 180px;
  /* Đảm bảo bằng kích thước button Ghé thăm */
  height: 44px;
  /* Đảm bảo cùng chiều cao */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.close-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.45);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUpScale {
  0% {
    transform: translateY(60px) scale(0.85);
    opacity: 0;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* Website Button */
.website-btn {
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  color: white;
}

.website-btn:hover {
  background: linear-gradient(135deg, #FF5252, #FF7043);
}

/* Close/Exit Button */
.close-btn {
  background: linear-gradient(135deg, #2fc4d7, #00a3c4);
  color: white;
  border: none;
}

.close-btn:hover {
  background: linear-gradient(135deg, #1fb0c4, #0093b0);
}

/* Voucher section removed - no longer needed */

/* Old button styles removed - using grid buttons now */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-15px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==================== COPYRIGHT ==================== */
#copyright {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 8px;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
}

#copyright a {
  color: #FF0000;
  font-weight: bold;
  text-decoration: none;
  font-size: 11px;
  transition: color 0.3s ease;
}

#copyright a:hover {
  color: #FF6B6B;
}

/* ==================== GIFT PANEL ==================== */
#gift-panel {
  width: 320px;
  /* rộng hơn như mockup */
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  padding: 14px 14px 16px 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  flex-shrink: 0;
}

#gift-panel-title {
  text-align: center;
  color: #4ECDC4;
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 2px solid #4ECDC4;
  font-family: 'Lato', sans-serif;
}

#gift-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

#gift-list::-webkit-scrollbar {
  width: 5px;
}

#gift-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#gift-list::-webkit-scrollbar-thumb {
  background: #4ECDC4;
  border-radius: 10px;
}

.gift-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  transition: all 0.3s ease;
}

.gift-item:hover {
  border-color: #4ECDC4;
  box-shadow: 0 2px 8px rgba(78, 205, 196, 0.2);
  transform: translateY(-1px);
}

.gift-item-name {
  color: #333;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  font-family: 'Lato', sans-serif;
  line-height: 1.2;
}

.gift-item-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
  max-height: 55px;
}

/* ==================== RESPONSIVE ==================== */

/* Desktop: căn vòng quay và danh sách quà theo vị trí mong muốn */
@media (min-width: 1025px) {
  #main-container {
    position: relative;
  }

  /* Vòng quay - vị trí 1 (trên bên phải) */
  #spin_the_wheel {
    position: absolute;
    top: 80px;
    right: 420px;
  }

  /* Danh sách phần quà - vị trí 2 (dưới, hơi lệch sang phải) */
  #gift-panel {
    position: absolute;
    top: 430px;
    right: 260px;
  }
}


/* Tablet */
@media (max-width: 800px) {
  #main-container {
    flex-direction: column;
    align-items: flex-end;
    /* Giữ align-items: flex-end cho tablet/mobile */
    margin-top: 55px;
    padding: 0 20px;
    /* Giảm padding cho tablet */
  }

  #gift-panel {
    width: 100%;
    max-width: 340px;
    max-height: none;
    margin-top: 12px;
  }

  /* Improved responsive - dùng vmin như wheel-16.html */
  #spin_the_wheel {
    width: 55vmin;
    height: 55vmin;
    max-width: 380px;
    max-height: 380px;
    min-width: 280px;
    min-height: 280px;
  }

  .wheel-arrow {
    top: -20px;
    border-left-width: 15px;
    border-right-width: 15px;
    border-top-width: 25px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  body {
    padding: 5px;
    padding-bottom: 45px;
  }

  #main-container {
    margin-top: 50px;
    gap: 20px;
    /* Tăng gap một chút cho mobile */
    padding: 0 10px;
    /* Giảm padding cho mobile */
    align-items: flex-end;
    /* Giữ align-items: flex-end cho mobile */
  }

  #logo {
    max-width: 70px;
  }

  /* Mobile responsive - improved */
  #spin_the_wheel {
    width: 90vw;
    height: 90vw;
    max-width: 340px;
    max-height: 340px;
    min-width: 240px;
    min-height: 240px;
  }

  #spin {
    font-size: 0.85em;
  }

  #gift-panel {
    max-width: 100%;
    padding: 8px;
  }

  #gift-panel-title {
    font-size: 12px;
  }

  #gift-list {
    gap: 5px;
  }

  .gift-item {
    padding: 3px;
  }

  .gift-item-name {
    font-size: 9px;
  }

  .gift-item-image {
    max-height: 45px;
  }

  .gate-content {
    padding: 14px;
  }

  .gate-content h2 {
    font-size: 16px;
  }

  .modal-content {
    max-width: 95%;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .gift-icon {
    font-size: 50px;
  }

  .prize-name {
    font-size: 18px;
  }

  .winner-name {
    font-size: 13px;
  }

  /* Button row responsive */
  .button-row {
    gap: 10px;
  }

  .cta-button {
    font-size: 16px;
    padding: 14px 10px;
    min-height: 56px;
  }


  #copyright a {
    font-size: 9px;
  }

  .control-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

/* Very small phones */
@media (max-width: 350px) {
  #spin_the_wheel {
    width: 85vw;
    height: 85vw;
    max-width: 280px;
    max-height: 280px;
    min-width: 200px;
    min-height: 200px;
  }

  .gift-item-image {
    max-height: 40px;
  }
}

/* Desktop */
@media (min-width: 1000px) {
  #spin_the_wheel {
    width: 50vmin;
    height: 50vmin;
    max-width: 420px;
    max-height: 420px;
    min-width: 380px;
    min-height: 380px;
  }

  #gift-panel {
    width: 280px;
  }
}

/* Large screens */
@media (min-width: 1400px) {
  #spin_the_wheel {
    width: 45vmin;
    height: 45vmin;
    max-width: 480px;
    max-height: 480px;
    min-width: 420px;
    min-height: 420px;
  }

  #gift-panel {
    width: 300px;
  }
}

/* ==================== TABLET OPTIMIZATION ==================== */
/* Huawei MatePad SE 11 - Resolution: ~1920x1200, viewport ~960px */
/* iPad 9th & 7th Generation - Resolution: 2160x1620, viewport ~810px */
@media (min-width: 768px) and (max-width: 1024px) {
  #spin_the_wheel {
    width: 60vmin;
    height: 60vmin;
    max-width: 400px;
    max-height: 400px;
    min-width: 320px;
    min-height: 320px;
  }

  #gift-panel {
    width: 100%;
    max-width: 360px;
    margin-top: 20px;
  }

  #main-container {
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 0 30px;
  }

  /* Tối ưu font size cho tablet */
  .prize-name {
    font-size: 20px;
  }

  .winner-name {
    font-size: 16px;
  }

  .cta-button {
    font-size: 17px;
    padding: 15px 12px;
    min-height: 58px;
  }
}

/* iPad specific - Portrait mode */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  #spin_the_wheel {
    width: 65vmin;
    height: 65vmin;
    max-width: 450px;
    max-height: 450px;
  }
}

/* iPad specific - Landscape mode */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
  #spin_the_wheel {
    width: 50vmin;
    height: 50vmin;
    max-width: 420px;
    max-height: 420px;
  }

  #main-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
  }
}

/* --- USER LIGHT MODE --- */
body.light-mode {
  background-color: #f0fdf4;
  /* Very light green */
  background-image: none;
}

body.light-mode #gate-overlay {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
}

body.light-mode .gate-content {
  background: #ffffff;
  border: 1px solid #4ECDC4;
  box-shadow: 0 10px 40px rgba(78, 205, 196, 0.15);
}

body.light-mode .gate-content h2 {
  color: #1a1a2e;
}

body.light-mode .gate-content label {
  color: #475569;
}

body.light-mode .gate-content input,
body.light-mode .gate-content select {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

body.light-mode .gate-content input::placeholder {
  color: #94a3b8;
}

body.light-mode .control-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

body.light-mode #copyright {
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid #e2e8f0;
}

body.light-mode #copyright a {
  color: #dc2626;
}

/* Modal in Light Mode */
body.light-mode .modal-content {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

body.light-mode .winner-name {
  color: #475569;
}