:root {
  --pc-primary: #7c3aed;
  --pc-primary-soft: rgba(124, 58, 237, 0.12);
  --pc-secondary: #f59e0b;
  --pc-success: #16a34a;
  --pc-danger: #dc2626;
  --pc-text: #1f2937;
  --pc-text-soft: #6b7280;
  --pc-surface: #ffffff;
  --pc-surface-soft: #faf5ff;
  --pc-border: rgba(124, 58, 237, 0.14);
  --pc-shadow: 0 18px 45px rgba(76, 29, 149, 0.12);
}

body {
  color: var(--pc-text);
}

.bg-decoration {
  display: none;
}

.container {
  position: relative;
  background: linear-gradient(180deg, #fcfbff 0%, #f8fafc 100%);
}

.header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(245, 158, 11, 0.08));
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.logo {
  margin: 0;
  display: flex;
  align-items: center;
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  font-weight: 700;
  color: #4c1d95;
}

.logo-img {
  flex: 0 0 auto;
}

.nav-menu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-btn,
.start-btn,
.new-challenge-btn,
.answer-btn,
.continue-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.84);
  color: #5b21b6;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.1);
}

.nav-btn:hover,
.start-btn:hover,
.new-challenge-btn:hover,
.answer-btn:hover,
.continue-btn:hover,
.option-btn:hover {
  transform: translateY(-1px);
}

.main-game {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.intro-section,
.user-panel,
.question-card,
.options-area,
.answer-area,
.result-area {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 24px;
  box-shadow: var(--pc-shadow);
}

.intro-card,
.user-info,
.answer-content,
.result-content {
  padding: 24px;
}

.intro-card h2,
.answer-content h3 {
  margin: 0 0 12px;
  font-size: 1.3rem;
  color: #4c1d95;
}

.intro-card p,
.answer-content p,
.result-text,
.user-info label {
  margin: 0;
  line-height: 1.8;
  color: var(--pc-text-soft);
}

.intro-card p + p {
  margin-top: 10px;
}

.input-group {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.input-group input {
  flex: 1 1 240px;
  min-width: 0;
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--pc-text);
  background: #fff;
}

.input-group input:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.start-btn,
.continue-btn {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  box-shadow: 0 14px 28px rgba(91, 33, 182, 0.28);
}

.new-challenge-btn,
.answer-btn {
  background: #fff;
  color: #5b21b6;
  border: 1px solid rgba(124, 58, 237, 0.16);
}

.game-interface {
  display: grid;
  gap: 18px;
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(245, 158, 11, 0.08));
  border: 1px solid var(--pc-border);
  border-radius: 20px;
  padding: 16px 18px;
}

.user-id,
.score {
  font-weight: 600;
  color: #4c1d95;
}

.question-card {
  overflow: hidden;
}

.question-header {
  padding: 18px 24px 0;
}

.question-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #4c1d95;
}

.question-content {
  padding: 24px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.question-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--pc-primary-soft);
  color: #6d28d9;
  font-size: 0.86rem;
  font-weight: 700;
}

.question-prompt {
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  line-height: 1.7;
  font-weight: 700;
  color: var(--pc-text);
}

.question-meta {
  color: var(--pc-text-soft);
  font-size: 0.96rem;
}

.loading-text {
  color: var(--pc-text-soft);
  text-align: center;
}

.options-area {
  padding: 20px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-btn {
  width: 100%;
  min-height: 76px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(124, 58, 237, 0.14);
  background: #fff;
  color: var(--pc-text);
  font-size: 1rem;
  line-height: 1.7;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.option-btn:hover {
  border-color: rgba(124, 58, 237, 0.34);
  box-shadow: 0 12px 26px rgba(124, 58, 237, 0.12);
}

.option-btn:disabled {
  cursor: default;
  opacity: 1;
}

.option-btn.correct {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.36);
  color: #166534;
}

.option-btn.wrong {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.26);
  color: #b91c1c;
}

.answer-area,
.result-area {
  display: none;
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-icon {
  font-size: 2rem;
}

.result-text {
  font-size: 1rem;
}

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.modal.show {
  display: flex;
}

.modal-content {
  width: min(760px, 100%);
  max-height: min(78vh, 760px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.28);
  position: relative;
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
}

.modal-body h3 {
  margin: 0 0 14px;
  color: #4c1d95;
}

.modal-body p,
.modal-body li {
  color: var(--pc-text-soft);
  line-height: 1.8;
}

.modal-body ul {
  margin: 0;
  padding-left: 20px;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: 18px;
  padding: 14px 16px;
  background: #fcfbff;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--pc-text-soft);
}

.history-title {
  font-weight: 700;
  color: var(--pc-text);
}

.history-status.correct {
  color: var(--pc-success);
}

.history-status.wrong {
  color: var(--pc-danger);
}

.notification {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #111827;
  color: #fff;
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.28);
}

.notification-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 45;
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 24px 28px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(124, 58, 237, 0.16);
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(124, 58, 237, 0.16);
  border-top-color: var(--pc-primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .status-bar {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .header,
  .main-game,
  .intro-card,
  .user-info,
  .question-content,
  .answer-content,
  .result-content,
  .options-area {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .logo {
    font-size: 1.28rem;
  }

  .logo-img {
    width: 32px !important;
    height: 32px !important;
    margin-right: 8px !important;
  }

  .nav-menu,
  .input-group,
  .result-actions {
    width: 100%;
  }

  .nav-btn,
  .start-btn,
  .new-challenge-btn,
  .answer-btn,
  .continue-btn {
    width: 100%;
    justify-content: center;
  }

  .notification {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}
