* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ff6b35 100%);
  min-height: 100vh;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
}

.welcome-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 20px;
}

.logo {
  margin-bottom: 30px;
}

.logo-icon {
  font-size: 80px;
  animation: bounce 2s ease-in-out infinite;
  margin-bottom: 20px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.logo-title {
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
}

.welcome-desc {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 40px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 48px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
  border: none;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 220px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(255, 71, 87, 0.5);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.welcome-tips {
  margin-top: 24px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.page-verify {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.verify-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
}

.verify-content {
  position: relative;
  z-index: 10;
  width: 90%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.verify-header {
  text-align: center;
  margin-bottom: 32px;
}

.verify-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.verify-header h2 {
  font-size: 26px;
  font-weight: 600;
  color: #333;
}

.verify-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.form-group input:focus {
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
  color: #999;
}

.btn-verify {
  margin-top: 12px;
}

.verify-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.verify-error {
  text-align: center;
  padding: 20px;
  background: rgba(255, 71, 87, 0.1);
  border-radius: 12px;
  color: #ff4757;
  margin-top: 16px;
}

.page-lottery {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  overflow-y: auto;
}

.lottery-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 20%, rgba(255, 107, 53, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.lottery-header {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 30px 20px 20px;
}

.lottery-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin-bottom: 12px;
}

.lottery-info {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.chance-count {
  font-size: 16px;
  color: #fff;
}

.chance-count span {
  color: #ffd700;
  font-weight: 700;
  font-size: 18px;
}

.lottery-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.wheel-wrapper {
  position: relative;
  width: 85vw;
  max-width: 340px;
  aspect-ratio: 1;
  margin-bottom: 24px;
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.4),
              0 10px 40px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 35px solid #ffd700;
  z-index: 20;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.wheel-pointer::after {
  content: '';
  position: absolute;
  top: -42px;
  left: -24px;
  width: 48px;
  height: 48px;
  background: radial-gradient(circle, #ffd700 0%, #ffaa00 100%);
  border-radius: 50%;
  z-index: -1;
  box-shadow: 0 4px 12px rgba(255, 170, 0, 0.5);
}

.btn-spin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 50px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ff6b35 100%);
  border: none;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(255, 107, 53, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 240px;
}

.btn-spin:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(255, 107, 53, 0.6);
}

.btn-spin:active:not(:disabled) {
  transform: translateY(-2px);
}

.btn-spin:disabled {
  background: #666;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-icon {
  font-size: 24px;
}

.prize-list {
  position: relative;
  z-index: 10;
  padding: 20px;
  margin-top: 20px;
}

.prize-title {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  margin-bottom: 20px;
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.prize-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.prize-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.prize-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.prize-name {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  word-break: break-all;
}

.page-result {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.result-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.2) 0%, transparent 60%);
}

.result-content {
  position: relative;
  z-index: 10;
  width: 90%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 50px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-icon {
  font-size: 100px;
  margin-bottom: 20px;
  animation: bounce 1s ease infinite;
}

.result-title {
  font-size: 32px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
}

.result-desc {
  font-size: 16px;
  color: #666;
  margin-bottom: 24px;
}

.result-prize {
  display: inline-block;
  padding: 16px 32px;
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  border-radius: 50px;
  margin-bottom: 32px;
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.4);
}

.result-prize span {
  font-size: 20px;
  font-weight: 700;
  color: #333;
}

.result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #666;
  background: #f5f5f5;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #e8e8e8;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 110;
  width: 90%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #e8e8e8;
}

.modal-body {
  padding: 20px 24px;
  max-height: 300px;
  overflow-y: auto;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 12px;
}

.record-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.record-icon {
  font-size: 28px;
}

.record-detail {
  display: flex;
  flex-direction: column;
}

.record-prize {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.record-time {
  font-size: 12px;
  color: #999;
}

.record-status {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
}

.record-status.won {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
}

.record-status.lost {
  background: rgba(158, 158, 158, 0.1);
  color: #9e9e9e;
}

.record-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-icon + span {
  color: #999;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 16px 32px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border-radius: 12px;
  font-size: 16px;
  z-index: 200;
  backdrop-filter: blur(4px);
  animation: fadeToast 0.3s ease;
}

@keyframes fadeToast {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media screen and (max-width: 480px) {
  .logo-title {
    font-size: 32px;
  }

  .logo-icon {
    font-size: 64px;
  }

  .btn-primary {
    padding: 14px 36px;
    font-size: 18px;
    min-width: 200px;
  }

  .verify-content {
    padding: 30px 24px;
    margin: 0 16px;
  }

  .verify-header h2 {
    font-size: 22px;
  }

  .lottery-title {
    font-size: 26px;
  }

  .wheel-wrapper {
    width: 90vw;
    max-width: 320px;
  }

  .btn-spin {
    padding: 16px 40px;
    font-size: 20px;
    min-width: 200px;
  }

  .prize-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .prize-icon {
    font-size: 24px;
  }

  .prize-name {
    font-size: 11px;
  }

  .result-content {
    padding: 40px 24px;
    margin: 0 16px;
  }

  .result-icon {
    font-size: 80px;
  }

  .result-title {
    font-size: 28px;
  }

  .result-actions {
    flex-direction: column;
  }

  .btn-secondary,
  .btn-primary {
    width: 100%;
  }
}

@media screen and (max-width: 320px) {
  .prize-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}