/* 1. 기본 리셋 및 폰트 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Gowun Batang', 'DM Sans', serif, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  
  /* 화사한 시안-블루 배경 그라데이션 */
  background: radial-gradient(circle at center, #e0f7fa 0%, #b2ebf2 50%, #80deea 100%);
  color: #1565c0;
}

/* ==========================================
   2. 로그인 화면 스타일
   ========================================== */
#loginScreen {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.stars {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.login-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  width: 360px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 131, 143, 0.15);
  position: relative;
  z-index: 10;
}

.logo h1, .title {
  font-size: 2.1rem;
  font-weight: 700;
  background: linear-gradient(to right, #0288d1, #26c6da);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  font-style: italic;
}

.logo p, .subtitle {
  font-size: 0.85rem;
  color: #00838f;
  margin-bottom: 30px;
}

.question {
  font-size: 1rem;
  font-weight: 600;
  color: #01579b;
  margin-bottom: 25px;
}

.input-wrap, .input-group {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin: 0 auto 30px auto;
  border-bottom: 2px solid #0288d1;
  padding-bottom: 4px;
  width: 140px;
}

.input-wrap span, .d-label {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0288d1;
  margin-right: 6px;
}

.input-wrap input[type="number"], input[type="number"] {
  font-size: 1.8rem;
  font-weight: 700;
  padding: 0;
  border: none;
  background: transparent;
  color: #01579b;
  width: 60px;
  text-align: center;
  outline: none;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.hint-text {
  font-size: 0.8rem;
  color: #00838f;
  line-height: 1.5;
  margin-bottom: 25px;
}

/* ==========================================
   3. 룰렛 / 슬롯머신 화면 스타일
   ========================================== */
.app-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

.app-header {
  text-align: center;
}

.app-header h1 {
  font-size: 2.1rem;
  font-weight: 700;
  background: linear-gradient(to right, #0288d1, #26c6da);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.app-header p {
  font-size: 0.9rem;
  color: #00838f;
}

.roulette-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  width: 100%;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 131, 143, 0.15);
  position: relative;
  overflow: hidden;
}

.sound-control {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.sound-btn {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid #80deea;
  font-size: 0.75rem;
  color: #00838f;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 12px;
  width: auto;
  box-shadow: none;
  transition: background 0.2s;
}

.sound-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}

.roulette-viewport {
  width: 100%;
  height: 60px;
  overflow: hidden;
  position: relative;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid #b2ebf2;
  margin-bottom: 24px;
}

.selection-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(38, 198, 218, 0.12);
  border-top: 2px solid #0288d1;
  border-bottom: 2px solid #0288d1;
  pointer-events: none;
  z-index: 2;
}

.slot-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  will-change: transform;
}

.slot-item {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: #01579b;
}

.result-card {
  margin-top: 20px;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #26c6da;
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  animation: fadeIn 0.5s ease-out forwards;
  box-shadow: 0 10px 25px rgba(0, 131, 143, 0.15);
}

.result-card.hidden {
  display: none;
}

.result-card h2 {
  font-size: 0.95rem;
  color: #00838f;
  margin-bottom: 6px;
}

.result-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: #01579b;
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(38, 198, 218, 0.3);
}

.history-section {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 131, 143, 0.1);
}

.history-section h3 {
  font-size: 0.95rem;
  color: #00838f;
  margin-bottom: 12px;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #01579b;
  animation: fadeIn 0.3s ease-out;
}

.empty-history {
  color: #80deea;
  font-size: 0.85rem;
  text-align: center;
  padding: 8px 0;
}

/* ==========================================
   4. 공통 버튼 디자인
   ========================================== */
#loginBtn, .spin-btn, .submit-btn, button {
  width: 100%;
  padding: 14px 0;
  background: linear-gradient(135deg, #2196f3, #4fc3f7);
  color: #ffffff;
  border: none;
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

#loginBtn:hover:not(:disabled), .spin-btn:hover:not(:disabled), .submit-btn:hover:not(:disabled), button:hover {
  background: linear-gradient(135deg, #1e88e5, #29b6f6);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

#loginBtn:active:not(:disabled), .spin-btn:active:not(:disabled), .submit-btn:active:not(:disabled), button:active {
  transform: scale(0.98);
}

.spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.respin-btn {
  background: #ffffff !important;
  color: #0288d1 !important;
  border: 2px solid #0288d1 !important;
  box-shadow: none !important;
}

.respin-btn:hover {
  background: #0288d1 !important;
  color: #ffffff !important;
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}