/* 기본 스타일 */
body {
  font-family: 'Noto Sans KR', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #FFF6E9;
  color: #333;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 350px;
  height: 350px;
  background-color: rgba(199, 176, 227, 0.3);
  border-radius: 50%;
  z-index: 0;
  animation: float 8s ease-in-out infinite;
}

body::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 280px;
  height: 280px;
  background-color: rgba(247, 205, 100, 0.2);
  border-radius: 50%;
  z-index: 0;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0);
  }
}
.title-icon {
  margin-right: 1rem;
} 

.quiz-list-title {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  position: relative;
  /* border-bottom: 1px solid #e0e0e0; */
  min-height: 64px;
}

h1 {
  color: var(--dark-color);
  font-weight: 600;
  line-height: 1.3;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  height: 48px;
}

.header-buttons {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.back-btn, .join-btn {
  height: 48px;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: #f3f0ff;
  color: #6c5ce7;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.6em 1.4em 0.6em 1.1em;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.08);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.13s;
  outline: none;
}

.back-btn svg, .join-btn svg {
  margin-right: 0.5em;
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
  fill: currentColor;
  display: inline-block;
  transition: transform 0.18s;
}

.back-btn:hover, .back-btn:focus,
.join-btn:hover, .join-btn:focus {
  background: #e5dbff;
  color: #5649c0;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.18);
  transform: translateY(-2px) scale(1.04);
}


.user-controls {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.user-info {
  font-weight: 600;
}

/* 메시지 컨테이너 스타일 */
#message-container {
  display: none;
  margin: 10px 0;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  font-weight: bold;
}

#message-container.error {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

#message-container.success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

#message-container.info {
  background-color: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

#message-container.warning {
  background-color: #fff8e1;
  color: #f57f17;
  border: 1px solid #ffe082;
}

/* 퀴즈 카드 스타일 */
.quiz-card {
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
  background-color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.quiz-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.quiz-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1A2D4A;
  margin-bottom: 0;
  padding-right: 80px;
}

.quiz-card-header {
  padding: 1.5rem 1.5rem 1.2rem 1.5rem;
  border-bottom: 1px solid #f2f2f2;
  position: relative;
  background: transparent;
}

.quiz-card-body {
  padding: 1.5rem;
  flex-grow: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.quiz-card-body p {
  color: #7b7b93;
  font-size: 1.0rem;
  margin: 0 0 0.5rem 0;
  padding: 0.5rem 0 0.5rem 0;
  font-weight: 400;
  letter-spacing: -0.01em;
  flex-grow: 1;
}

.quiz-card-footer {
  padding: 1.2rem 1.5rem 1.2rem 1.5rem;
  border-top: 1px solid #f2f2f2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
}

.quiz-card-footer p {
  margin: 0;
  color: #222;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* 퀴즈 목록 스타일 */
.quizzes-container {
  padding: 10px;
}

.quizzes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
  position: relative;
  z-index: 2;
}

.quiz-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

.quiz-genre {
  font-size: 14px;
  color: #6c5ce7;
  margin-bottom: 10px;
}

.quiz-description {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* 반응형 */
@media (max-width: 768px) {
  .quizzes-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    margin: 10% auto;
    width: 95%;
  }
}


@keyframes correctPulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

@keyframes incorrectShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}


.quiz-type-badge.golden-bell { 
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background-color: #ffd700;
  color: #333;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.quiz-type-badge.first-answer {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background-color: #ff4757;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.quiz-type-description {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #555;
  font-style: italic;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: #6c5ce7;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.7em 1.8em;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.18);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  outline: none;
}

.play-btn svg {
  margin-left: 0.5em;
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
  fill: currentColor;
  display: inline-block;
}

.play-btn:hover, .play-btn:focus {
  background: #5649c0;
  box-shadow: 0 6px 24px rgba(108, 92, 231, 0.25);
  transform: translateY(-2px) scale(1.03);
} 

/* 퀴즈버블 스타일의 모달 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background-color: white;
  margin: 10% auto;
  padding: 30px;
  width: 90%;
  max-width: 450px;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(75, 77, 204, 0.15);
  border: 1px solid rgba(75, 77, 204, 0.1);
  animation: modalFadeIn 0.3s ease;
  overflow: hidden;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 120px;
  height: 120px;
  background-color: rgba(255, 144, 57, 0.08);
  border-radius: 50%;
  z-index: 0;
}

.modal-content::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 80px;
  height: 80px;
  background-color: rgba(75, 77, 204, 0.08);
  border-radius: 50%;
  z-index: 0;
}

.modal-content h3 {
  margin-top: 0;
  color: #4b4dcc;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.modal-content p {
  color: #666;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: 700;
  color: #ccc;
  cursor: pointer;
  z-index: 2;
  transition: all 0.2s ease;
}

.close-modal:hover {
  color: #4b4dcc;
}

#nickname-input {
  display: block;
  width: 100%;
  padding: 15px;
  margin: 15px 0;
  border: 2px solid #e0e6fa;
  border-radius: 15px;
  font-size: 16px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

#nickname-input:focus {
  border-color: #4b4dcc;
  outline: none;
  box-shadow: 0 0 0 3px rgba(75, 77, 204, 0.1);
}

.question-count-container {
  background-color: #f8f0ff;
  border-radius: 16px;
  padding: 15px !important;
  margin-top: 20px !important;
  margin-bottom: 20px !important;
  position: relative;
  z-index: 1;
  border: 1px solid #e9d8fd;
}

.question-count-container p {
  color: #4b4dcc !important;
  font-weight: 600 !important;
  margin-bottom: 15px !important;
  text-align: center;
}

.question-count-options {
  display: flex !important;
  justify-content: space-around !important;
  gap: 10px;
}

.question-count-option {
  display: flex !important;
  align-items: center !important;
  background-color: white;
  padding: 10px 10px !important;
  border-radius: 30px !important;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  margin: 0 5px !important;
}

.question-count-option:hover {
  border-color: #4b4dcc;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(75, 77, 204, 0.1);
}

.question-count-option input[type="radio"] {
  margin-right: 8px !important;
  accent-color: #4b4dcc;
}

.question-count-option span {
  color: #333;
  font-weight: 500;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
  position: relative;
  z-index: 1;
}

.modal-buttons button {
  padding: 12px 25px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  min-width: 100px;
}

.modal-buttons .primary-btn {
  background-color: #4b4dcc;
  color: white;
}

.modal-buttons .primary-btn:hover {
  background-color: #3e3fb8;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(75, 77, 204, 0.3);
}

.modal-buttons .secondary-btn {
  background-color: #f3f0ff;
  color: #4b4dcc;
}

.modal-buttons .secondary-btn:hover {
  background-color: #e5dbff;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.15);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 스트리머 모드 토글 스위치 스타일 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: #4b4dcc;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider:hover {
  box-shadow: 0 0 0 2px rgba(75, 77, 204, 0.2);
}

.streamer-mode-container {
  transition: all 0.3s ease;
}

.streamer-mode-container:hover {
  background: #f0f4ff !important;
  border-color: #4b4dcc !important;
}

