@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Rajdhani:wght@600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #101214;
  --page-bg: #14171a;
  --panel: #1a1f25;
  --panel-2: #15191e;
  --panel-3: #20262d;
  --ink: #f3efe7;
  --muted: #a8adaf;
  --line: #323b45;
  --accent: #d7aa52;
  --accent-dark: #2d2415;
  --accent-2: #1f3834;
  --accent-border: #5a8c7f;
  --accent-ink: #f7e7c1;
  --danger: #f06f67;
  --warn: #e0b55b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

html {
  min-height: 100%;
  background: #0d0f11;
}

body {
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 0 34px !important;
  display: grid !important;
  grid-template-columns: 210px minmax(0, 1020px);
  grid-template-areas:
    "top top"
    "side main";
  justify-content: center;
  align-items: start;
  gap: 0 18px;
  background:
    linear-gradient(180deg, #1a1c1f 0%, #121417 42%, #0d0f11 100%) !important;
  color: var(--ink) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 13px !important;
}

.site-top {
  grid-area: top;
  width: min(1248px, calc(100vw - 24px));
  height: 176px;
  margin: 14px auto 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(215, 170, 82, 0.34);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(13, 15, 17, 0.12), rgba(13, 15, 17, 0.62)),
    url("assets/tibia-toolbox-header-tech.png") center / cover no-repeat;
}

.site-top::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 13, 14, 0.78), rgba(12, 13, 14, 0.34) 42%, rgba(12, 13, 14, 0.78)),
    linear-gradient(180deg, rgba(32, 38, 45, 0.18), rgba(13, 15, 17, 0.78));
  pointer-events: none;
}

.site-top::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215, 170, 82, 0.58), rgba(90, 140, 127, 0.5), transparent);
  opacity: 0.8;
}

.site-brand {
  position: absolute;
  left: 0;
  right: 0;
  top: 42px;
  z-index: 1;
  text-align: center;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(34px, 4.2vw, 54px);
  font-weight: 900;
  line-height: 0.98;
  color: #fbf7ed;
  letter-spacing: 0;
  text-transform: none;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.62);
}

.site-brand span {
  color: var(--accent);
}

.site-slogan {
  position: absolute;
  left: 0;
  right: 0;
  top: 94px;
  z-index: 1;
  text-align: center;
  color: #d7ddd9;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.boosted-boss-widget {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  display: grid;
  gap: 5px;
  width: 260px;
  max-width: calc(100% - 32px);
  padding: 7px 9px;
  border: 1px solid rgba(215, 170, 82, 0.42);
  border-radius: 8px;
  background: rgba(15, 19, 22, 0.82);
  color: #fbf7ed;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(8px);
  cursor: default;
}

.boosted-boss-widget:hover {
  color: #fbf7ed;
}

.boosted-boss-widget img {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 6px;
  background: #11161b;
  image-rendering: auto;
}

.boosted-boss-widget.is-loading .daily-info-boss-media {
  display: none;
}

.boosted-boss-widget.is-loading .daily-info-creature-media {
  display: none;
}

.daily-info-rashid-media {
  image-rendering: pixelated;
}

.daily-info-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.daily-info-badge {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(90, 140, 127, 0.48);
  border-radius: 6px;
  background: rgba(90, 140, 127, 0.13);
  color: #d8f1ea;
  font-weight: 900;
}

.daily-info-copy {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.daily-info-eyebrow {
  overflow: hidden;
  color: #f0c76f;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.daily-info-name {
  margin-top: 3px;
  overflow: hidden;
  color: #fbf7ed;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-info-detail {
  margin-top: 2px;
  overflow: hidden;
  color: #b9c0bf;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-menu {
  grid-area: side;
  width: 210px;
  margin-top: 18px;
  position: sticky;
  top: 14px;
  align-self: start;
}

.menu-box {
  margin-bottom: 12px;
  border: 1px solid rgba(82, 91, 101, 0.72);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(26, 31, 37, 0.94);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

.menu-title {
  min-height: 30px;
  padding: 8px 10px 7px;
  background: #222930;
  border-bottom: 1px solid rgba(82, 91, 101, 0.72);
  color: #f5ead6;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 7px;
}

.menu-list li + li {
  margin-top: 5px;
}

.menu-list a,
.menu-note {
  display: block;
  min-height: 31px;
  padding: 8px 9px 8px 25px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #e7eceb !important;
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
  position: relative;
}

.menu-list a::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--accent);
}

