.questing-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1200;
}

.questing-hud {
  position: absolute;
  top: 18px;
  left: 18px;
  max-width: min(420px, calc(100vw - 36px));
}

.questing-hud-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 2px solid rgba(41, 34, 30, 0.92);
  background: rgba(249, 239, 215, 0.92);
  box-shadow: 0 10px 24px rgba(31, 24, 20, 0.18);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.questing-hud-card.is-loading {
  opacity: 0.7;
}

.questing-hud-name {
  font-family: var(--font-ui);
  font-size: 18px;
  color: #382d27;
}

.questing-hud-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 13px;
  color: #55443c;
}

.questing-hud-stats strong {
  color: #1f1713;
}

.questing-toggle {
  position: absolute;
  top: 18px;
  right: 18px;
  pointer-events: auto;
}

.questing-toggle.is-live {
  background: #a84f3f;
  color: #fff;
}

.questing-panel {
  position: absolute;
  right: 18px;
  top: 68px;
  width: min(1120px, calc(100vw - 36px));
  max-height: calc(100vh - 92px);
  display: none;
  flex-direction: column;
  border: 2px solid #2f241f;
  background: rgba(32, 26, 23, 0.96);
  color: #f5ecde;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.questing-shell.is-open .questing-panel {
  display: flex;
}

.questing-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #8e4f3d 0%, #6a8a6a 100%);
}

.questing-panel-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.88;
}

.questing-panel-title {
  margin: 2px 0 0;
  font-family: var(--font-ui);
  font-size: 22px;
  line-height: 1;
}

.questing-panel-body {
  overflow: auto;
  padding: 14px;
}

.questing-panel-grid {
  display: grid;
  grid-template-columns: 260px minmax(280px, 320px) minmax(320px, 1fr);
  gap: 14px;
}

.questing-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.questing-section {
  display: grid;
  gap: 10px;
}

.questing-section-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d7c3b1;
}

.questing-player-card,
.questing-detail-card,
.questing-list-item,
.questing-empty,
.questing-note,
.questing-error {
  border: 1px solid rgba(255, 241, 222, 0.14);
  background: rgba(255, 247, 234, 0.06);
}

.questing-player-card,
.questing-detail-card,
.questing-empty,
.questing-note,
.questing-error {
  padding: 12px;
}

.questing-player-name,
.questing-detail-title {
  font-family: var(--font-ui);
}

.questing-player-name {
  font-size: 18px;
}

.questing-player-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #d7c3b1;
}

.questing-player-grid,
.questing-detail-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
}

.questing-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  color: inherit;
  text-align: left;
}

.questing-list-item + .questing-list-item {
  margin-top: 8px;
}

.questing-list-item.is-selected {
  border-color: rgba(255, 220, 163, 0.52);
  background: rgba(255, 210, 129, 0.12);
}

.questing-list-title {
  font-size: 14px;
  font-weight: 700;
}

.questing-list-meta,
.questing-detail-eyebrow,
.questing-status,
.questing-step-copy {
  font-size: 12px;
  color: #d7c3b1;
}

.questing-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.questing-detail-copy {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.questing-steps {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.questing-step {
  padding: 10px;
  border: 1px solid rgba(255, 241, 222, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.questing-step-title {
  font-size: 13px;
  font-weight: 700;
}

.questing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.questing-submit-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.questing-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.questing-field legend {
  padding: 0;
  font-size: 13px;
  font-weight: 700;
}

.questing-field fieldset,
fieldset.questing-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.questing-field input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #7d6558;
  background: #fff8ec;
  color: #261c17;
}

.questing-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #f7e8d3;
}

.questing-check input {
  margin-top: 2px;
}

.questing-empty {
  color: #d7c3b1;
}

.questing-note {
  margin-top: 10px;
  color: #f8ddb5;
}

.questing-inline-actions {
  margin-top: 10px;
}

.questing-inline-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.questing-inline-actions-row .win-btn-ghost {
  background: rgba(255, 247, 234, 0.1);
  color: #f7e8d3;
}

.questing-error {
  margin-bottom: 10px;
  color: #ffd4cd;
  border-color: rgba(255, 124, 95, 0.26);
  background: rgba(183, 63, 39, 0.18);
}

.questing-note-warning {
  color: #ffe4a8;
  border-color: rgba(255, 193, 92, 0.34);
  background: rgba(158, 100, 20, 0.22);
}

.questing-recovery-box {
  display: grid;
  gap: 6px;
}

.questing-recovery-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d7c3b1;
}

.questing-recovery-code {
  font-family: var(--font-ui);
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: #fff6df;
}

.questing-map-popup {
  position: absolute;
  z-index: calc(var(--z-map-ui) + 2);
  transform: translate(calc(-50% + 14px), calc(-100% - 18px));
  pointer-events: none;
}

.questing-map-popup > * {
  pointer-events: auto;
}

.questing-popup-shell {
  --quest-popup-width: min(380px, calc(100vw - 40px));
  position: relative;
  width: var(--quest-popup-width);
  margin-top: 64px;
  overflow: visible;
}

.questing-popup-window {
  width: var(--quest-popup-width);
  max-width: var(--quest-popup-width);
  min-width: var(--quest-popup-width);
  position: relative;
  z-index: 1;
}

.questing-popup-gnome {
  position: absolute;
  top: -144px;
  left: 50%;
  width: 132px;
  height: auto;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.questing-popup-hand {
  position: absolute;
  top: calc(50% + 24px);
  width: auto;
  height: 42px;
  transform: translateY(-50%);
  z-index: 3;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.questing-popup-hand-left {
  left: -16px;
}

.questing-popup-hand-right {
  right: -16px;
}

.questing-popup-actions,
.questing-place-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 14px 14px;
}

.questing-popup-status {
  font-size: 12px;
  color: #7e3f33;
}

.questing-place-wrap {
  display: grid;
  gap: 10px;
}

.questing-place-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9cfbf;
  background: #f8f1e4;
}

.questing-place-title {
  font-weight: 700;
  color: #2c241d;
}

.questing-place-copy {
  font-size: 13px;
  color: #5f4b3f;
}

@media (max-width: 1100px) {
  .questing-panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .questing-hud {
    top: 12px;
    left: 12px;
    max-width: calc(100vw - 24px);
  }

  .questing-toggle {
    top: 12px;
    right: 12px;
    bottom: auto;
  }

  .questing-panel {
    right: 0;
    left: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: min(82vh, 720px);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
}
