@font-face {
  font-family: "Pangolin";
  src: url("../fonts/Pangolin-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Perfect DOS VGA 437";
  src: url("../fonts/PerfectDOSVGA437.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Not Inter";
  src: url("../fonts/NotInter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #15100d;
  --panel: #221a15;
  --panel-2: #2b211a;
  --ink: #f3e7d2;
  --ink-dim: #b3a288;
  --border: rgba(243, 231, 210, 0.14);

  --orange: #e08a3e;
  --gold: #d9a92e;
  --teal: #2f9dae;
  --purple: #8a5cc4;
  --red: #c0392e;
  --green: #4a9e42;

  --accent: var(--orange);
  --accent-2: var(--teal);
  --warn: var(--gold);
  --bad: var(--red);

  --display: "Pangolin", "Not Inter", cursive, sans-serif;
  --mono: "Perfect DOS VGA 437", ui-monospace, Menlo, Consolas, monospace;
  --body: "Not Inter", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

.thick {
  text-shadow: 0.5px 0 currentColor, -0.5px 0 currentColor, 0 0.5px currentColor, 0 -0.5px currentColor;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
  background: var(--bg);
  cursor: url("../img/cursor-open.png") 16 16, auto;
}
body:active {
  cursor: url("../img/cursor-closed.png") 16 16, auto;
}

.skyline {
  position: relative;
  height: 320px;
  overflow: hidden;
  /*background: url("../img/hero-bg.webp") center 65% / cover no-repeat;*/
  background: url("../img/img.png") center 65% / cover no-repeat;
}
.skyline::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(21, 16, 13, 0.15) 0%, rgba(21, 16, 13, 0.55) 55%, var(--bg) 100%);
}
.skyline .logo-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1rem;
  z-index: 1;
}
.skyline .logo-wrap img {
  height: 92px;
  width: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}

.wrap {
  max-width: 1040px;
  margin: -64px auto 0;
  padding: 0 1.25rem 5rem;
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 1.1rem;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
}
.brand .mark {
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}
.brand .tag {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

nav.tabs {
  display: flex;
  gap: 0.6rem;
}
nav.tabs a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 0.92rem;
  padding: 0.45rem 1.2rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%, 8% 50%);
}
nav.tabs a.active { background: var(--orange); color: #24160a; border-color: transparent; }
nav.tabs a:not(.active):hover { background: #33281f; }

main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.hero h1 {
  font-family: var(--display);
  margin: 0.3rem 0 0.4rem;
  font-size: 2rem;
  color: var(--ink);
  font-weight: 400;
  text-shadow: 0.6px 0 currentColor, -0.6px 0 currentColor, 0 0.6px currentColor, 0 -0.6px currentColor;
}
.hero .sub { color: var(--ink-dim); margin: 0 0 1.25rem; max-width: 60ch; }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem 1.5rem;
}
.kv label {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.25rem;
}
.kv output {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.kv output.big {
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--orange);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--ink-dim);
}
.badge.ok { color: var(--teal); border-color: var(--teal); }
.badge.warn { color: var(--gold); border-color: var(--gold); }
.badge.bad { color: var(--red); border-color: var(--red); }
.badge .dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }

section.panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
section.panel > h2 {
  font-family: var(--display);
  margin: 0;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-shadow: 0.5px 0 currentColor, -0.5px 0 currentColor, 0 0.5px currentColor, 0 -0.5px currentColor;
}
section.panel > h2 .num {
  font-family: var(--mono);
  color: var(--ink-dim);
  font-size: 0.85rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}
section.panel > .desc {
  margin: -0.6rem 0 0;
  color: var(--ink-dim);
  font-size: 0.92rem;
  max-width: 72ch;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.35rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.map-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.map-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); border-color: var(--accent); }