.menu-list a:hover,
.menu-list a.active {
  border-color: rgba(215, 170, 82, 0.48);
  background: rgba(215, 170, 82, 0.1);
  color: #ffffff !important;
}

.menu-note {
  padding-left: 9px;
  line-height: 1.4;
  color: var(--muted) !important;
}

body > main {
  grid-area: main;
  width: min(1020px, 100%) !important;
  margin-top: 18px !important;
  overflow: hidden;
  background: var(--panel) !important;
  border: 1px solid rgba(82, 91, 101, 0.72) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow) !important;
}

body > main::before {
  content: none !important;
}

header {
  padding: 16px 18px 15px !important;
  background: #20262d !important;
  border-bottom: 1px solid rgba(82, 91, 101, 0.72) !important;
  color: var(--ink) !important;
}

h1 {
  margin: 0 !important;
  color: #fbf7ed !important;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
  font-size: 28px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
  line-height: 1.08 !important;
  text-transform: none;
  text-shadow: none;
}

h2 {
  color: #f5ead6 !important;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
  font-size: 18px !important;
  font-weight: 850 !important;
  letter-spacing: 0 !important;
}

.subtitle {
  color: #b9c0bf !important;
  font-size: 12.5px !important;
}

.home-link,
a {
  color: var(--accent);
}

header .home-link {
  color: #f0c76f !important;
  font-size: 12px !important;
  font-weight: 800;
  text-decoration: none;
}

header .home-link:hover {
  text-decoration: underline;
}

.content,
.form,
.results,
.section,
footer {
  color: var(--ink) !important;
}

.form,
.section,
.tools {
  background: var(--panel) !important;
}

.results,
.section.alt,
footer {
  background: var(--panel-2) !important;
}

.tool,
.card,
.proj,
.conv,
.formula {
  background: #20262d !important;
  border: 1px solid rgba(82, 91, 101, 0.76) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.tool:hover,
.card.feature,
.formula {
  background: #24302e !important;
  border-color: rgba(90, 140, 127, 0.72) !important;
}

.tool:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
}

.tool .icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 10px !important;
  background: rgba(215, 170, 82, 0.12);
  border: 1px solid rgba(215, 170, 82, 0.4);
  border-radius: 8px;
  color: #f8e4b7;
  box-shadow: none;
}

.tool h2 {
  font-size: 17px !important;
}

.tool .open,
.ok {
  color: #82d3c0 !important;
}

.warn { color: var(--warn) !important; }
.bad { color: var(--danger) !important; }

.label,
.card .label,
.hint,
.explain,
.foot-note,
.empty,
.muted {
  color: var(--muted) !important;
}

.label,
.card .label {
  letter-spacing: 0.05em !important;
}

label {
  color: #ebe5d9 !important;
}

input,
select,
textarea {
  background: #11161b !important;
  border: 1px solid rgba(82, 91, 101, 0.86) !important;
  border-radius: 7px !important;
  color: #f7f2e9 !important;
  box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: #7f878a !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(215, 170, 82, 0.8) !important;
  box-shadow:
    inset 0 1px 5px rgba(0, 0, 0, 0.18),
    0 0 0 3px rgba(215, 170, 82, 0.16) !important;
}

input[readonly] {
  background: #171d23 !important;
  color: #9fa8aa !important;
}

