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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  background: linear-gradient(135deg, #1a0033 0%, #4a0080 50%, #c2185b 100%);
  color: #fff;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app { width: 100%; max-width: 680px; }

.card {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card.center { text-align: center; }

h1 { font-size: 28px; margin-bottom: 6px; }
h2 { font-size: 22px; margin-bottom: 8px; }
.sub { color: #ffb3d9; font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.hint { display: block; color: #ffb3d9; font-size: 12px; margin-bottom: 6px; }

.field { display: block; margin-bottom: 18px; }
.field > span {
  display: block;
  font-size: 13px;
  color: #ffb3d9;
  margin-bottom: 8px;
  font-weight: 600;
}

input[type="text"], textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: #ff66b3;
  background: rgba(255, 255, 255, 0.12);
}
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, 0.4); }

.filter-section {
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.filter-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
  gap: 12px;
}
.filter-section summary::-webkit-details-marker { display: none; }
.filter-section summary::after {
  content: "▼";
  font-size: 11px;
  color: #ffb3d9;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.filter-section[open] summary::after { transform: rotate(180deg); }
.filter-section[open] { padding-bottom: 16px; }

.filter-section .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-section .optional-tag {
  font-size: 11px;
  font-weight: 500;
  color: #ffb3d9;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-section .count {
  background: rgba(255, 102, 179, 0.25);
  color: #ffb3d9;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
  font-weight: 600;
}
.filter-section .count.at-max {
  background: rgba(255, 102, 179, 0.5);
  color: #fff;
}

.chip[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.chip[disabled]:hover { background: rgba(255, 255, 255, 0.08); }

.chip-search {
  margin-top: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  padding: 8px 12px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}
.chip-grid::-webkit-scrollbar { width: 6px; }
.chip-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 102, 179, 0.4);
  border-radius: 3px;
}

.chip {
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.1s;
}
.chip:hover { background: rgba(255, 255, 255, 0.15); }
.chip.selected {
  background: #ff66b3;
  border-color: #ff66b3;
  color: #fff;
  font-weight: 600;
}
.chip.hidden { display: none; }

.toggle-custom {
  margin-top: 12px;
  font-size: 13px;
  padding: 8px;
}

.custom-artists {
  margin-top: 12px;
}
.custom-artists.hidden { display: none; }

.btn-primary, .btn-secondary {
  font-family: inherit;
  font-weight: 600;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  cursor: pointer;
  border: none;
  width: 100%;
  transition: all 0.15s;
}
.btn-primary {
  background: #ff66b3;
  color: #fff;
  margin-top: 8px;
}
.btn-primary:hover { background: #ff3399; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}
.btn-secondary:hover { border-color: #ff66b3; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-top: 18px;
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
}
.checkbox-row input { margin-top: 3px; }

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.mode-toggle .mode-label { color: #ffb3d9; font-weight: 600; }
.mode-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.error {
  color: #ff8888;
  font-size: 13px;
  margin-top: 12px;
  min-height: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ff66b3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
}
.recipient-tag {
  background: rgba(255, 102, 179, 0.25);
  padding: 6px 12px;
  border-radius: 20px;
  color: #ffb3d9;
  font-weight: 600;
}
.score-tag { color: #ffb3d9; }

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}
#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff66b3, #ff0080);
  width: 0%;
  transition: width 0.3s;
}

.meta { color: #ffb3d9; font-size: 12px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.question-text { font-size: 19px; line-height: 1.4; margin-bottom: 22px; }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choices button {
  text-align: left;
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}
.choices button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ff66b3;
}
.choices button.correct {
  background: rgba(0, 200, 100, 0.3);
  border-color: #00c864;
}
.choices button.wrong {
  background: rgba(220, 50, 50, 0.3);
  border-color: #dc3232;
}

.open-input { margin-bottom: 8px; }

.feedback {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}
.feedback.correct { background: rgba(0, 200, 100, 0.2); border-left: 4px solid #00c864; }
.feedback.wrong { background: rgba(220, 50, 50, 0.2); border-left: 4px solid #dc3232; }
.feedback strong { display: block; margin-bottom: 4px; }
.feedback .source { color: #ffb3d9; font-size: 12px; margin-top: 6px; }

.next-btn {
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  background: #ff66b3;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.next-btn:hover { background: #ff3399; }

.big-score {
  font-size: 64px;
  font-weight: 700;
  color: #ff66b3;
  margin: 20px 0;
}

.result-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
