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

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

header {
  text-align: center;
  padding: 40px 20px 20px;
  color: white;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header .subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

.game-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 12px 30px;
  font-size: 1.1rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  background: rgba(255,255,255,0.2);
  color: white;
  transition: all 0.3s ease;
  font-weight: 600;
}

.tab-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: white;
  color: #667eea;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.game-section {
  display: none;
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.game-section.active {
  display: block;
}

.input-area {
  margin-bottom: 30px;
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  transition: border-color 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #667eea;
}

.primary-btn {
  display: block;
  width: 100%;
  padding: 15px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transition: all 0.3s ease;
  margin-top: 15px;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.primary-btn:active {
  transform: translateY(0);
}

/* 사다리타기 스타일 */
#ladder-container {
  position: relative;
  margin: 20px 0;
  overflow-x: auto;
}

#ladder-canvas {
  display: block;
  margin: 0 auto;
}

#ladder-players-display,
#ladder-results-display {
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
}

#ladder-players-display span,
#ladder-results-display span {
  padding: 8px 16px;
  background: #f0f0f0;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#ladder-players-display span:hover {
  background: #667eea;
  color: white;
}

#ladder-players-display span.selected {
  background: #667eea;
  color: white;
}

#ladder-results-display span {
  background: #ffe0b2;
  cursor: default;
}

#ladder-results-display span.highlight {
  background: #ff9800;
  color: white;
  transform: scale(1.1);
}

#ladder-result-message,
#roulette-result-message {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
  margin-top: 20px;
  min-height: 40px;
}

/* 룰렛 스타일 */
#roulette-container {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.roulette-wrapper {
  position: relative;
  display: inline-block;
}

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

#roulette-canvas {
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(0,0,0,0.3);
}

footer {
  text-align: center;
  padding: 30px;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  header h1 {
    font-size: 1.8rem;
  }

  .tab-btn {
    padding: 10px 20px;
    font-size: 1rem;
  }

  .game-section {
    padding: 20px;
  }
}
