*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

img {
  -webkit-touch-callout: none;
  pointer-events: none;
}

button {
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:        #0d1520;
  --bg-raised: #111e2e;
  --bg-card:   #162438;
  --bg-hover:  #1b2d45;

  --border:    #1f3350;
  --border-lo: #182840;

  --accent:       #3b82f6;
  --accent-soft:  #1d6af0;
  --accent-glow:  rgba(59,130,246,.18);
  --accent-text:  #93c5fd;

  --text-hi:   #f0f6ff;
  --text-body: #a8bdd8;
  --text-lo:   #536880;
  --text-dim:  #2e4160;

  --c-common:    #94a3b8;
  --c-uncommon:  #4ade80;
  --c-rare:      #60a5fa;
  --c-epic:      #c084fc;
  --c-legendary: #fbbf24;

  --sidebar-w: 252px;
  --header-h:  58px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-body);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── HEADER ───────────────────────────────────────────── */
header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 14px;
  z-index: 200;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 28px; height: 28px;
  flex-shrink: 0;
}

.logo-name {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: .05em;
}

.logo-name em { color: var(--accent-text); font-style: normal; }

.header-sep { width: 1px; height: 24px; background: var(--border); }

.header-sub {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-lo);
}

.h-spacer { flex: 1; }

.h-search {
  position: relative;
  display: flex;
  align-items: center;
}

.h-search svg {
  position: absolute;
  left: 10px;
  color: var(--text-lo);
  pointer-events: none;
}

.h-search input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 12px 6px 32px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-hi);
  width: 210px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.h-search input::placeholder { color: var(--text-lo); }

.h-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
  border-radius: 7px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: .15s;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-lo);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-glow);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 0;
}

.lang-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text-lo);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 8px;
  cursor: pointer;
  transition: .15s;
}

.lang-btn:hover {
  color: var(--accent-text);
  border-color: var(--border);
}

.lang-btn.active {
  color: var(--accent-text);
  background: var(--accent-glow);
  border-color: rgba(59,130,246,.3);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  gap: 5px;
  flex-direction: column;
  padding: 4px;
}

.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-lo); border-radius: 2px; transition: .2s;
}

.hamburger:hover span { background: var(--accent-text); }

/* ── LAYOUT ───────────────────────────────────────────── */
.layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── SIDEBAR ──────────────────────────────────────────── */
aside {
  position: fixed;
  top: var(--header-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px 0 28px;
  z-index: 150;
  transition: transform .25s ease;
}

.nav-sidebar-header {
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.nav-sidebar-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nav-sidebar-sub {
  font-size: 10px;
  color: var(--text-lo);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-group { margin-bottom: 4px; }

.nav-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 5px;
}

.nav-label-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.nav-label-text {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-body);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  color: var(--text-body);
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-hi);
  border-left-color: var(--border);
}

.nav-item.active {
  background: var(--bg-card);
  color: var(--accent-text);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: .75;
  transition: opacity .12s;
}

.nav-item:hover .nav-icon img,
.nav-item.active .nav-icon img {
  opacity: 1;
}

.nav-icon-empty {
  width: 20px;
  height: 20px;
}

.nav-label-name { flex: 1; }

.nav-hr {
  height: 1px;
  background: transparent;
  margin: 2px 0;
}

/* ── MAIN ─────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

main {
  flex: 1;
  flex: 1;
  padding: 36px 40px;
  min-width: 0;
}

main.has-scroll-btn { padding-bottom: 120px; }

/* ── PAGE HEADER ──────────────────────────────────────── */
.page-head { margin-bottom: 28px; }

.page-title {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-hi);
  margin-bottom: 6px;
}

.page-desc {
  font-size: 14px;
  color: var(--text-lo);
  font-weight: 300;
}

/* ── SECTION LABEL ────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 28px 0 12px;
}

.section-label:first-child { margin-top: 0; }

/* ── PLACEHOLDER ──────────────────────────────────────── */
.placeholder-box {
  background: var(--bg-raised);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 64px 40px;
  text-align: center;
  color: var(--text-dim);
}

.placeholder-box .ph-icon { font-size: 40px; margin-bottom: 14px; opacity: .5; }
.placeholder-box .ph-text { font-size: 15px; }
.placeholder-box .ph-sub  { font-size: 13px; margin-top: 6px; }

/* ── LINK CARDS ───────────────────────────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.link-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color .15s, background .15s;
}

.link-card:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.link-thumb {
  width: 42px; height: 42px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.link-body { min-width: 0; }

.link-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-hi);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-desc {
  font-size: 12.5px;
  color: var(--text-lo);
  line-height: 1.45;
}

.link-tag {
  display: inline-block;
  margin-top: 7px;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: rgba(59,130,246,.12);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 4px;
  padding: 1px 7px;
}


/* ── OVERLAY ──────────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 140;
}

/* ── FOOTER ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  margin-top: auto;
  text-align: center;
  font-size: 12px;
  color: var(--text-lo);
}

/* ── MOBILE ───────────────────────────────────────────── */
@media (max-width: 760px) {
  .hamburger { display: flex; }
  .header-sep, .header-sub { display: none; }
  .h-search input { width: 140px; }

  aside { transform: translateX(-100%); }
  aside.open {
    transform: none;
    box-shadow: 6px 0 32px rgba(0,0,0,.5);
  }

  .overlay.open { display: block; }

  .main-wrap { margin-left: 0; }
  main { padding: 22px 18px; }
  main.has-scroll-btn { padding-bottom: 90px; }
  .links-grid { grid-template-columns: 1fr; }
}
