:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --line: #e7eaf0;
  --text: #1f2937;
  --muted: #667085;
  --gold: #d2a437;
  --gold-soft: #fff7dd;
  --link: #2459a7;
  --shadow: 0 10px 34px rgba(21, 33, 56, 0.06);
  --radius: 20px;
  --radius-sm: 14px;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }


.language-panel {
  padding: 18px 22px;
}

.language-switcher {
  width: 100%;
}
.language-switcher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.language-switcher-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.lang-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.lang-btn img {
  width: 20px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.lang-btn span {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.lang-btn:hover {
  background: #f8fafc;
  border-color: #d7dce6;
  transform: translateY(-1px);
}
.lang-btn.is-active {
  border-color: rgba(210, 164, 55, 0.72);
  background: #fff7dd;
  box-shadow: inset 0 0 0 1px rgba(210, 164, 55, 0.18);
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 96px 14px 40px; }
.layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}


.mobile-menu-toggle,
.mobile-sidebar-backdrop {
  display: none;
}

.mobile-menu-toggle {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 1200;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 24px rgba(21, 33, 56, 0.12);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.mobile-menu-toggle svg {
  width: 16px;
  height: 16px;
}

.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  z-index: 1090;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
}

.sidebar-card,
.card,
.table-card,
.subcard,
.community-card,
.info-card,
.section-box,
.faq-item,
.dwarf-card,
.mine-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand-card { padding: 14px; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffdf73 0%, #f3c532 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
  font-size: 22px;
}
.brand strong { display: block; font-size: 1rem; }
.brand small { display: block; color: var(--muted); }

.sidebar-card { padding: 16px; }
.sidebar-title {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 12px;
}
.sidebar-nav {
  display: grid;
  gap: 6px;
}
.sidebar-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
}
.sidebar-nav a:hover {
  background: #f7f9fc;
  text-decoration: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip,
.inline-term {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.chip:hover,
.inline-term:hover { background: #f8fafc; }
.inline-term { display: inline-flex; padding: 4px 10px; }

.main { min-width: 0; }
.section {
  padding: 22px;
  margin-bottom: 18px;
}
.section > * + * { margin-top: 14px; }
.hero {
  background: radial-gradient(circle at top right, rgba(255, 223, 115, 0.22), transparent 26%), #fff;
}
.eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid #f0e3a8;
  color: #745200;
  font-size: .86rem;
  margin-bottom: 10px;
}
.hero h1,
.section h2 {
  margin: 0;
  line-height: 1.15;
}
.hero h1 { font-size: clamp(1.9rem, 3.2vw, 2.8rem); }
.section h2 { font-size: 1.7rem; }
.section h3,
.hero p,
.section p,
.section ul,
.section ol { margin: 0; }
.hero-text,
.lead,
.section-text {
  color: #334155;
  font-size: 1.02rem;
}
.muted { color: var(--muted); }
.small { font-size: .92rem; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
}
.btn:hover { text-decoration: none; background: #f8fafc; }
.btn-primary {
  background: #1f2937;
  color: #fff;
  border-color: #1f2937;
}
.btn-primary:hover { background: #111827; }

.note {
  padding: 16px 18px;
  border-radius: 16px;
  background: #fafbfe;
  border: 1px solid var(--line);
}
.note-gold {
  background: #fffdf4;
  border-color: #f0e3a8;
}

.section-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.chain {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.chain-item,
.chain-arrow {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.chain-arrow {
  border: 0;
  background: transparent;
  padding-inline: 0;
  color: var(--muted);
}

.card-grid,
.resource-grid,
.section-grid,
.community-grid {
  display: grid;
  gap: 14px;
}
.resource-grid,
.section-grid,
.community-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dwarf-grid,
.mine-grid,
.chest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.info-card,
.section-box,
.community-card,
.dwarf-card,
.mine-card {
  padding: 18px;
}
.info-card > * + *,
.section-box > * + *,
.community-card > * + *,
.dwarf-card > * + *,
.mine-card > * + * { margin-top: 10px; }

.resource-meta,
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.meta-pill,
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f9fafb;
  font-size: .92rem;
}

.steps {
  display: grid;
  gap: 12px;
}
.step {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.step-head > :last-child { min-width: 0; }
.step h4 { margin: 0; line-height: 1.25; }
.step p { margin: 0; color: #334155; }
.step-num {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  background: var(--gold-soft);
  border: 1px solid #f0e3a8;
  color: #745200;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.compact .step { padding: 12px 14px; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.two-col > * { min-width: 0; }
.gap-top { margin-top: 18px; }
.subcard {
  padding: 18px;
}
.subcard > * + * { margin-top: 10px; }
.clean-list {
  margin: 0;
  padding-left: 18px;
}
.clean-list li + li { margin-top: 8px; }

.mini-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.mini-table th,
.mini-table td {
  white-space: normal;
  word-break: break-word;
}

.dwarf-head,
.chest-head,
.mine-head {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
}
.avatar,
.mine-image {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.mine-image {
  width: 100%;
  height: 150px;
  border-radius: 18px;
}
.dwarf-title,
.mine-title { margin: 0; font-size: 1.12rem; }
.dwarf-sub,
.mine-sub { color: var(--muted); font-size: .93rem; }

.table-stack {
  display: grid;
  gap: 18px;
}
.table-card { overflow: hidden; }
.table-card header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.table-card header > * + * { margin-top: 6px; }
.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  background: #fff;
}
th, td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: #fafbfc;
  font-weight: 600;
  color: #374151;
}
tr:last-child td { border-bottom: 0; }

.faq-list {
  display: grid;
  gap: 14px;
}
.faq-item {
  padding: 18px;
}
.faq-item > * + * { margin-top: 8px; }
.btn-link {
  display: inline-flex;
  width: fit-content;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-link:hover { text-decoration: none; background: #f8fafc; }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.42);
  padding: 14px;
  z-index: 1000;
}
.modal.open { display: flex; }
.modal-card {
  width: min(430px, 100%);
  max-height: min(82vh, 720px);
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fffdf6;
}
.modal-head h3 { margin: 0; font-size: 1rem; line-height: 1.2; }
.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
}
.modal-body { padding: 14px 14px 16px; font-size: .95rem; overflow: auto; }
.modal-body > * + * { margin-top: 8px; }
.modal-body ul { margin: 0; padding-left: 18px; }

@media (max-width: 980px) {
  .mobile-menu-toggle,
  .mobile-sidebar-backdrop {
    display: flex;
  }

  .wrap {
    padding: 12px 12px 28px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1100;
    width: min(320px, 86vw);
    padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: #f6f7fb;
    transform: translateX(-104%);
    transition: transform .24s ease;
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.14);
    gap: 12px;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .mobile-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-card {
    padding: 14px;
    border-radius: 18px;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .sidebar-nav a {
    padding: 10px 12px;
  }

  .main {
    padding-top: 54px;
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 10px 10px 24px;
  }

  .section {
    padding: 16px 14px;
    margin-bottom: 14px;
    border-radius: 18px;
  }

  .section > * + * {
    margin-top: 12px;
  }

  .section h2 {
    font-size: 1.32rem;
  }

  .hero h1 {
    font-size: 1.62rem;
  }

  .hero-text,
  .lead,
  .section-text,
  .section p,
  .section li {
    font-size: .96rem;
  }

  .section-head {
    gap: 10px;
  }

  .resource-grid,
  .section-grid,
  .community-grid,
  .dwarf-grid,
  .mine-grid,
  .chest-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .info-card,
  .section-box,
  .community-card,
  .dwarf-card,
  .mine-card,
  .subcard,
  .faq-item {
    padding: 15px;
    border-radius: 16px;
  }

  .chips {
    gap: 6px;
  }

  .chip,
  .inline-term,
  .btn,
  .btn-link {
    font-size: .9rem;
  }

  .chip,
  .inline-term {
    padding: 7px 10px;
  }

  .hero-actions {
    gap: 8px;
  }

  .steps {
    gap: 10px;
  }

  .step {
    padding: 12px 12px;
    border-radius: 14px;
  }

  .step-head {
    gap: 10px;
  }

  .step-num {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 11px;
    font-size: .95rem;
  }

  .step h4 {
    font-size: 1rem;
  }

  .dwarf-head,
  .chest-head,
  .mine-head {
    grid-template-columns: 56px 1fr;
    gap: 12px;
  }

  .avatar,
  .mine-image {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .mine-image {
    width: 100%;
    height: 140px;
  }

  .meta-pill,
  .stat-pill {
    font-size: .87rem;
    padding: 6px 9px;
  }

  .table-card header {
    padding: 14px 14px 10px;
  }

  .table-wrap {
    margin: 0 -1px;
  }

  table {
    min-width: 440px;
  }

  th,
  td {
    padding: 10px 11px;
    font-size: .92rem;
  }

  .modal {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: min(78vh, 640px);
    border-radius: 18px 18px 14px 14px;
  }

  .modal-head {
    padding: 10px 12px;
  }

  .modal-body {
    padding: 12px 12px 14px;
    font-size: .93rem;
  }
}

@media (max-width: 420px) {
  .mobile-menu-toggle {
    left: 10px;
    top: 10px;
    padding: 9px 12px;
    font-size: .92rem;
  }

  .wrap {
    padding-inline: 8px;
  }

  .main {
    padding-top: 50px;
  }

  .section {
    padding: 14px 12px;
  }

  .hero h1 {
    font-size: 1.48rem;
  }

  .section h2 {
    font-size: 1.2rem;
  }

  table {
    min-width: 400px;
  }
}


@media (max-width: 980px) {
  .language-panel {
    padding: 16px 14px;
  }

  .language-switcher-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .wrap {
    padding-top: 10px;
  }

  .lang-btn {
    min-height: 54px;
  }

  .lang-btn span {
    font-size: .62rem;
  }
}