.map-card.today { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(224, 138, 62, 0.3); }
.map-card .lvl { font-family: var(--display); font-size: 1.25rem; color: var(--ink); }
.map-card .seq { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-dim); }
.map-card .when { font-family: var(--mono); font-size: 0.8rem; color: var(--teal); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--mono);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--ink);
}
thead th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  color: var(--ink-dim);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr.today { background: rgba(224, 138, 62, 0.14); }
tbody tr.today td:first-child { color: var(--orange); font-weight: 700; }
td.num, th.num { text-align: right; }
td.dim { color: var(--ink-dim); }

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink-dim);
}
.pill.warn { color: #241a05; background: var(--gold); border-color: transparent; }
.pill.bad { color: #2a0d09; background: var(--red); border-color: transparent; }

td.badge-cell, th.badge-cell { text-align: center; }
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
}
.count-badge.warn { color: #241a05; background: var(--gold); }
.count-badge.bad { color: #2a0d09; background: var(--red); }

.note {
  border-left: 3px solid var(--purple);
  padding: 0.6rem 0.9rem;
  font-size: 0.86rem;
  color: var(--ink-dim);
  background: var(--panel-2);
  border-radius: 0 8px 8px 0;
}
.note strong { color: var(--ink); }

a.pagelink { color: var(--teal); }

.btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--display);
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.85rem 0.28rem;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.btn-chip:hover { background: var(--orange); color: #24160a; border-color: transparent; transform: translateY(-1px); }
.btn-chip .arrow { font-family: var(--mono); font-size: 0.8rem; opacity: 0.7; }

[id] { scroll-margin-top: 1.5rem; }

footer {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
  font-family: var(--mono);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.item-toolbar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.item-toolbar input, .item-toolbar select {
  font-family: var(--body);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.item-toolbar input { flex: 1 1 220px; }

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}
.item-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.item-card .icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.item-card .icon-wrap img { max-width: 78%; max-height: 78%; object-fit: contain; }
.item-card .icon-wrap .no-icon { font-family: var(--mono); color: var(--ink-dim); font-size: 0.85rem; }
.item-card .name { font-family: var(--display); font-size: 1.1rem; color: var(--ink); line-height: 1.2; }
.item-card .meta-row {
  display: flex;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  flex-wrap: wrap;
}
.item-card .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.item-card .pools {
  font-size: 0.8rem;
  color: var(--ink-dim);
  line-height: 1.5;
}
.item-card .pools strong { color: var(--ink); font-weight: 400; font-family: var(--display); }

.rarity-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.rarity-Common { color: var(--ink-dim); }
.rarity-Uncommon { color: var(--green); }
.rarity-Rare { color: var(--teal); }
.rarity-Epic { color: var(--purple); }
.rarity-Legendary { color: var(--gold); }
.rarity-Mythic { color: var(--orange); }
.rarity-RidiculouslyRare { color: var(--red); }

.stat-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.74rem;
}
.stat-bar .stat-label { min-width: 58px; color: var(--ink-dim); }
.stat-bar .track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.stat-bar .fill { display: block; height: 100%; border-radius: 3px; }
.stat-bar .stat-value { min-width: 40px; text-align: right; color: var(--ink-dim); }

.fill-red { background: var(--red); }
.fill-gold { background: var(--gold); }
.fill-teal { background: var(--teal); }
.fill-green { background: var(--green); }
.fill-purple { background: var(--purple); }
.fill-orange { background: var(--orange); }
.fill-dim { background: var(--ink-dim); }

.effect-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sash-preview {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.sash-preview img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}
.sash-preview .info h3 {
  font-family: var(--display);
  font-weight: 400;
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  color: var(--ink);
}
.sash-preview .info p { margin: 0.2rem 0; color: var(--ink-dim); font-size: 0.9rem; }
.sash-preview .info p strong { color: var(--ink); font-weight: 400; font-family: var(--display); }

.sash-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sash-swatch {
  width: 48px;
  height: 48px;
  padding: 0.3rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  cursor: inherit;
}
.sash-swatch img { width: 100%; height: 100%; object-fit: contain; }
.sash-swatch:hover { border-color: var(--accent); }
.sash-swatch.active { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(224, 138, 62, 0.3); }

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 0.9rem;
}
.badge-slot { position: relative; display: flex; justify-content: center; }
.badge-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--panel-2);
  padding: 0.35rem;
  cursor: inherit;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.badge-btn img { width: 100%; height: 100%; object-fit: contain; }
.badge-btn:hover { border-color: var(--orange); transform: translateY(-2px); }
.badge-btn.special { border-color: var(--gold); }

.badge-tip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -8px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  min-width: 160px;
  max-width: 220px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-dim);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
  z-index: 5;
}
.badge-tip strong {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  color: var(--ink);
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}
.badge-slot:hover .badge-tip { opacity: 1; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 7, 5, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1.5rem;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.modal-card img { width: 128px; height: 128px; object-fit: contain; margin-bottom: 0.75rem; }
.modal-card h3 { font-family: var(--display); font-weight: 400; font-size: 1.4rem; margin: 0 0 0.6rem; color: var(--ink); }
.modal-card p { color: var(--ink-dim); margin: 0 0 1rem; }
.modal-card .item-links { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.modal-close {
  font-family: var(--display);
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  cursor: inherit;
}
.modal-close:hover { background: var(--orange); color: #24160a; }

@media (max-width: 640px) {
  .wrap { margin-top: -50px; }
  .hero h1 { font-size: 1.6rem; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
