/* =========================================
   World Builder — Tharendell Portal Styling
   Applies the Page A look to shortcode pages
   Scope: .thar-world-builder
   ========================================= */

.thar-world-builder{
  --th-gold: #c9a24a;
  --th-gold-strong: rgba(244,207,116,0.45);
  --th-gold-soft: rgba(244,207,116,0.25);
  --th-gold-faint: rgba(244,207,116,0.18);
  --th-ink: #14100b;
  --th-text: #e5d8b0;

  max-width: 1100px;
  margin: 60px auto 80px;
  padding: 0 20px;
  color: var(--th-text);
}

/* MAIN SHELL (matches the template <main> look) */
.thar-world-builder > .thar-card{
  position: relative;
  background: var(--th-ink);
  border-radius: 16px;
  padding: 22px 24px 24px;
  border: 1px solid var(--th-gold-strong);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.85),
    0 20px 38px rgba(0,0,0,0.65);
}

.thar-world-builder > .thar-card::before{
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 12px;
  border: 1px dashed var(--th-gold-soft);
  pointer-events: none;
  opacity: 0.9;
}

.thar-world-builder > .thar-card > *{
  position: relative;
  z-index: 1;
}

/* Headings like Page A */
.thar-world-builder h3{
  font-family: "Cinzel Decorative", serif;
  color: var(--th-gold);
  letter-spacing: 1px;
  margin: 0 0 12px 0;
}

/* Inner panel look (if you later wrap content) */
.thar-world-builder .thar-world-panel{
  position: relative;
  background: rgba(0,0,0,0.18);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--th-gold-strong);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.55),
    0 10px 22px rgba(0,0,0,0.45);
}

.thar-world-builder .thar-world-panel::before{
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 10px;
  border: 1px dashed rgba(244,207,116,0.14);
  pointer-events: none;
  opacity: 0.9;
}

.thar-world-builder .thar-world-panel > *{
  position: relative;
  z-index: 1;
}

