/* RollHunt sticky HUD + console */

.rollhunt-bar {
  display: none;
  margin: 0 0 8px;
  border: 1px solid rgba(212, 168, 75, 0.45);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(12, 36, 42, 0.96), rgba(8, 22, 28, 0.98)),
    radial-gradient(ellipse at top right, rgba(212, 168, 75, 0.18), transparent 55%);
  color: #f3e7c8;
  overflow: hidden;
}
.rollhunt-bar.is-live {
  display: block;
  animation: rollhuntIn 0.35s ease-out both;
}
.rollhunt-bar.is-pulse {
  animation: rollhuntPulse 0.55s ease;
}
@keyframes rollhuntIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes rollhuntPulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 168, 75, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(212, 168, 75, 0); }
}

.rollhunt-bar__inner {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rollhunt-bar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.rollhunt-bar__brand {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 13px;
  color: #f0d48a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rollhunt-bar__brand::before {
  content: "◆";
  font-size: 11px;
  color: #d4a84b;
}
.rollhunt-bar__meta {
  font-size: 11px;
  color: rgba(243, 231, 200, 0.72);
}
.rollhunt-bar__progress {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: #ffe7a8;
}
.rollhunt-bar__task {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff8e8;
  word-break: break-word;
}
/* Default hidden — author display:flex must never override [hidden] for guests. */
.rollhunt-bar__actions,
.rollhunt-bar__actions[hidden] {
  display: none !important;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.rollhunt-bar.is-conducting .rollhunt-bar__actions {
  display: flex !important;
}
.rollhunt-bar__btn {
  appearance: none;
  border: 1px solid rgba(212, 168, 75, 0.55);
  background: rgba(212, 168, 75, 0.12);
  color: #ffe7a8;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.rollhunt-bar__btn:hover {
  background: rgba(212, 168, 75, 0.22);
}

.msg-rollhunt-win-btn {
  border: 1px solid rgba(212, 168, 75, 0.55);
  background: rgba(212, 168, 75, 0.14);
  color: #f0d48a;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
}
.msg-rollhunt-win-btn:hover {
  background: rgba(212, 168, 75, 0.28);
}
.msg-rollhunt-win-btn.is-cd-blocked {
  border-color: rgba(248, 113, 113, 0.55) !important;
  background: rgba(248, 113, 113, 0.12) !important;
  color: #fecaca !important;
}
/* Host-only cooldown badge (injected only while conducting). */
.msg-rh-cd-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.4;
  vertical-align: middle;
  border: 1px solid transparent;
  user-select: none;
}
.msg-rh-cd-badge.is-ok {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.45);
}
.msg-rh-cd-badge.is-blocked {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.5);
}
.rollhunt-awaiting-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffe7a8;
  background: rgba(212, 168, 75, 0.12);
  border: 1px solid rgba(212, 168, 75, 0.35);
}
.msg.rollhunt-winner-flash {
  outline: 1px solid rgba(212, 168, 75, 0.75);
  background: rgba(212, 168, 75, 0.08);
}
.msg.rollhunt-winner {
  outline: 1px solid rgba(212, 168, 75, 0.85);
  background: rgba(212, 168, 75, 0.12);
  box-shadow: inset 3px 0 0 #d4a84b;
}
.msg.rollhunt-winner .rollhunt-winner-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(212, 168, 75, 0.7);
  background: rgba(212, 168, 75, 0.22);
  color: #ffe7a8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.rollhunt-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(4, 10, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rollhunt-modal-backdrop[hidden] { display: none !important; }
.rollhunt-modal {
  width: min(560px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(212, 168, 75, 0.4);
  background: #0c1a20;
  color: #f3e7c8;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.rollhunt-modal h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #f0d48a;
}
.rollhunt-modal label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin: 10px 0 4px;
  color: rgba(243, 231, 200, 0.75);
}
.rollhunt-modal input,
.rollhunt-modal textarea,
.rollhunt-modal select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid rgba(120, 150, 160, 0.45);
  background: rgba(8, 20, 26, 0.9);
  color: #f3e7c8;
  padding: 8px 10px;
  font-size: 13px;
}
.rollhunt-modal textarea {
  min-height: 52px;
  resize: vertical;
}
.rollhunt-modal__tasks {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}
.rollhunt-modal__row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
}
.rollhunt-modal__row span {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  padding-top: 10px;
  color: #d4a84b;
}
.rollhunt-modal__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  justify-content: flex-end;
}
.rollhunt-modal__actions button {
  appearance: none;
  border-radius: 8px;
  border: 1px solid rgba(212, 168, 75, 0.5);
  background: rgba(212, 168, 75, 0.16);
  color: #ffe7a8;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 12px;
  cursor: pointer;
}
.rollhunt-modal__actions button.secondary {
  background: transparent;
  color: rgba(243, 231, 200, 0.85);
}
.rollhunt-modal__error {
  color: #f87171;
  font-size: 12px;
  margin-top: 8px;
}
.rollhunt-confirm {
  width: min(420px, 100%);
}
.rollhunt-confirm p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.4;
}
.rollhunt-confirm .ok { color: #86efac; font-weight: 700; }
.rollhunt-confirm .bad { color: #f87171; font-weight: 700; }
.rollhunt-confirm__post {
  margin: 12px 0 4px;
}
.rollhunt-confirm__post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(250, 204, 21, 0.85);
}
.rollhunt-confirm__copy {
  padding: 4px 10px !important;
  font-size: 11px !important;
  min-width: 0 !important;
}
.rollhunt-confirm__post-body {
  margin: 0;
  max-height: 160px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(250, 204, 21, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: #f5f5f4;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
