/* ==========================================================================
   Solitaire Grove — components
   Header, nav, buttons, cards, forms, modals, footer
   ========================================================================== */

/* ---------- Site header ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 80;
}

.site-header {
  position: relative;
  background: linear-gradient(180deg, #103f30, #0e362a);
  color: var(--cream);
  border-bottom: 1px solid rgba(228, 207, 156, 0.22);
  box-shadow: 0 10px 30px rgba(10, 44, 33, 0.16);
}

/* Top bar: brand and the account/utility controls. */
.header-main { height: 64px; }

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  width: min(100% - (var(--gutter) * 2), 1440px);
  margin-inline: auto;
}

/* Second row: the game shelf. Keeps the wide, localized game links out of the
   top bar so the brand and controls never collide at any desktop width. */
.header-navbar {
  border-top: 1px solid rgba(228, 207, 156, 0.16);
  background: rgba(8, 34, 26, 0.34);
}

.header-navbar__inner {
  width: min(100% - (var(--gutter) * 2), 1440px);
  margin-inline: auto;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--cream);
  text-decoration: none;
  flex: none;
}
.brand:hover { color: var(--cream); }
.brand img { height: 36px; width: auto; }
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.brand__tag {
  margin-top: 3px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  height: 100%;
}

.nav-item { position: relative; height: 100%; display: flex; align-items: center; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 9px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: rgba(247, 240, 227, 0.86);
  font-family: var(--font-ui);
  font-size: 0.845rem;
  font-weight: 550;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-link:hover,
.nav-link:focus-visible,
.nav-item.is-open > .nav-link {
  background: rgba(247, 240, 227, 0.1);
  color: var(--cream);
}
.nav-link--active { color: var(--gold-soft); }
.nav-link--active::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}
.nav-link .icon { width: 16px; height: 16px; opacity: 0.8; }
.nav-caret { width: 12px; height: 12px; opacity: 0.65; transition: transform var(--dur) var(--ease); }
.nav-item.is-open .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% - 6px);
  left: 0;
  min-width: 260px;
  padding: 10px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
.nav-item.is-open .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
/* Menus near the right edge open towards the left so they never widen the page. */
.nav-dropdown--right { left: auto; right: 0; }

.nav-dropdown--wide { min-width: 460px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.nav-dropdown__label {
  grid-column: 1 / -1;
  padding: 8px 10px 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-dropdown a:hover { background: var(--parchment); color: var(--ink); }
.nav-dropdown a .icon { width: 17px; height: 17px; color: var(--pine); opacity: 0.75; flex: none; }
.nav-dropdown__divider { grid-column: 1 / -1; height: 1px; background: var(--line-soft); margin: 4px 10px; }

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.header-coins {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(228, 207, 156, 0.32);
  background: rgba(200, 162, 83, 0.12);
  color: var(--gold-soft);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background var(--dur) var(--ease);
}
.header-coins:hover { background: rgba(200, 162, 83, 0.22); }
.header-coins .icon { width: 15px; height: 15px; }

.header-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(247, 240, 227, 0.25);
  background: rgba(247, 240, 227, 0.06);
  color: rgba(247, 240, 227, 0.72);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.header-search:hover { background: rgba(247, 240, 227, 0.12); border-color: rgba(247, 240, 227, 0.4); }
.header-search .icon { width: 16px; height: 16px; }

/* Wide search field in the middle of the top bar (desktop). */
.header-search--bar {
  flex: 1 1 auto;
  max-width: 620px;
  min-width: 240px;
  height: 42px;
  padding: 0 16px;
  margin-inline: auto;
  font-size: 0.9rem;
}
.header-search--bar .icon { width: 17px; height: 17px; flex: none; }
.header-search--bar span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  color: rgba(247, 240, 227, 0.66);
}
.header-search--bar kbd { margin-left: auto; flex: none; }

/* Compact icon-only search for the one-row header on tablets and phones. */
.header-search--icon {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: rgba(20, 35, 28, 0.07); }
.site-header .icon-btn:hover { background: rgba(247, 240, 227, 0.12); }
.icon-btn .icon { width: 20px; height: 20px; }

.menu-toggle { display: none; }

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 79;
  background: var(--pine-deep);
  color: var(--cream);
  padding: 22px var(--gutter) 40px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 240ms var(--ease);
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav__group + .mobile-nav__group { margin-top: 26px; }
.mobile-nav__label {
  margin-bottom: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.mobile-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(247, 240, 227, 0.1);
  color: var(--cream);
  font-size: 1.02rem;
  text-decoration: none;
}
.mobile-nav a .arrow { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--pine);
  --btn-fg: var(--cream);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 11px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 61, 46, 0.18); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .icon { width: 18px; height: 18px; }

