* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: linear-gradient(135deg, #f5e6d3 0%, #e8d5b7 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(139, 90, 43, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 90, 43, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 8px;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* 装饰元素 */
.decoration {
  position: fixed;
  width: 30px;
  height: 30px;
  opacity: 0.3;
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}

.decoration-tl {
  top: 20px;
  left: 20px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><text x="0" y="24" font-size="24" fill="%238B5A2B">🎋</text></svg>');
}

.decoration-br {
  bottom: 20px;
  right: 20px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><text x="0" y="24" font-size="24" fill="%238B5A2B">🖌️</text></svg>');
}

/* 标题区域 */
.title-area {
  flex: 0 0 15%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 0;
  position: relative;
}

.title-decoration {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #d4af37 0%, #8B5A2B 100%);
  opacity: 0.6;
  position: absolute;
}

.title-decoration-left {
  left: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.title-decoration-right {
  right: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: scaleX(-1);
}

.title-content {
  flex: 1;
  padding: 0 50px;
}

.main-title {
  font-size: clamp(20px, 5vw, 24px);
  color: #8B5A2B;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 8px;
  line-height: 1.3;
}

.subtitle {
  font-size: 14px;
  color: #999;
  font-style: italic;
}

/* 游戏区域 */
.game-area {
  flex: 0 0 65%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
}

/* 输入框 */
.input-container {
  width: 100%;
  max-width: 350px;
  margin-bottom: 30px;
}

.name-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 16px;
  background: #faf5ed;
  border: 1px solid #8B5A2B;
  border-radius: 8px;
  outline: none;
  transition: all 0.3s ease;
  text-align: center;
  font-family: 'Georgia', serif;
}

.name-input::placeholder {
  color: #999;
}

.name-input:focus {
  border-color: #d4af37;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.name-input:disabled {
  background: #e0e0e0;
  cursor: not-allowed;
}

/* 转盘容器 */
.roulette-container {
  position: relative;
  width: min(70vw, 300px);
  height: min(70vw, 300px);
  margin: 0 auto;
}

.roulette-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 20px solid #8B0000;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.roulette-pointer::after {
  content: '';
  position: absolute;
  top: -20px;
  left: -13px;
  width: 26px;
  height: 18px;
  border: 2px solid #d4af37;
  border-bottom: none;
  border-radius: 50% 50% 0 0;
}

.roulette-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(139, 90, 43, 0.4);
  border: 6px solid #d4af37;
  background: white;
  transition: transform 0.1s ease;
}

.roulette-canvas.spinning {
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
}

/* 按钮区域 */
.button-area {
  flex: 0 0 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.spin-button {
  width: 70%;
  max-width: 300px;
  height: 52px;
  background: linear-gradient(135deg, #8B0000 0%, #d4af37 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
  transition: all 0.3s ease;
  font-family: 'Georgia', serif;
}

.spin-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 0, 0, 0.4);
}

.spin-button:active:not(:disabled) {
  transform: scale(0.95);
}

.spin-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #999;
}

.button-icon {
  font-size: 20px;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
}

.modal-content {
  position: relative;
  width: 85%;
  max-width: 320px;
  background: white;
  border-radius: 12px;
  border: 2px solid #d4af37;
  padding: 30px 20px 20px;
  text-align: center;
  animation: slideUp 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-scroll-decoration {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 15px;
  background: #d4af37;
  border-radius: 50% 50% 0 0;
  border: 2px solid #8B5A2B;
  border-bottom: none;
}

.result-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-occupation {
  font-size: 20px;
  color: #d4af37;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.result-blessing {
  font-size: 16px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 20px;
  padding: 0 15px;
}

.retry-button {
  width: 60%;
  height: 40px;
  background: linear-gradient(135deg, #8B0000 0%, #d4af37 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Georgia', serif;
}

.retry-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}

.retry-button:active {
  transform: scale(0.95);
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 响应式调整 */
@media (max-width: 360px) {
  .main-title {
    font-size: 18px;
  }
  
  .subtitle {
    font-size: 12px;
  }
  
  .name-input {
    height: 44px;
    font-size: 14px;
  }
  
  .spin-button {
    height: 48px;
    font-size: 16px;
  }
}
