:root {
  color-scheme: dark;
  --bg: #131417;
  --panel: #1c1e22;
  --panel-hover: #24272c;
  --border: #2e3238;
  --text: #e6e6e6;
  --muted: #9aa0a8;
  --accent: #7fbf5a;
  --nether: #d0573b;
  --dungeon: #8a7cd6;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }

header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.nav a:not(.brand) {
  color: var(--muted);
  text-decoration: none;
}

.nav a:not(.brand):hover,
.nav a[aria-current="page"] { color: var(--text); }

main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

h1 { margin: 0 0 8px; font-size: 1.8rem; }

.lead { color: var(--muted); margin: 0 0 24px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 16px;
  color: var(--text);
  text-decoration: none;
}

.card:hover { background: var(--panel-hover); }
.card.nether { border-left-color: var(--nether); }
.card.dungeon { border-left-color: var(--dungeon); }
.card h2 { margin: 0 0 4px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Pages that embed a Google Doc */
.doc-page main { display: flex; flex-direction: column; }

.doc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.doc-bar h1 { margin: 0; }

.doc-frame {
  flex: 1;
  width: 100%;
  min-height: 75vh;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.placeholder {
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 16px;
}

/* Nether bosses */
.muted { color: var(--muted); }

h2 { margin: 32px 0 12px; font-size: 1.4rem; }

.boss-index {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px 16px;
}

.boss {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--nether);
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
  scroll-margin-top: 16px;
}

.boss h3 { margin: 0 0 6px; font-size: 1.3rem; }
.boss h4 { margin: 16px 0 6px; font-size: 1rem; }
.boss ul { margin: 0; padding-left: 20px; }
.boss p { margin: 0 0 6px; }

.boss-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.boss-imgs {
  display: flex;
  gap: 8px;
  flex: 0 1 240px;
}

.boss-imgs img {
  width: 100%;
  min-width: 0;
  max-height: 200px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 4px;
}

.boss-info { flex: 1 1 280px; }

.form h4 { margin: 10px 0 4px; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-weight: 600;
}

.dmg {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 12px;
  margin: 8px 0 0;
}

.dmg dt { color: var(--muted); }
.dmg dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }

.chip {
  font-size: 0.85rem;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.chip.weak { color: #ff9b85; border-color: #6b3a30; }
.chip.resist { color: #9cc3ff; border-color: #2f4566; }
.chip.immune { color: var(--muted); }
.chip.heals { color: #9fe08a; border-color: #35552c; }

.table-wrap { overflow-x: auto; }

.drops {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

.drops th, .drops td {
  border-bottom: 1px solid var(--border);
  padding: 4px 8px;
  text-align: center;
  white-space: nowrap;
}

.drops thead th { color: var(--muted); font-weight: 600; }
.drops tbody th { text-align: left; font-weight: 500; white-space: normal; min-width: 160px; }
.drops .qty { color: var(--muted); }

.wiki-link { margin-top: 10px; font-size: 0.9rem; }

.map {
  --zoom: 1;
  position: relative;
  margin: 0 0 8px;
  max-width: 700px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  touch-action: none;
  user-select: none;
  cursor: zoom-in;
}
.map.zoomed { cursor: grab; }
.map.zoomed:active { cursor: grabbing; }
.map-inner { position: relative; transform-origin: 0 0; }
.map img { display: block; width: 100%; }

.map-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(19, 20, 23, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.map-controls button:hover { background: var(--panel-hover); }

.pin {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--nether);
  box-sizing: content-box;
  transform: scale(calc(1 / var(--zoom)));
}

.pin span {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(19, 20, 23, 0.85);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.pin.left span { left: auto; right: 100%; margin: 0 6px 0 0; }
.pin:hover span { background: var(--bg); color: #fff; }

.schedule { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.schedule th, .schedule td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.schedule th { color: var(--muted); font-weight: 600; }
.schedule td:nth-child(3) { white-space: nowrap; }

.where { margin: 0 0 4px; }
.boss.minor { border-left-color: var(--border); }
.spawn-times .t { white-space: nowrap; }
.credit { color: var(--muted); margin: -16px 0 24px; font-size: 0.95rem; }

footer p { margin: 4px 0; }

.copy-name {
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 6px;
  cursor: pointer;
}

.copy-name:hover { background: var(--panel-hover); }
.copy-name[data-copied]::after { content: " copied"; color: var(--muted); font-weight: 400; }

/* Feedback button in the top bar */
.feedback { position: relative; }

.feedback summary {
  list-style: none;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 10px;
}

.feedback summary::-webkit-details-marker { display: none; }
.feedback summary:hover,
.feedback[open] summary { background: var(--panel-hover); }

.feedback-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  width: 260px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-size: 0.95rem;
}

.feedback-pop p { margin: 0 0 6px; }
.feedback-pop p:last-child { margin: 0; }

/* Dungeon guides */
.crumbs { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }

.shot { margin: 16px 0; max-width: 820px; }
.shot img { display: block; width: 100%; border-radius: 6px; border: 1px solid var(--border); }
.shot figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  max-width: 820px;
}

.shots .shot { margin: 0; }

.players { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.9rem; font-weight: 400; }

.players input {
  width: 64px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}