.btn--primary { --btn-bg: var(--pine); --btn-fg: var(--cream); }
.btn--gold { --btn-bg: var(--gold); --btn-fg: #241c0c; }
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-border: var(--line);
}
.btn--ghost:hover { background: var(--parchment); box-shadow: none; }
.btn--light {
  --btn-bg: rgba(247, 240, 227, 0.1);
  --btn-fg: var(--cream);
  --btn-border: rgba(247, 240, 227, 0.28);
}
.btn--light:hover { background: rgba(247, 240, 227, 0.18); box-shadow: none; }
.btn--danger { --btn-bg: var(--terracotta); --btn-fg: #fff; }
.btn--sm { min-height: 36px; padding: 7px 14px; font-size: 0.84rem; border-radius: 9px; }
.btn--lg { min-height: 52px; padding: 14px 28px; font-size: 1rem; border-radius: 13px; }
.btn--block { width: 100%; }

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  color: var(--pine);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: none;
}
.btn-text:hover { color: var(--pine-soft); text-decoration: underline; text-underline-offset: 4px; }
.btn-text .icon { width: 16px; height: 16px; }

.toolbar-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 64px;
  height: 58px;
  padding: 6px 10px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), opacity var(--dur);
}
.toolbar-btn .icon { width: 21px; height: 21px; }
.toolbar-btn:hover { background: rgba(247, 240, 227, 0.1); }
.toolbar-btn:disabled { opacity: 0.38; cursor: default; background: transparent; }
.toolbar-btn--accent { color: var(--gold-soft); }

/* ---------- Chips / pills / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--gold); color: var(--ink); }
.chip.is-active { background: var(--pine); border-color: var(--pine); color: var(--cream); }
.chip .icon { width: 14px; height: 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--parchment);
  color: var(--ink-soft);
}
.badge--gold { background: var(--gold-soft); color: #4a3813; }
.badge--pine { background: rgba(15, 61, 46, 0.1); color: var(--pine); }
.badge--new { background: var(--terracotta); color: #fff; }
.badge--easy { background: #dce8d3; color: #33502a; }
.badge--medium { background: var(--gold-soft); color: #57431b; }
.badge--hard { background: #f0d3c7; color: #7a3520; }
.badge--soft { background: rgba(247, 240, 227, 0.12); color: var(--gold-soft); }

/* ---------- Cards (content cards) ---------- */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
}
.panel--flush { padding: 0; overflow: hidden; }
.panel--dark {
  background: linear-gradient(160deg, var(--pine), var(--pine-deep));
  border-color: rgba(228, 207, 156, 0.2);
  color: var(--cream);
}
.panel--dark h1, .panel--dark h2, .panel--dark h3 { color: var(--cream); }

