* { box-sizing: border-box; }
:root {
  --bg-overlay-top: rgba(8, 19, 27, 0.38);
  --bg-overlay-bottom: rgba(8, 19, 27, 0.78);
  --panel: rgba(14, 22, 29, 0.72);
  --panel-soft: rgba(20, 29, 37, 0.66);
  --panel-hover: rgba(31, 42, 50, 0.8);
  --border: rgba(255,255,255,.10);
  --text: #f3f4f6;
  --muted: #d1d7df;
  --accent: rgba(26, 123, 146, 0.92);
  --accent-hover: rgba(143, 73, 168, 0.95);
  --shadow: 0 18px 48px rgba(0,0,0,.26);
}
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: "Inter", Arial, Helvetica, sans-serif;
  background: #0b1a22;
}
img { max-width: 100%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at top, rgba(38, 125, 150, 0.22), transparent 32%),
    linear-gradient(var(--bg-overlay-top), var(--bg-overlay-bottom)),
    url("https://wallpapercave.com/wp/wp3006044.png") center/cover no-repeat;
}
.floating-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.floating {
  position: absolute;
  display: inline-block;
  opacity: .18;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.35));
  animation: drift 22s ease-in-out infinite;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}
.floating.book {
  width: 58px;
  height: 58px;
  background-image: url("../assets/items/enchanted_book_4.png");
}
.floating.table {
  width: 68px;
  height: 68px;
  background-image: url("../assets/items/scroll.png");
}
.page-shell {
  width: min(1500px, calc(100% - 22px));
  margin: 0 auto;
  padding: 22px 0 36px;
}
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 12px 0 36px;
}
.hero__title {
  width: min(540px, 82vw);
  height: auto;
}
.hero__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.button-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: background-color .2s ease, transform .2s ease;
}
.button-link:hover { background: var(--accent-hover); transform: translateY(-1px); }
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.toolbar__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.toolbar__row--top {
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}
.search-wrap {
  position: relative;
  flex: 0 1 42%;
  min-width: 280px;
  max-width: none;
}
.search-wrap input {
  width: 100%;
  padding: 14px 42px 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10, 23, 31, 0.78);
  color: var(--text);
  font-size: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.search-wrap input::placeholder { color: #b8c0ca; }
#clear-search {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #aab4bf;
  font-size: 1.4rem;
  cursor: pointer;
  display: none;
}
.results-count {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  padding: 0 6px;
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
}
.table-card {
  background: rgba(8, 18, 25, 0.34);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  padding: 4px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  border-radius: 14px;
}
.enchantments-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.enchantments-table thead tr { background: rgba(12, 20, 26, 0.88); }
.enchantments-table tbody tr { background: var(--panel-soft); }
.enchantments-table tbody tr:hover { background: var(--panel-hover); }
.enchantments-table th,
.enchantments-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.enchantments-table th:first-child,
.enchantments-table td:first-child { border-left: 1px solid var(--border); }
.enchantments-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: .92rem;
  font-weight: 700;
  backdrop-filter: blur(12px);
}
.enchantments-table thead th:nth-child(1) { width: 13%; }
.enchantments-table thead th:nth-child(2) { width: 27%; }
.enchantments-table thead th:nth-child(3) { width: 8%; text-align: center; }
.enchantments-table thead th:nth-child(4) { width: 15%; }
.enchantments-table thead th:nth-child(5) { width: 14%; }
.enchantments-table thead th:nth-child(6) { width: 14%; }
.enchantments-table thead th:nth-child(7) { width: 10%; }
.enchantments-table td {
  font-size: .92rem;
  line-height: 1.5;
}
.enchantments-table td.level-cell { text-align: center; font-weight: 600; }
.enchantments-table td.name-cell { font-weight: 700; }
.sort-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
  padding: 0;
}
.applicable-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}
.applicable-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}
.applicable-cell img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
}
.applicable-cell span {
  font-size: .87rem;
  vertical-align: middle;
}
.data-pack-link {
  color: #f2d6ff;
  text-decoration: none;
}
.data-pack-link:hover { color: #ffffff; text-decoration: underline; }
ul.inline-list {
  margin: 0;
  padding-left: 18px;
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) rotate(-8deg); }
  25% { transform: translate3d(30px, -18px, 0) rotate(4deg); }
  50% { transform: translate3d(10px, 24px, 0) rotate(10deg); }
  75% { transform: translate3d(-28px, -12px, 0) rotate(2deg); }
  100% { transform: translate3d(0, 0, 0) rotate(-8deg); }
}
@media (max-width: 1100px) {
  .enchantments-table { min-width: 920px; }
}
@media (max-width: 720px) {
  .page-shell { width: calc(100% - 10px); padding-top: 14px; }
  .hero { padding-top: 6px; }
  .hero__links { gap: 8px; }
  .button-link { font-size: .92rem; }
  .toolbar { align-items: stretch; }
  .results-count { width: 100%; }
  .table-card { padding: 4px; }
}

