* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", Arial, sans-serif;
  background:
    radial-gradient(circle at top, #273554 0%, #111827 45%, #090d16 100%);
  color: #ffffff;
}

.app {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.roulette-card {
  width: 100%;
  max-width: 580px;
  padding: 32px 24px;
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.game-logo {
  width: 140px;
  max-width: 60%;
  height: auto;
  display: block;
  margin: 0 auto 18px;
  object-fit: contain;
}

.title {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
}

.description {
  margin: 10px 0 20px;
  color: #cbd5e1;
  font-size: 15px;
}

.info-box {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbe7ff;
  font-size: 15px;
}

.result-area {
  background: #0f172a;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px;
  margin: 20px 0;
}

.character-image {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  display: block;
  margin: 0 auto 16px;
  background: #1e293b;
}

.character-name {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  word-break: keep-all;
}

.button-group {
  display: flex;
  gap: 12px;
}

.main-button,
.sub-button {
  flex: 1;
  border: none;
  border-radius: 16px;
  padding: 16px;
  font-size: 17px;
  font-weight: 800;
  color: white;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.main-button {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.sub-button {
  background: linear-gradient(135deg, #0f766e, #0ea5a4);
}

.main-button:hover,
.sub-button:hover,
.small-button:hover,
.close-button:hover {
  transform: translateY(-1px);
}

.main-button:active,
.sub-button:active,
.small-button:active,
.close-button:active {
  transform: translateY(1px);
}

.main-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.final-result {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.final-result-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: #cbd5e1;
}

#resultText {
  font-size: 24px;
  color: #fde68a;
}

/* 모달 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 999;
}

.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow: hidden;
  background: #111827;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
}

.close-button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 20px;
}

.search-input {
  width: 100%;
  border: none;
  outline: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  margin-bottom: 14px;
  background: #1f2937;
  color: white;
}

.search-input::placeholder {
  color: #94a3b8;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.small-button {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: white;
  background: #334155;
}

.danger-button {
  background: #b91c1c;
}

.character-list {
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.character-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1f2937;
  border-radius: 14px;
  padding: 10px 12px;
}

.character-item.hidden-item {
  display: none;
}

.character-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  background: #0f172a;
  flex-shrink: 0;
}

.character-item label {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.character-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.character-item-name {
  font-size: 15px;
  font-weight: 700;
  color: #e5edf9;
  word-break: keep-all;
}

.empty-message {
  padding: 18px;
  border-radius: 14px;
  background: #1f2937;
  color: #cbd5e1;
  text-align: center;
}

@media (max-width: 560px) {
  .roulette-card {
    padding: 24px 16px;
    border-radius: 20px;
  }

  .title {
    font-size: 26px;
  }

  .game-logo {
    width: 110px;
  }

  .button-group {
    flex-direction: column;
  }

  .character-name {
    font-size: 22px;
  }

  #resultText {
    font-size: 20px;
  }

  .modal-content {
    padding: 14px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .character-thumb {
    width: 48px;
    height: 48px;
  }
}