.ssafun-hq {
  --hq-bg: #0f1218;
  --hq-card: #171c26;
  --hq-text: #ecf2ff;
  --hq-muted: #b7c1d8;
  --hq-accent: #ff7a1f;
  --hq-accent-2: #ff9d2e;
  --hq-border: #283244;
  --hq-ok: #37c978;
  color: var(--hq-text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.ssafun-hq * { box-sizing: border-box; }

.ssafun-hq .hq-shell {
  max-width: 980px;
  margin: 24px auto;
  border: 1px solid var(--hq-border);
  border-radius: 18px;
  padding: 18px;
  background:
    radial-gradient(900px 380px at 0% -20%, rgba(255, 122, 31, 0.18), transparent 68%),
    radial-gradient(760px 320px at 100% 115%, rgba(94, 54, 168, 0.16), transparent 65%),
    var(--hq-bg);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

.ssafun-hq .hq-hero {
  margin-bottom: 14px;
  border: 1px solid var(--hq-border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.ssafun-hq .hq-hero h2 {
  margin: 0 0 8px;
  line-height: 1.2;
  color: #fff !important;
}

.ssafun-hq .hq-hero p {
  margin: 0;
  color: var(--hq-muted) !important;
}

.ssafun-hq .hq-question {
  margin-top: 12px;
  border: 1px solid var(--hq-border);
  border-radius: 14px;
  background: var(--hq-card);
  padding: 12px;
}

.ssafun-hq .hq-question legend {
  width: 100%;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff !important;
}

.ssafun-hq .hq-options {
  display: grid;
  gap: 8px;
}

.ssafun-hq .hq-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 10px;
  color: var(--hq-text) !important;
  background: #121722;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.ssafun-hq .hq-option:hover {
  border-color: #455370;
  background: #1a2030;
  transform: translateY(-1px);
}

.ssafun-hq .hq-option input { margin-top: 3px; }

.ssafun-hq .hq-option span {
  color: var(--hq-text) !important;
  line-height: 1.5;
}

.ssafun-hq .hq-actions,
.ssafun-hq .hq-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.ssafun-hq button {
  border: 1px solid transparent;
  border-radius: 10px;
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--hq-accent-2) 0%, var(--hq-accent) 100%);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.ssafun-hq button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.ssafun-hq .hq-random,
.ssafun-hq .hq-reset,
.ssafun-hq .hq-share,
.ssafun-hq .hq-download-txt,
.ssafun-hq .hq-download-csv {
  background: #2f3b52;
  border-color: #3f4d68;
}

.ssafun-hq .hq-status {
  margin: 12px 0 0;
  color: var(--hq-muted) !important;
}

.ssafun-hq .hq-result {
  margin-top: 16px;
  border: 1px solid #2f7f4f;
  border-radius: 14px;
  padding: 14px;
  background: rgba(55, 201, 120, 0.08);
}

.ssafun-hq .hq-result h3 {
  margin: 0 0 8px;
  color: #ccffdd !important;
}

.ssafun-hq .hq-result-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff !important;
}

.ssafun-hq .hq-result-copy {
  margin: 0;
  color: var(--hq-text) !important;
}

.ssafun-hq .hq-score-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.ssafun-hq .hq-score {
  border: 1px solid #2f3b52;
  border-radius: 10px;
  background: #131a27;
  padding: 8px;
  text-align: center;
}

.ssafun-hq .hq-score strong {
  display: block;
  color: #fff !important;
}

.ssafun-hq .hq-score span {
  color: var(--hq-muted) !important;
}

.ssafun-hq .hq-party-plan {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ssafun-hq .hq-plan-card {
  border: 1px solid rgba(45, 212, 191, 0.32);
  border-radius: 12px;
  background:
    radial-gradient(circle at 8% 0%, rgba(45, 212, 191, 0.1), transparent 34%),
    rgba(8, 18, 34, 0.9);
  padding: 10px;
}

.ssafun-hq .hq-plan-card h4 {
  margin: 0 0 8px;
  color: #ffffff !important;
}

.ssafun-hq .hq-plan-card ul {
  margin: 0;
  padding-left: 18px;
}

.ssafun-hq .hq-plan-card li,
.ssafun-hq .hq-plan-card p {
  color: #f4fdff !important;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .ssafun-hq .hq-score-grid,
  .ssafun-hq .hq-party-plan { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .ssafun-hq .hq-shell { border-radius: 12px; padding: 12px; }
  .ssafun-hq .hq-party-plan { grid-template-columns: 1fr; }
  .ssafun-hq .hq-actions button,
  .ssafun-hq .hq-export-actions button { width: 100%; }
}

/* Final mobile answer-row guard for the Halloween quiz. */
.ssafun-hq,
.ssafun-hq * {
  min-width: 0;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  word-break: normal !important;
}

.ssafun-hq .hq-options {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
}

.ssafun-hq .hq-option {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 44px !important;
  height: auto !important;
  text-align: left !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: break-word !important;
}

.ssafun-hq .hq-option input[type="radio"] {
  grid-column: 1 !important;
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  position: static !important;
}

.ssafun-hq .hq-option span {
  grid-column: 2 !important;
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  line-height: 1.38 !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
}

@media (max-width: 620px) {
  .ssafun-hq .hq-score-grid,
  .ssafun-hq .hq-party-plan {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