.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), border-color 220ms var(--ease);
}
.item-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
  color: var(--ink);
}
.item-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(150deg, #174f3c, #0a2c21);
  overflow: hidden;
}
.item-card__media img { width: 100%; height: 100%; object-fit: cover; }
.item-card__thumb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 18px;
}
.item-card__thumb .mini-card {
  width: 52px;
  height: 78px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
  background-size: cover;
  background-position: center;
}
.item-card__thumb .mini-card + .mini-card { margin-left: -18px; }
.item-card__thumb .mini-card:nth-child(1) { transform: rotate(-9deg) translateY(4px); }
.item-card__thumb .mini-card:nth-child(2) { transform: translateY(-3px); z-index: 2; }
.item-card__thumb .mini-card:nth-child(3) { transform: rotate(9deg) translateY(4px); }
.item-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item-card__title { font-family: var(--font-display); font-size: 1.12rem; font-weight: 560; margin: 0; }
.item-card__meta { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--ink-faint); }
.item-card__desc { font-size: 0.86rem; color: var(--muted); margin: 0; line-height: 1.5; }
.item-card__foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.item-card__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.8rem; font-weight: 650; color: var(--ink-soft); }
.input {
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 162, 83, 0.22); }
.input::placeholder { color: #9aa89f; }

.search-input-wrap { position: relative; }
.search-input-wrap .icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--ink-faint);
  pointer-events: none;
}
.search-input-wrap .input { padding-left: 42px; }

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 44px; height: 26px;
  border-radius: 999px;
  background: #cfc4ae;
  transition: background var(--dur) var(--ease);
  flex: none;
  position: relative;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch__track { background: var(--pine); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--gold); outline-offset: 3px; }
.switch__text { font-size: 0.9rem; }

/* Segmented control */
.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 11px;
  background: var(--parchment);
  border: 1px solid var(--line-soft);
}
.segmented button {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: var(--font-ui);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.segmented button.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(20, 35, 28, 0.12);
}
.segmented--dark { background: rgba(247, 240, 227, 0.08); border-color: rgba(247, 240, 227, 0.14); }
.segmented--dark button { color: rgba(247, 240, 227, 0.72); }
.segmented--dark button.is-active { background: rgba(247, 240, 227, 0.16); color: var(--cream); box-shadow: none; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 30, 23, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade-in 160ms var(--ease);
}
.modal {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px;
  animation: modal-in 200ms var(--ease);
}
.modal--wide { width: min(820px, 100%); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal__head h2 { margin: 0; font-size: 1.5rem; }
.modal__close { margin: -6px -6px 0 0; }
.modal__body { color: var(--ink-soft); }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.modal__actions--split { justify-content: space-between; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

/* Win modal */
.win-modal { text-align: center; }
.win-modal__art { width: 150px; margin: 0 auto 12px; }
.win-modal h2 { font-size: 2rem; }
.win-modal__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.win-stat { padding: 14px 8px; background: var(--parchment); border-radius: 12px; }
.win-stat strong { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); }
.win-stat span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); }

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 300;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--pine-deep);
  color: var(--cream);
  font-size: 0.86rem;
  font-weight: 550;
  box-shadow: var(--shadow-md);
  animation: toast-in 200ms var(--ease);
}
.toast .icon { width: 17px; height: 17px; color: var(--gold-soft); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(40px, 7vw, 90px);
  background: linear-gradient(180deg, #0e3529, var(--pine-deep));
  color: rgba(247, 240, 227, 0.72);
  padding: clamp(44px, 6vw, 74px) 0 28px;
  border-top: 1px solid rgba(228, 207, 156, 0.18);
  font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 34px;
  padding-bottom: 40px;
}
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand .brand img { height: 44px; width: auto; }
.footer-brand p { max-width: 34ch; color: rgba(247, 240, 227, 0.6); font-size: 0.86rem; }
.footer-social { display: flex; gap: 8px; margin-top: 16px; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(247, 240, 227, 0.18);
  color: var(--gold-soft);
}
.footer-social a:hover { background: rgba(247, 240, 227, 0.08); }
.footer-social .icon { width: 17px; height: 17px; }
.footer-col h4 {
  margin: 0 0 14px;
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.footer-col a {
  display: block;
  padding: 5px 0;
  color: rgba(247, 240, 227, 0.7);
  text-decoration: none;
  font-size: 0.86rem;
}
.footer-col a:hover { color: var(--cream); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid rgba(247, 240, 227, 0.12);
  font-size: 0.76rem;
  color: rgba(247, 240, 227, 0.5);
}
.footer-bottom__links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom a { color: inherit; text-decoration: none; }
.footer-bottom a:hover { color: var(--cream); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--ink-faint);
  padding: 16px 0 0;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--ink-faint); text-decoration: none; }