/* Form layout */
.thar-world-builder .thar-world-form{
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.thar-world-builder .thar-world-form label{
  display: block;
  color: var(--th-text);
  margin: 0;
}

.thar-world-builder .thar-world-form input,
.thar-world-builder .thar-world-form select,
.thar-world-builder .thar-world-form textarea{
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid rgba(244,207,116,0.22);
  background: rgba(0,0,0,0.22);
  color: var(--th-text);
  outline: none;
  box-sizing: border-box;
}

.thar-world-builder .thar-world-form input::placeholder,
.thar-world-builder .thar-world-form textarea::placeholder{
  color: rgba(231, 214, 170, 0.55);
}

.thar-world-builder .thar-world-form input:focus,
.thar-world-builder .thar-world-form select:focus,
.thar-world-builder .thar-world-form textarea:focus{
  border-color: rgba(244,207,116,0.45);
  box-shadow: 0 0 0 3px rgba(244,207,116,0.12);
}

.thar-world-builder .thar-world-form textarea{
  min-height: 140px;
  resize: vertical;
}

/* Button styling (match Page A) */
.thar-world-builder .thar-world-form button{
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(244,207,116,0.65);
  background: rgba(0,0,0,0.10);
  color: var(--th-gold);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
  width: fit-content;
}

.thar-world-builder .thar-world-form button:hover{
  transform: translateY(-1px);
  filter: brightness(1.06);
  background: rgba(244,207,116,0.08);
}

/* Messages */
.thar-world-builder .thar-msg{ margin-top: 10px; font-size: 0.95em; min-height: 18px; }
.thar-world-builder .thar-msg.ok{ color: #9be59b; }
.thar-world-builder .thar-msg.bad{ color: #ff9a9a; }

/* Loading line */
.thar-world-builder .thar-world-loading{
  margin-top: 8px;
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 900px){
  .thar-world-builder > .thar-card{
    padding: 18px 18px 20px;
  }
}

/* =========================================
   World Builder – Fix <select> dropdown readability
   (browser option list can ignore dark theme)
   ========================================= */

.thar-world-builder select {
  color: var(--th-text);
  background: rgba(0,0,0,0.22);
}

/* The dropdown list items */
.thar-world-builder select option {
  color: #111;          /* dark text so it’s readable on light dropdown backgrounds */
  background: #f2f2f2;  /* light background (most browsers respect this) */
}

/* Some browsers use optgroup */
.thar-world-builder select optgroup {
  color: #111;
  background: #f2f2f2;
}

/* =========================================
   Tharendell Dark Select (Race/Class style)
   ========================================= */

.thar-world-builder select {
  background-color: rgba(0, 0, 0, 0.85);
  color: var(--th-gold);
  border: 1px solid rgba(244,207,116,0.45);
  border-radius: 12px;
  padding: 10px 12px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Dropdown arrow (Chrome/Edge) */
.thar-world-builder select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--th-gold) 50%),
    linear-gradient(135deg, var(--th-gold) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* OPTION LIST */
.thar-world-builder select option {
  background-color: #0b0a08; /* deep ink */
  color: var(--th-gold);
}

/* Hovered option (Chrome / Edge) */
.thar-world-builder select option:hover,
.thar-world-builder select option:focus {
  background-color: #1a4fa3; /* blue highlight */
  color: #ffffff;
}

/* Selected option */
.thar-world-builder select option:checked {
  background-color: #1a4fa3;
  color: #ffffff;
}
/* FIX: Native select dropdown readability (Windows/Chrome) — World Builder */
.thar-world-builder select option{
  background-color: #14100b;
  color: #e5d8b0;
}

.thar-world-builder select option:checked,
.thar-world-builder select option:hover{
  background-color: rgba(244,207,116,0.25);
  color: #14100b;
}

/* Match portal select styling */
.thar-world-builder select{
  background: rgba(0,0,0,0.22);
  color: #c9a24a; /* gold */
  border: 1px solid rgba(244,207,116,0.22);
}

/* World Builder action buttons */
.thar-world-actions{
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* World Builder buttons – match Player Area buttons */
.thar-world-builder .thar-btn,
.thar-world-builder button {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(244,207,116,0.65);
  background: rgba(0,0,0,0.10);
  color: var(--th-gold);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}

.thar-world-builder .thar-btn:hover,
.thar-world-builder button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  background: rgba(244,207,116,0.08);
}

/* =========================================
   Explore Tharendell layout
   ========================================= */

.thar-explore-grid{
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.thar-explore-left label{
  display: block;
  margin-bottom: 12px;
}

.thar-explore-right{
  position: relative;
  background: rgba(0,0,0,0.18);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(244,207,116,0.22);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.55);
}

.thar-explore-h{
  font-family: "Cinzel Decorative", serif;
  color: var(--th-gold);
  letter-spacing: 0.8px;
  margin: 0 0 10px 0;
}

.thar-explore-h2{
  font-family: "Cinzel Decorative", serif;
  color: var(--th-gold);
  letter-spacing: 0.8px;
  margin: 10px 0 10px 0;
}

.thar-explore-p{
  margin: 0 0 10px 0;
  color: var(--th-text);
  opacity: 0.95;
  line-height: 1.4;
  white-space: pre-line;
}

.thar-explore-meta{
  color: var(--th-text);
  opacity: 0.85;
  font-size: 0.95em;
}

.thar-explore-pill{
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(244,207,116,0.35);
  background: rgba(244,207,116,0.10);
  color: var(--th-text);
  font-size: 0.85em;
  vertical-align: middle;
}

.thar-explore-hr{
  border: 0;
  border-top: 1px dashed rgba(244,207,116,0.18);
  margin: 14px 0;
}

.thar-npc{
  border: 1px solid rgba(244,207,116,0.18);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.18);
  margin-bottom: 10px;
}

.thar-npc__top{
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.thar-npc__name{
  color: var(--th-gold);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.thar-npc__role{
  color: var(--th-text);
  opacity: 0.9;
  font-size: 0.95em;
}

.thar-npc__line{
  color: var(--th-text);
  opacity: 0.95;
  font-size: 0.95em;
  margin-top: 4px;
}

@media (max-width: 900px){
  .thar-explore-grid{
    grid-template-columns: 1fr;
  }
}
