.hgq-chamber {
  position: relative;
  background: linear-gradient(165deg, #181c25 0%, #101319 58%, #161211 100%);
  border: 1px solid rgba(223, 176, 86, 0.38);
  border-radius: 14px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(223, 176, 86, 0.22);
  padding: 20px 24px 22px;
  overflow: hidden;
  transition: border-color 0.35s ease;
}

.hgq-chamber::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 0%, var(--act-glow, rgba(223, 176, 86, 0.14)), transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.35s ease;
}

.hgq-chamber[data-act="1"] { --act-glow: rgba(223, 176, 86, 0.16); }
.hgq-chamber[data-act="2"] { --act-glow: rgba(196, 70, 22, 0.22); }
.hgq-chamber[data-act="3"] { --act-glow: rgba(63, 118, 82, 0.20); }
.hgq-chamber[data-act="4"] { --act-glow: rgba(130, 148, 176, 0.18); }
.hgq-chamber[data-act="5"] { --act-glow: rgba(223, 176, 86, 0.24); }

.hgq-embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.78;
  z-index: 1;
}

.hgq-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--gold);
  border-style: solid;
  pointer-events: none;
  z-index: 3;
  opacity: 0.72;
}
.hgq-corner-tl { top: 9px; left: 9px; border-width: 2px 0 0 2px; }
.hgq-corner-tr { top: 9px; right: 9px; border-width: 2px 2px 0 0; }
.hgq-corner-bl { bottom: 9px; left: 9px; border-width: 0 0 2px 2px; }
.hgq-corner-br { bottom: 9px; right: 9px; border-width: 0 2px 2px 0; }

.hgq-inner {
  position: relative;
  z-index: 2;
}

/* Friend Challenge Banner */
.hgq-challenge-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(196, 70, 22, 0.2);
  border: 1px solid rgba(223, 176, 86, 0.5);
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hgq-challenge-banner[hidden] {
  display: none;
}

.hgq-challenge-banner strong {
  color: var(--gold);
}

/* Compact Single-Row Control Header */
.hgq-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(223, 176, 86, 0.18);
}

.hgq-act-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.hgq-diamond {
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--gold);
  transform: rotate(45deg);
  display: inline-block;
  flex-shrink: 0;
  background: rgba(196, 70, 22, 0.42);
  box-shadow: 0 0 10px rgba(223, 176, 86, 0.5);
}

.hgq-hud-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.hgq-chip-btn {
  appearance: none;
  background: rgba(12, 14, 18, 0.82);
  border: 1px solid var(--border);
  color: var(--muted);
  font: 600 12px/1 var(--font-body);
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 32px;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.hgq-chip-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--text);
}

.hgq-chip-btn[aria-pressed="true"] {
  border-color: rgba(223, 176, 86, 0.65);
  color: var(--gold);
  background: rgba(223, 176, 86, 0.12);
}

.hgq-chip-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Segmented Brass Progress Nodes */
.hgq-nodes {
  display: flex;
  gap: 5px;
  margin-bottom: 18px;
}

.hgq-node {
  flex: 1;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  cursor: default;
  transition: background 0.22s ease, transform 0.2s ease, box-shadow 0.22s ease;
}

.hgq-node.is-done {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  cursor: pointer;
}

.hgq-node.is-done:hover {
  transform: scaleY(1.4);
}

.hgq-node.is-current {
  background: var(--gold);
  box-shadow: 0 0 12px rgba(223, 176, 86, 0.9);
}

/* Question Theater Stage */
.hgq-q-wrap {
  animation: hgqSceneIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes hgqSceneIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hgq-scene-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hgq-scene-icon {
  width: 24px;
  height: 24px;
  color: var(--gold);
  flex-shrink: 0;
}

.hgq-q-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.hgq-q-text {
  margin: 0 0 18px;
  font-family: var(--font-heading);
  font-size: 24px;
  line-height: 1.36;
  color: var(--text);
}

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

.hgq-option {
  appearance: none;
  position: relative;
  text-align: left;
  width: 100%;
  min-height: 74px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 16px;
  background: rgba(12, 14, 18, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font: 400 15px/1.48 var(--font-body);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.hgq-option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), var(--accent));
  opacity: 0;
  transition: opacity 0.16s ease;
}

.hgq-option:hover {
  border-color: rgba(223, 176, 86, 0.78);
  background: rgba(28, 33, 44, 0.94);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.36);
}

.hgq-option:hover::before {
  opacity: 1;
}

.hgq-option.is-selected,
.hgq-option.is-locking {
  border-color: var(--gold);
  background: rgba(196, 70, 22, 0.28);
  box-shadow: 0 0 0 1px rgba(223, 176, 86, 0.5), 0 8px 22px rgba(196, 70, 22, 0.28);
}

.hgq-option.is-selected::before,
.hgq-option.is-locking::before {
  opacity: 1;
}

.hgq-opt-key {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(223, 176, 86, 0.52);
  color: var(--gold);
  font: 700 12px/26px var(--font-heading);
  text-align: center;
  margin-top: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.hgq-option.is-selected .hgq-opt-key,
.hgq-option.is-locking .hgq-opt-key {
  background: var(--gold);
  color: #0c0e12;
  border-color: var(--gold);
}

.hgq-opt-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hgq-opt-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
}

