:root {
  --kasa-blue: #0d6efd;
  --kasa-blue-dark: #084298;
  --kasa-blue-light: #dbeafe;
  --kasa-navy: #072b61;
  --bg-start: #eef6ff;
  --bg-end: #d7e9ff;
  --text-main: #122033;
  --text-sub: #5d6b82;
  --white: #ffffff;
  --border: rgba(13, 110, 253, 0.14);
  --shadow: 0 20px 50px rgba(7, 43, 97, 0.16);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
}

body {
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.draw-card {
  width: 100%;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 34px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--kasa-blue-light);
  color: var(--kasa-blue-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  color: var(--kasa-navy);
}

.hero-subtitle {
  margin: 10px 0 0;
  font-size: clamp(18px, 2.6vw, 24px);
  font-weight: 700;
  color: var(--kasa-blue);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.stat-box strong {
  font-size: clamp(24px, 3vw, 34px);
  color: var(--kasa-navy);
}

.draw-stage {
  margin-bottom: 24px;
  text-align: center;
}

.stage-label {
  margin: 0 0 12px;
  color: var(--text-sub);
  font-size: 15px;
  font-weight: 700;
}

.draw-display {
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  color: var(--white);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  text-align: center;
  white-space: pre-line;
  word-break: break-all;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.draw-display.loading,
.draw-display.info {
  background: linear-gradient(135deg, #7aa8f5 0%, #4c88eb 100%);
}

.draw-display.rolling {
  animation: pulseGlow 0.7s ease-in-out infinite;
}

.draw-display.winner {
  background: linear-gradient(135deg, #003f9e 0%, #0d6efd 45%, #49a3ff 100%);
}

.button-area {
  display: none;
  justify-content: center;
  margin-bottom: 28px;
}

.draw-button {
  width: min(100%, 360px);
  min-height: 74px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0d6efd 0%, #084298 100%);
  color: var(--white);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 900;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(13, 110, 253, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.draw-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(13, 110, 253, 0.36);
}

.draw-button:active:not(:disabled) {
  transform: translateY(0);
}

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

.winner-board {
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.board-header h2 {
  margin: 0;
  color: var(--kasa-navy);
  font-size: clamp(22px, 2.4vw, 28px);
}

.board-empty {
  color: var(--text-sub);
  font-size: 15px;
  font-weight: 700;
}

.winner-list {
  margin: 0;
  padding-left: 28px;
}

.winner-list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(13, 110, 253, 0.1);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  word-break: break-all;
}

.winner-list li:last-child {
  border-bottom: none;
}

@keyframes pulseGlow {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.14);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.02);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@media (max-width: 768px) {
  .app {
    padding: 16px;
  }

  .draw-card {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .draw-display {
    min-height: 128px;
    font-size: 24px;
    padding: 18px;
  }

  .draw-button {
    min-height: 66px;
    font-size: 24px;
  }

  .board-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
