/* =========================================================================
   HOE MODAL — Themed alert / confirm / prompt system
   Replaces native alert()/confirm() so dialogs match DnD aesthetic.
   ========================================================================= */

.hoe-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 7, 4, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.hoe-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.hoe-modal {
  width: 100%;
  max-width: 460px;
  background:
    radial-gradient(circle at top, rgba(201, 162, 39, 0.06), transparent 55%),
    var(--bg-deep, #120b05);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-left: 3px solid var(--gold, #c9a227);
  border-radius: 10px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(.2, .9, .3, 1.1), opacity 0.22s ease;
  font-family: 'Crimson Text', serif;
  position: relative;
}

.hoe-modal-overlay.open .hoe-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.hoe-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.08), transparent 70%);
  opacity: 0.6;
}

.hoe-modal--confirm { border-left-color: #e0b64a; }
.hoe-modal--warn    { border-left-color: #e07a3c; }
.hoe-modal--error   { border-left-color: #c0392b; }
.hoe-modal--info    { border-left-color: #3498db; }
.hoe-modal--success { border-left-color: #4caf50; }

.hoe-modal__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem 0.6rem 1.1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  position: relative;
  z-index: 1;
}

.hoe-modal__icon {
  font-size: 1.25rem;
  filter: drop-shadow(0 0 6px rgba(201, 162, 39, 0.35));
  flex-shrink: 0;
  line-height: 1;
}

.hoe-modal__title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold, #c9a227);
  letter-spacing: 0.04em;
  margin: 0;
  flex: 1;
  line-height: 1.2;
}

.hoe-modal__close {
  background: transparent;
  border: none;
  color: var(--text-muted, #8a7e6b);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.hoe-modal__close:hover {
  color: var(--gold, #c9a227);
  background: rgba(201, 162, 39, 0.1);
}

.hoe-modal__body {
  padding: 1rem 1.1rem 0.4rem 1.1rem;
  color: var(--text, #e8dfc8);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-line;
  position: relative;
  z-index: 1;
}

.hoe-modal__body p { margin: 0 0 0.55rem 0; }
.hoe-modal__body p:last-child { margin-bottom: 0; }

.hoe-modal__input {
  display: block;
  width: 100%;
  margin-top: 0.7rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 6px;
  color: var(--text, #e8dfc8);
  font-family: 'Crimson Text', serif;
  font-size: 0.95rem;
  padding: 0.45rem 0.65rem;
}

.hoe-modal__input:focus {
  outline: none;
  border-color: var(--gold, #c9a227);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.18);
}

.hoe-modal__footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.8rem 1.1rem 1rem 1.1rem;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.25));
  position: relative;
  z-index: 1;
}

.hoe-modal__btn {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(20, 14, 6, 0.6);
  color: var(--text, #e8dfc8);
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.05s;
}

.hoe-modal__btn:hover {
  background: rgba(201, 162, 39, 0.14);
  color: var(--gold, #c9a227);
  border-color: var(--gold, #c9a227);
}

.hoe-modal__btn:active {
  transform: translateY(1px);
}

.hoe-modal__btn--primary {
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.32), rgba(160, 125, 25, 0.22));
  border-color: rgba(212, 175, 55, 0.6);
  color: #fff4d0;
}

.hoe-modal__btn--primary:hover {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.45), rgba(180, 140, 28, 0.32));
  color: #fff;
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.28);
}

.hoe-modal__btn--danger {
  border-color: rgba(192, 57, 43, 0.55);
  color: #f3b5ad;
}

.hoe-modal__btn--danger:hover {
  background: rgba(192, 57, 43, 0.18);
  color: #ffd8d1;
  border-color: #c0392b;
}

/* =========================================================================
   HOE TOAST — small non-blocking notifications
   ========================================================================= */
.hoe-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 10000;
  pointer-events: none;
  max-width: 340px;
}

.hoe-toast {
  pointer-events: auto;
  background: var(--bg-deep, #120b05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-left: 3px solid var(--gold, #c9a227);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: var(--text, #e8dfc8);
  font-family: 'Crimson Text', serif;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  transform: translateX(20px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hoe-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.hoe-toast--info    { border-left-color: #3498db; }
.hoe-toast--success { border-left-color: #4caf50; }
.hoe-toast--warn    { border-left-color: #e07a3c; }
.hoe-toast--error   { border-left-color: #c0392b; }

.hoe-toast__icon {
  font-size: 1rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.hoe-toast__body { flex: 1; line-height: 1.4; }

@media (max-width: 560px) {
  .hoe-modal { max-width: 100%; }
  .hoe-modal__footer { flex-wrap: wrap; }
  .hoe-modal__btn { flex: 1 1 auto; }
}

/* =========================================================================
   HOE SELECT — themed dropdown that replaces ugly native <select>
   ========================================================================= */
.hoe-select {
  display: inline-block;
  position: relative;
  width: 100%;
  font-family: 'Crimson Text', serif;
}

.hoe-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 6px;
  color: #e8dfc8;
  font-family: 'Crimson Text', serif;
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  text-align: left;
  line-height: 1.2;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.hoe-select__trigger:hover,
.hoe-select__trigger.is-open {
  border-color: #c9a227;
  background: rgba(201, 162, 39, 0.06);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.1);
}

/* Compact variant for inline use (weapon type picker in item cards) */
.hoe-select__trigger--sm {
  font-size: 0.75rem;
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
}
.hoe-select__trigger--sm .hoe-select__caret {
  font-size: 0.55em;
}

.hoe-select__trigger.is-empty {
  color: #8a7e6b;
  font-style: italic;
}

.hoe-select__caret {
  color: #c9a227;
  font-size: 0.65em;
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.15s;
}

.hoe-select__trigger.is-open .hoe-select__caret {
  transform: rotate(180deg);
}

.hoe-select-popup {
  position: absolute;
  z-index: 10001;
  background:
    radial-gradient(circle at top, rgba(201, 162, 39, 0.06), transparent 55%),
    #120b05;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.4);
  padding: 0.3rem;
  font-family: 'Crimson Text', serif;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  min-width: 160px;
}

.hoe-select-popup.open { display: block; }

.hoe-select-option {
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  color: #e8dfc8;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  line-height: 1.3;
}

.hoe-select-option:hover {
  background: rgba(201, 162, 39, 0.16);
  color: #fff4d0;
}

.hoe-select-option.is-selected {
  background: rgba(201, 162, 39, 0.24);
  color: #fff4d0;
  font-weight: 600;
}

.hoe-select-option__sub {
  display: block;
  font-size: 0.7rem;
  color: #8a7e6b;
  margin-top: 0.1rem;
  font-style: italic;
}
