/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #141210;
  --surface:     #1e1a16;
  --card:        #272018;
  --border:      #4a3c28;
  --gold:        #c8a829;
  --gold-light:  #e8cc60;
  --text:        #d4c49a;
  --text-dim:    #8a7a5a;
  --link:        #ff9e1f;
  --red:         #c03030;
  --green:       #4caf50;
  --radius:      8px;
}

html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
header {
  background: linear-gradient(180deg, #0d0b08 0%, #1a1510 100%);
  border-bottom: 2px solid var(--gold);
  padding: 1.25rem 1rem;
  text-align: center;
}
.header-inner { max-width: 860px; margin: 0 auto; }
.logo { height: 48px; margin-bottom: .5rem; }
header h1 {
  font-size: 2rem;
  color: var(--gold-light);
  text-shadow: 0 0 18px rgba(200,168,41,.45);
  letter-spacing: .04em;
}
.subtitle { color: var(--text-dim); font-size: .85rem; margin-top: .25rem; }

/* ── Main layout ── */
main {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ── Search ── */
.search-wrap {
  position: relative;
  display: flex;
  gap: .5rem;
}
#search-input {
  flex: 1;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
}
#search-input:focus { border-color: var(--gold); }

button[type="submit"] {
  padding: .75rem 1.5rem;
  background: var(--gold);
  color: #0d0b08;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s;
}
button[type="submit"]:hover { background: var(--gold-light); }

#suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 4.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  list-style: none;
  z-index: 10;
  overflow: hidden;
}
#suggestions li {
  padding: .55rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
#suggestions li:last-child { border-bottom: none; }
#suggestions li:hover, #suggestions li.active { background: var(--card); color: var(--gold-light); }

/* ── Status / error ── */
#status {
  margin-top: 1.5rem;
  padding: .9rem 1.2rem;
  border-radius: var(--radius);
  font-size: .95rem;
  border: 1px solid var(--border);
  background: var(--surface);
}
#status.loading { color: var(--text-dim); }
#status.error   { border-color: var(--red); color: #ff7070; background: #1c0a0a; }

/* ── Results container ── */
#results { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.25rem; }

/* ── Card ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1rem;
  background: rgba(200,168,41,.1);
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.card-body { padding: 1rem; }

/* ── Monster overview ── */
.overview {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.overview img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  background: rgba(0,0,0,.3);
  border-radius: 4px;
  flex-shrink: 0;
}
.overview-placeholder {
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.3);
  border-radius: 4px;
  font-size: 2rem;
  flex-shrink: 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .4rem .8rem;
  flex: 1;
}
.stat { font-size: .88rem; }
.stat-label { color: var(--text-dim); font-size: .78rem; }
.stat-value { color: var(--text); font-weight: 600; }
.stat-value.danger { color: #ff7070; }
.stat-value.safe   { color: var(--green); }

/* ── Prayer pills ── */
.prayer-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .1rem; }
.prayer-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .7rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  background: rgba(200,168,41,.15);
  border: 1px solid rgba(200,168,41,.35);
  color: var(--gold-light);
}

/* ── Notes list ── */
.notes { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.notes li {
  display: flex;
  gap: .55rem;
  font-size: .9rem;
  line-height: 1.45;
}
.notes li::before { content: "▶"; color: var(--gold); flex-shrink: 0; font-size: .75rem; margin-top: .15em; }

/* ── Gear recommendation ── */
.gear-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem 1.5rem;
  font-size: .9rem;
}
.gear-box dt { color: var(--text-dim); font-size: .8rem; margin-bottom: .1rem; }
.gear-box dd { color: var(--text); font-weight: 600; }
.weapon-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.weapon-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .2rem .55rem;
  font-size: .8rem;
  color: var(--text);
}

/* ── Strategy ── */
.strategy-text {
  font-size: .9rem;
  line-height: 1.65;
  color: var(--text);
}

/* ── Drop table ── */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
  font-size: .78rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,.3);
}

.table-wrap { overflow-x: auto; }
table.drops {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
table.drops th {
  background: var(--surface);
  color: var(--gold);
  text-align: left;
  padding: .5rem .7rem;
  border-bottom: 2px solid var(--border);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
table.drops td {
  padding: .45rem .7rem;
  border-bottom: 1px solid rgba(0,0,0,.25);
  vertical-align: middle;
}
table.drops tr:last-child td { border-bottom: none; }
table.drops .item-name { font-weight: 600; }
table.drops .qty, table.drops .price { white-space: nowrap; text-align: right; }

/* ── No data ── */
.no-data { color: var(--text-dim); font-size: .9rem; font-style: italic; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--text-dim);
  font-size: .8rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── Responsive ── */
@media (max-width: 560px) {
  .overview { flex-direction: column; }
  .gear-box { grid-template-columns: 1fr; }
  header h1 { font-size: 1.5rem; }
}
