/* 모바일 앱 스타일 디자인 */
:root {
  --bg-main: #F8F8F8;
  --bg-card: #FFFFFF;
  --text-primary: #1C1C3A;
  --text-secondary: #676767;
  --text-muted: #999999;
  --accent-red: #FF1C1C;
  --accent-orange: #FFA127;
  --accent-cream: #FFDBAC;
  --button-dark: #221B2E;
  --border-light: #E7E7E7;
  --shadow: rgba(0, 0, 0, 0.05);
  --shadow-strong: rgba(0, 0, 0, 0.1);
}

/* 반응형 디자인 */
@media screen and (max-width: 480px) {
  .mobile-container {
    width: 100vw;
    padding: 0 16px;
  }
  
  .header {
    padding: 16px 0;
  }
  
  .main-card {
    margin: 0 0 20px;
  }
  
  .wheel {
    width: min(85vw, 320px);
    height: min(85vw, 320px);
  }
  
  .roulette-section {
    padding: 0;
  }
  
  .action-card {
    margin: 0 0 20px;
  }
}

@media screen and (max-width: 360px) {
  .wheel {
    width: min(80vw, 280px);
    height: min(80vw, 280px);
  }
  
  .main-content h1 {
    font-size: 14px;
  }
  
  .sub-text {
    font-size: 12px;
  }
}

@media screen and (min-width: 481px) and (max-width: 768px) {
  .mobile-container {
    max-width: 480px;
  }
  
  .wheel {
    width: 350px;
    height: 350px;
  }
  
  .main-content h1 {
    font-size: 14px;
  }
}

@media screen and (min-width: 769px) {
  .mobile-container {
    max-width: 393px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 16px;
    margin-bottom: 16px;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans KR', sans-serif;
  background: #F8F8F8;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.mobile-container {
  position: relative;
  width: 100%;
  max-width: 393px;
  min-height: 100vh;
  margin: 0 auto;
  background: #F8F8F8;
  padding: 0 env(safe-area-inset-left) 0 env(safe-area-inset-right);
}

/* 헤더 */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  background: transparent;
}

.brand {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--button-dark);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
}

.header-text {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}

.store-link {
  text-decoration: none;
  display: block;
  transition: all 0.2s ease;
}

.store-link:hover {
  transform: translateY(-1px);
}

.store-logo {
  height: 32px;
  width: auto;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.store-logo:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* 메인 카드 */
.main-card {
  margin: 0 16px 16px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px var(--shadow);
  border: 1px solid var(--border-light);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.event-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.coin-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
  animation: coinFloat 2s ease-in-out infinite;
}

@keyframes coinFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

.main-content h1 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.highlight {
  color: var(--accent-red);
  font-weight: 800;
}

.sub-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 룰렛 섹션 */
.roulette-section {
  padding: 0 16px;
  text-align: center;
  margin-bottom: 24px;
}

.pointer {
  width: 0;
  height: 0;
  margin: 0 auto 8px;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid var(--text-primary);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.wheel {
  width: min(75vw, 280px);
  height: min(75vw, 280px);
  margin: 0 auto;
  border-radius: 50%;
  border: 4px solid #FFD586;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
  transform: rotate(0deg);
  transition: transform 3.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.wheel svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.spin-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(20vw, 80px);
  height: min(20vw, 80px);
  border-radius: 50%;
  border: none;
  background: var(--button-dark);
  color: white;
  font-weight: 800;
  font-size: clamp(12px, 3.5vw, 14px);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.spin-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60%;
  text-align: center;
  transform-origin: center center;
  pointer-events: none;
  z-index: 5;
}

.label p {
  margin: 0;
  color: white;
  font-weight: 900;
  font-size: clamp(9px, 2.8vw, 11px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

/* 액션 카드 */
.action-card {
  margin: 0 16px 40px;
  background: #F0F0F0;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
}

.action-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 모달 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.hidden {
  display: none !important;
}

.modal-sheet {
  width: 100%;
  max-width: 393px;
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 24px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.result-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.result-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  flex-shrink: 0;
}

.result-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.result-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
}

.coupon-card {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.coupon-card.jackpot {
  background: linear-gradient(90deg, #FFF5F5, #FFF8E7, #FFF5F8);
  border-color: #FECACA;
  box-shadow: 0 0 24px rgba(255, 71, 87, 0.25);
}

.coupon-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.coupon-code {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.primary-button {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: var(--button-dark);
  color: white;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.secondary-button {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: white;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
}

.toast {
  text-align: center;
  font-size: 14px;
  color: #22C55E;
  font-weight: 500;
  margin-bottom: 8px;
}

.note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* 잭팟 효과 */
.jackpot {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}

.jackpot .rays {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.jackpot .rays::before,
.jackpot .rays::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200vw;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  transform-origin: 0 0;
  animation: rayRotate 2s infinite;
}

.jackpot .rays::after {
  animation-delay: 1s;
}

@keyframes rayRotate {
  0% { transform: scaleX(0.3) rotate(0deg); }
  50% { transform: scaleX(1) rotate(180deg); }
  100% { transform: scaleX(0.6) rotate(360deg); }
}

.glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80vw;
  height: 80vw;
  transform: translate(-50%, -50%);
  background: rgba(255, 28, 28, 0.15);
  filter: blur(80px);
  border-radius: 50%;
}