.backdrop {
  background:
    radial-gradient(circle at 12% 18%, rgba(84, 153, 180, 0.20), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(133, 88, 164, 0.16), transparent 22%),
    linear-gradient(var(--bg-overlay-top), var(--bg-overlay-bottom)),
    url("https://wallpapercave.com/wp/wp3006044.png") center/cover no-repeat;
}
.floating {
  opacity: .16;
  transform: scale(var(--scale, 1));
  will-change: transform;
}
.floating.book { width: 54px; height: 54px; background-image: url("../assets/items/enchanted_book_4.png"); }
.floating.table { width: 56px; height: 56px; background-image: url("../assets/items/scroll.png"); }
.floating.axe { width: 54px; height: 54px; background-image: url("../assets/items/axe.png"); }
.floating.sword { width: 54px; height: 54px; background-image: url("../assets/items/sword.png"); }
.floating.shield { width: 52px; height: 52px; background-image: url("../assets/items/shield.png"); }
.floating.pickaxe { width: 52px; height: 52px; background-image: url("../assets/items/pickaxe.png"); }
.floating.scroll { width: 52px; height: 52px; background-image: url("../assets/items/scroll.png"); }
.hero__links { gap: 10px; }
.button-link {
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(17, 106, 128, 0.92), rgba(32, 84, 122, 0.88));
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.08);
}
.button-link:hover {
  background: linear-gradient(135deg, rgba(128, 72, 156, 0.95), rgba(89, 58, 140, 0.94));
  transform: translateY(-1px) scale(1.01);
}
.toolbar__main {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: min(980px, 100%);
}
.quick-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.filter-chip {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(10, 23, 31, 0.72);
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.filter-chip:hover { background: rgba(27, 47, 61, 0.82); transform: translateY(-1px); }
.filter-chip.is-active {
  background: linear-gradient(135deg, rgba(17, 106, 128, 0.95), rgba(32, 84, 122, 0.92));
  border-color: rgba(255,255,255,.20);
}
.table-card {
  background: rgba(7, 16, 22, 0.30);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 44px rgba(0,0,0,.24);
}
.table-scroll {
  background: rgba(12, 18, 25, 0.32);
}
.enchantments-table tbody tr { background: rgba(21, 31, 39, 0.62); }
.enchantments-table tbody tr:hover { background: rgba(30, 42, 51, 0.76); }
.enchantments-table th, .enchantments-table td { padding-left: 4px; padding-right: 4px; }
.inline-list { padding-left: 16px; }
@media (max-width: 900px) {
  .toolbar__main { width: 100%; }
  .quick-filters { width: 100%; }
}


/* v5 layout tightening */
.page-shell {
  width: calc(100% - 20px);
  max-width: none;
  margin: 0 auto;
  padding: 18px 0 30px;
}

.hero {
  padding: 8px 0 18px;
}

.toolbar {
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.toolbar__main {
  width: 100%;
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.search-wrap {
  flex: 1 1 420px;
  width: auto;
  min-width: 280px;
}

.quick-filters {
  flex: 1 1 420px;
  min-width: 280px;
}


.table-card {
  padding: 2px;
  border-radius: 18px;
}

.table-scroll {
  border-radius: 12px;
}

.enchantments-table th,
.enchantments-table td {
  padding-top: 11px;
  padding-bottom: 11px;
  padding-left: 3px;
  padding-right: 3px;
}

.enchantments-table thead th:nth-child(1) { width: 12%; }
.enchantments-table thead th:nth-child(2) { width: 25%; }
.enchantments-table thead th:nth-child(3) { width: 7%; }
.enchantments-table thead th:nth-child(4) { width: 16%; }
.enchantments-table thead th:nth-child(5) { width: 15%; }
.enchantments-table thead th:nth-child(6) { width: 14%; }
.enchantments-table thead th:nth-child(7) { width: 11%; }

@media (max-width: 900px) {
  .page-shell {
    width: calc(100% - 10px);
    padding-top: 10px;
  }

  .toolbar__main,
  .search-wrap,
  .quick-filters {
    width: 100%;
    flex-basis: 100%;
  }
}


.applicable-item--any {
  background: rgba(255,255,255,.06);
  border: none;
  font-weight: inherit;
  padding: 4px 8px;
  gap: 0;
}


.description-cell {
  min-width: 0;
}

@media (max-width: 1100px) {
  .toolbar__row--top {
    align-items: stretch;
  }

  }

@media (max-width: 800px) {
  .search-wrap {
    flex-basis: 100%;
    max-width: 100%;
  }

  .toolbar__row--top {
    flex-direction: column;
    align-items: stretch;
  }

  .results-count {
    white-space: normal;
  }
}