.breadcrumbs a:hover { color: var(--pine); }
.breadcrumbs .sep { color: var(--line); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state img { width: 200px; margin: 0 auto 18px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); max-width: 42ch; margin-inline: auto; }

@media (max-width: 1519px) {
  .main-nav .nav-link[target="_blank"] { display: none; }
}
@media (max-width: 1400px) {
  .nav-link { padding: 0 8px; font-size: 0.82rem; }
  .main-nav { gap: 0; }
}
@media (max-width: 1179px) {
  /* The shelf does not fit any more: fall back to the one-row header + drawer. */
  .header-actions { margin-inline-start: auto; }
  .header-navbar { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-coins { display: none; }
  .header-search--bar { display: none; }
  .header-search--icon { display: inline-flex; }
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .brand__tag { display: none; }
}
@media (max-width: 620px) {
  .header-actions .btn { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}


@media (max-width: 640px) {
  .footer-col a { padding: 8px 0; }
  .footer-bottom__links a { padding: 6px 0; }
  .mobile-nav a { padding: 14px 4px; }
  .btn { min-height: 46px; }
  .btn--sm { min-height: 40px; }
}

/* ==========================================================================
   Language switcher (i18n)
   ========================================================================== */

.lang-switch { position: relative; flex: none; }
.lang-switch__trigger {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 10px 0 9px;
  border: 1px solid rgba(247, 240, 227, 0.28);
  border-radius: 999px; background: transparent; color: var(--cream);
  font: inherit; font-size: 0.8rem; letter-spacing: 0.04em; font-weight: 600;
  cursor: pointer; transition: background 160ms ease, border-color 160ms ease;
}
.lang-switch__trigger:hover { background: rgba(247, 240, 227, 0.12); border-color: rgba(247, 240, 227, 0.45); }
.lang-switch__trigger .icon { width: 17px; height: 17px; }
.lang-switch__code { min-width: 20px; text-align: center; }
.lang-switch__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 80;
  min-width: 186px; padding: 6px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(10, 34, 25, 0.22);
  display: none;
}
.lang-switch.is-open .lang-switch__menu { display: block; }
.lang-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 9px 12px; border: 0; border-radius: 9px;
  background: transparent; color: inherit; font: inherit; font-size: 0.92rem;
  text-align: left; cursor: pointer;
}
.lang-option:hover, .lang-option:focus-visible { background: var(--parchment); }
.lang-option.is-active { font-weight: 600; background: var(--parchment); }
.lang-option__check { color: var(--moss); font-weight: 700; }
.footer-langs { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 12px; }
.footer-langs a { color: inherit; text-decoration: none; opacity: 0.8; }
.footer-langs a:hover { color: var(--cream); opacity: 1; }
.mobile-nav__langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.mobile-nav__langs .chip { min-height: 38px; }

/* CJK text needs a font stack with Chinese glyphs and a little more line height. */
html[lang="zh-Hans"] {
  --font-display: "Fraunces", "Noto Serif SC", "Songti SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --font-ui: "DM Sans", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
html[lang="zh-Hans"] body { line-height: 1.75; }
html[lang="zh-Hans"] h1, html[lang="zh-Hans"] h2, html[lang="zh-Hans"] h3 { letter-spacing: 0; }
html[lang="ru"] h1, html[lang="de"] h1 { letter-spacing: -0.01em; }

@media (max-width: 900px) {
  .lang-switch__trigger { padding: 0 8px; }
}
@media (max-width: 620px) {
  .lang-switch { display: none; }
}