button {
  background: #d7aa52 !important;
  border: 1px solid rgba(247, 221, 171, 0.48) !important;
  border-radius: 7px !important;
  color: #15110a !important;
  font-weight: 900 !important;
  text-shadow: none !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

button:hover {
  background: #e5ba64 !important;
}

button.secondary {
  background: #20262d !important;
  border-color: rgba(82, 91, 101, 0.86) !important;
  color: #eee7da !important;
}

table {
  background: rgba(17, 22, 27, 0.62);
}

thead th {
  background: #242b32 !important;
  border-bottom: 1px solid rgba(82, 91, 101, 0.72) !important;
  color: #f3e7cf !important;
}

tbody td {
  border-bottom: 1px solid rgba(82, 91, 101, 0.5) !important;
  color: #f3efe7;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr:hover {
  background: rgba(215, 170, 82, 0.07) !important;
}

table.sortable-table th {
  position: relative;
  padding-right: 24px !important;
  cursor: pointer;
  user-select: none;
}

table.sortable-table th::after {
  content: "\2195";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(215, 170, 82, 0.72);
  font-size: 10px;
  font-weight: 900;
}

table.sortable-table th[aria-sort="ascending"]::after {
  content: "\25B2";
  color: #f0c76f;
}

table.sortable-table th[aria-sort="descending"]::after {
  content: "\25BC";
  color: #f0c76f;
}

table.sortable-table th:focus-visible {
  outline: 2px solid rgba(215, 170, 82, 0.75);
  outline-offset: -3px;
}

.tag {
  background: rgba(90, 140, 127, 0.16) !important;
  border: 1px solid rgba(90, 140, 127, 0.42) !important;
  border-radius: 999px !important;
  color: #d8f1ea !important;
}

.formula,
.formula strong {
  color: #f5ead6 !important;
}

footer {
  border-top: 1px solid rgba(82, 91, 101, 0.72) !important;
  color: #a8adaf !important;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "top"
      "side"
      "main";
    padding: 0 10px 28px !important;
  }

  .site-top {
    width: 100%;
    height: 172px;
  }

  .site-brand {
    top: 24px;
    font-size: 38px;
  }

  .site-slogan {
    top: 68px;
    padding: 0 12px;
  }

  .boosted-boss-widget {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 7px 8px;
  }

  .boosted-boss-widget img {
    width: 30px;
    height: 30px;
  }

  .daily-info-row {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
  }

  .daily-info-badge {
    width: 30px;
    height: 30px;
  }

  .site-menu {
    width: 100%;
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .menu-box {
    margin: 0;
  }

  body > main {
    width: 100% !important;
    margin-top: 12px !important;
  }
}

@media (max-width: 700px) {
  .site-top {
    height: 156px;
  }

  .site-brand {
    top: 24px;
    font-size: 30px;
  }

  .site-slogan {
    top: 60px;
    font-size: 12px;
  }

  .boosted-boss-widget {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 6px;
    padding: 6px 8px;
  }

  .boosted-boss-widget img {
    width: 28px;
    height: 28px;
  }

  .daily-info-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px;
  }

  .daily-info-badge {
    width: 28px;
    height: 28px;
  }

  .daily-info-copy {
    display: grid;
  }

  .daily-info-eyebrow {
    font-size: 0;
  }

  .daily-info-eyebrow::before {
    content: attr(data-short-label);
    font-size: 9px;
  }

  .daily-info-name {
    font-size: 11px;
  }

  .daily-info-detail {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-menu {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body {
    display: block !important;
    padding: 0 10px 96px !important;
    padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
  }

  .site-top {
    width: 100%;
    margin-top: 10px;
    border-radius: 12px;
  }

  body > main {
    width: 100% !important;
    margin-top: 10px !important;
    border-radius: 12px !important;
  }

  header {
    padding: 15px 14px 14px !important;
  }

  h1 {
    font-size: 24px !important;
    line-height: 1.12 !important;
  }

  input,
  select,
  textarea,
  button,
  .search-button {
    min-height: 44px;
  }

  .site-menu {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: block !important;
    width: auto;
    margin: 0;
    padding: 12px 10px 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(215, 170, 82, 0.34);
    background: rgba(14, 17, 20, 0.96);
    box-shadow: 0 -16px 34px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(12px);
  }

  .site-menu .menu-box {
    margin: 0;
    border: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }

  .site-menu .menu-box:not(:first-child),
  .site-menu .menu-title {
    display: none;
  }

  .site-menu .menu-list {
    display: flex;
    gap: 7px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .site-menu .menu-list::-webkit-scrollbar {
    display: none;
  }

  .site-menu .menu-list li {
    flex: 0 0 auto;
  }

  .site-menu .menu-list li + li {
    margin-top: 0;
  }

  .site-menu .menu-list a {
    display: flex;
    width: 88px;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    padding: 16px 7px 8px;
    border-color: rgba(82, 91, 101, 0.72);
    border-radius: 12px;
    background: #171d23;
    color: #e9efef !important;
    font-size: 10.5px;
    font-weight: 850;
    line-height: 1.12;
    text-align: center;
    white-space: normal;
    scroll-snap-align: start;
  }

  .site-menu .menu-list a::before {
    top: 8px;
    left: 50%;
    width: 22px;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(215, 170, 82, 0.62);
  }

  .site-menu .menu-list a:hover,
  .site-menu .menu-list a.active {
    border-color: rgba(215, 170, 82, 0.62);
    background: rgba(215, 170, 82, 0.14);
  }

  .table-wrap,
  .data-table-wrap {
    -webkit-overflow-scrolling: touch;
  }
}