/* Gamemaker Reaction Micro-Beat */
.hgq-reaction-bar {
  margin-top: 14px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(12, 14, 18, 0.72);
  border: 1px solid rgba(223, 176, 86, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.hgq-reaction-bar.is-active {
  border-color: var(--gold);
  background: rgba(196, 70, 22, 0.22);
  color: var(--text);
}

.hgq-reaction-quote {
  font-style: italic;
  color: var(--gold);
}

.hgq-reaction-meta {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

/* Reveal Ceremony */
.hgq-reveal[hidden],
.hgq-result[hidden],
.hgq-stage[hidden],
.hgq-duel-box[hidden] {
  display: none;
}

.hgq-reveal {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
}

.hgq-reveal-ring {
  width: 132px;
  height: 132px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.hgq-reveal-ring::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2.5px solid var(--gold);
  background: rgba(196, 70, 22, 0.24);
  border-radius: 8px;
  transform: rotate(45deg);
  box-shadow: 0 0 28px rgba(223, 176, 86, 0.48);
  animation: hgqSealPulse 0.65s ease-in-out infinite alternate;
}

@keyframes hgqSealPulse {
  from { transform: rotate(45deg) scale(0.95); }
  to { transform: rotate(45deg) scale(1.06); }
}

.hgq-reveal-code {
  position: relative;
  z-index: 2;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.hgq-reveal-title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 20px;
  letter-spacing: 0.1em;
  color: var(--text);
}

.hgq-reveal-sub {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
}

/* Result View */
.hgq-result {
  animation: hgqSceneIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.hgq-duel-box {
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(196, 70, 22, 0.2);
  border: 1px solid var(--gold);
  font-size: 14px;
  color: var(--text);
}

.hgq-duel-box strong {
  color: var(--gold);
}

.hgq-res-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at var(--mx, 25%) var(--my, 35%), rgba(223, 176, 86, 0.18), transparent 56%),
    rgba(10, 12, 16, 0.9);
  border: 1px solid rgba(223, 176, 86, 0.52);
  border-radius: 12px;
  margin-bottom: 18px;
}

.hgq-crest {
  width: 112px;
  height: 112px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hgq-crest::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid var(--gold);
  background: linear-gradient(145deg, rgba(196, 70, 22, 0.34), rgba(223, 176, 86, 0.1));
  transform: rotate(45deg);
  border-radius: 8px;
  box-shadow: 0 0 24px rgba(196, 70, 22, 0.3);
}

.hgq-crest-code {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
}

.hgq-crest-sub {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
}

.hgq-res-kicker {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.hgq-res-title {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 36px;
  line-height: 1.15;
  color: var(--text);
}

.hgq-res-epithet {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gold);
}

.hgq-res-summary {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  max-width: 65ch;
}

.hgq-res-personal {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(223, 176, 86, 0.08);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: var(--text);
  max-width: 64ch;
}

.hgq-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.hgq-stat-box {
  background: rgba(12, 14, 18, 0.82);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px;
}

.hgq-stat-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.hgq-stat-val {
  display: block;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 700;
  color: var(--gold);
}

.hgq-stat-sub {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.hgq-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hgq-panel {
  background: rgba(12, 14, 18, 0.82);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}

.hgq-panel-title {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--text);
}

.hgq-radar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hgq-radar-wrap svg {
  width: 100%;
  max-width: 280px;
  height: auto;
}

.hgq-bars {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.hgq-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hgq-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.hgq-bar-pct {
  color: var(--gold);
}

.hgq-bar-track {
  height: 8px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}

.hgq-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.hgq-details-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.hgq-detail-card {
  background: rgba(12, 14, 18, 0.82);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px;
}

.hgq-detail-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.hgq-export-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(12, 14, 18, 0.88);
  border: 1px solid rgba(223, 176, 86, 0.28);
  border-radius: 10px;
}

.hgq-skin-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hgq-skin-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
}

.hgq-skin-btn {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font: 600 12px/1 var(--font-body);
  padding: 8px 11px;
  border-radius: 8px;
  cursor: pointer;
}

.hgq-skin-btn[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(223, 176, 86, 0.14);
}

.hgq-res-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hgq-btn-primary {
  appearance: none;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid rgba(223, 176, 86, 0.35);
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  font: 600 14px/1.2 var(--font-body);
  cursor: pointer;
  transition: background 0.16s ease, transform 0.14s ease;
}

.hgq-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.hgq-btn-secondary {
  appearance: none;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 10px;
  font: 600 14px/1.2 var(--font-body);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hgq-btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.hgq-action-msg {
  font-size: 13px;
  color: var(--gold);
  min-height: 20px;
}

@media (max-width: 640px) {
  .hgq-chamber {
    padding: 14px 14px 16px;
  }
  .hgq-options,
  .hgq-stat-strip,
  .hgq-analytics-grid,
  .hgq-details-pair {
    grid-template-columns: 1fr;
  }
  .hgq-option {
    min-height: 62px;
    padding: 13px 14px;
    font-size: 14px;
  }
  .hgq-q-text {
    font-size: 19px;
    margin-bottom: 14px;
  }
  .hgq-res-hero {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    padding: 18px 14px;
  }
  .hgq-res-personal {
    text-align: left;
  }
  .hgq-res-title {
    font-size: 28px;
  }
  .hgq-export-bar,
  .hgq-res-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hgq-btn-primary,
  .hgq-btn-secondary {
    width: 100%;
  }
}
