:root {
  color-scheme: dark;
  --bg: #0a0b10;
  --bg-2: #0f1119;
  --panel: #141722;
  --panel-2: #191d2a;
  --panel-3: #202536;
  --text: #f7f8ff;
  --muted: #a4adbf;
  --quiet: #6f788d;
  --line: rgba(255, 255, 255, 0.1);
  --strong-line: rgba(255, 255, 255, 0.16);
  --purple: #7757ff;
  --violet: #aa4dff;
  --cyan: #34d5ff;
  --lime: #a9f52b;
  --amber: #ffb84d;
  --red: #ff6176;
  --header-h: 80px;
  --sidebar-w: 256px;
  --max: 1520px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
  scrollbar-color: var(--purple) #11131c;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 44px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 44px),
    linear-gradient(180deg, #090a0f 0%, #0d0f16 42%, #090a0f 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(320px, 600px) minmax(280px, 1fr);
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 16, 0.9);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.brand {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #08100b;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  box-shadow: 0 10px 30px rgba(52, 213, 255, 0.15);
  font-weight: 950;
}

.brand strong {
  display: block;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.brand small {
  display: none;
  max-width: 220px;
  margin-top: 5px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
}

.top-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.top-search span {
  position: absolute;
  left: 16px;
  color: var(--quiet);
  font-size: 18px;
  font-weight: 900;
  pointer-events: none;
}

.top-search input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px 0 44px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.top-search input:focus {
  border-color: rgba(119, 87, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(119, 87, 255, 0.14);
}

.top-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-right: 24px;
}

.crystal-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(169, 245, 43, 0.4);
  border-radius: 8px;
  color: var(--lime);
  background: rgba(169, 245, 43, 0.08);
  font-size: 20px;
  font-weight: 950;
}

.userbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-pill,
.crystal-pill,
.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 850;
}

.user-pill strong,
.account-pill strong {
  display: block;
  line-height: 1.05;
}

.user-pill small,
.account-pill small {
  display: block;
  max-width: 132px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
}

.menu-button {
  display: none;
  min-width: 52px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 850;
}

.sidebar {
  position: fixed;
  z-index: 40;
  left: 0;
  top: var(--header-h);
  bottom: 0;
  width: var(--sidebar-w);
  display: grid;
  grid-template-rows: 1fr auto;
  border-right: 1px solid var(--line);
  background: rgba(13, 15, 22, 0.92);
  backdrop-filter: blur(16px);
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 16px;
}

.side-label {
  margin: 0 8px 8px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link,
.more-menu summary,
.more-menu button,
.mobile-nav button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  font-size: 16px;
  font-weight: 850;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(52, 213, 255, 0.08);
  font-weight: 950;
}

.nav-link:hover,
.nav-link.is-active,
.more-menu summary:hover,
.more-menu button:hover,
.mobile-nav button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
}

.nav-link.is-active .nav-icon {
  color: #080a10;
  background: var(--lime);
}

.more-menu {
  color: var(--muted);
}

.more-menu summary {
  display: flex;
  align-items: center;
  list-style: none;
}

.more-menu summary::-webkit-details-marker {
  display: none;
}

.more-menu summary::after {
  content: "v";
  margin-left: auto;
  color: var(--quiet);
}

.more-menu[open] summary::after {
  content: "^";
}

.more-menu button {
  min-height: 40px;
  padding-left: 42px;
  font-size: 14px;
}

.side-actions {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.logout-link {
  text-align: center;
}

.mobile-nav {
  position: fixed;
  top: calc(var(--header-h) + 10px);
  right: 12px;
  z-index: 70;
  width: min(260px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #11141d;
  box-shadow: var(--shadow);
}

main {
  width: min(calc(100vw - var(--sidebar-w) - 48px), var(--max));
  margin-left: calc(var(--sidebar-w) + 24px);
  padding: calc(var(--header-h) + 24px) 24px 80px 0;
}

.home-view {
  display: grid;
  gap: 24px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px;
  min-height: 168px;
  border: 1px solid rgba(119, 87, 255, 0.3);
  border-radius: 8px;
  padding: 26px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(119, 87, 255, 0.24), rgba(52, 213, 255, 0.11) 48%, rgba(169, 245, 43, 0.12)),
    linear-gradient(180deg, #171b29, #11141e);
  box-shadow: var(--soft-shadow);
}

.hero-kicker {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgba(169, 245, 43, 0.28);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--lime);
  background: rgba(169, 245, 43, 0.08);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-panel h1 {
  max-width: 780px;
  margin: 13px 0 10px;
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: 0;
}

.hero-panel p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.hero-actions,
.featured-actions,
.listing-actions,
.toolbar,
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-panel > div,
.hero-actions,
.featured-copy,
.featured-actions {
  min-width: 0;
}

.featured-actions .stat-box {
  flex: 0 1 132px;
}

.featured-card {
  min-height: 248px;
  border: 1px solid var(--strong-line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow);
}

.featured-inner {
  position: relative;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 280px;
  align-items: center;
  gap: 24px;
  min-height: 248px;
  padding: 24px;
}

.featured-inner::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 78px;
  background:
    linear-gradient(90deg, rgba(52, 213, 255, 0.18), rgba(119, 87, 255, 0.2), rgba(169, 245, 43, 0.12)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 8px, transparent 8px 18px);
  border-bottom: 1px solid var(--line);
}

.featured-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 144px;
  height: 144px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: var(--text);
  object-fit: cover;
  background:
    linear-gradient(135deg, rgba(119, 87, 255, 0.34), rgba(52, 213, 255, 0.18)),
    #1d2231;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.3);
  font-size: 15px;
  font-weight: 950;
  text-align: center;
}

.featured-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.featured-copy .eyebrow {
  margin-bottom: 10px;
}

.featured-copy h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 48px);
  line-height: 1;
  font-weight: 950;
}

.featured-copy p {
  margin: 0 0 16px;
  max-width: 720px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.featured-copy .tags {
  margin-bottom: 14px;
}

.featured-stats {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.stat-box {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.section {
  margin-top: 0;
  padding: 18px 0 0;
}

.plain-section {
  border: 0;
  background: transparent;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 38px);
  line-height: 1.05;
  font-weight: 950;
}

h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 920;
}

.primary,
.secondary,
.danger {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.primary:hover,
.secondary:hover,
.danger:hover {
  transform: translateY(-1px);
}

.primary {
  color: #080a10;
  background: linear-gradient(135deg, var(--lime), #5fe6ff);
  box-shadow: 0 12px 24px rgba(169, 245, 43, 0.16);
}

.secondary {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.065);
}

.danger {
  color: #fff;
  background: var(--red);
}

button:disabled,
a[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.is-active {
  color: #080a10;
  background: var(--cyan);
}

.toolbar {
  margin: 0 0 22px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(119, 87, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(119, 87, 255, 0.16);
}

input,
select {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  padding: 13px 14px;
}

.toolbar input {
  flex: 1 1 560px;
  font-weight: 800;
}

.toolbar select {
  flex: 0 0 220px;
}

.card-grid,
.quest-grid,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.rank-grid {
  display: grid;
  gap: 22px;
}

.podium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.rank-rows {
  display: grid;
  gap: 12px;
}

.subhead {
  margin: 2px 0 -4px;
  color: var(--muted);
  font-weight: 900;
}

.listing-card,
.rank-row,
.quest-card,
.tool-card,
.pending-card,
.empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 23, 34, 0.88);
  box-shadow: var(--soft-shadow);
}

.listing-card {
  position: relative;
  display: grid;
  min-height: 336px;
  overflow: hidden;
}

.listing-card::before {
  content: "";
  height: 110px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(119, 87, 255, 0.32), rgba(52, 213, 255, 0.18), rgba(169, 245, 43, 0.1)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 8px, transparent 8px 18px);
}

.listing-card[data-type="bot"]::before {
  background:
    linear-gradient(135deg, rgba(255, 184, 77, 0.22), rgba(119, 87, 255, 0.28), rgba(52, 213, 255, 0.1)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0 8px, transparent 8px 18px);
}

.listing-rank {
  position: absolute;
  right: 14px;
  top: 124px;
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--lime);
  background: rgba(0, 0, 0, 0.34);
  font-weight: 950;
}

.listing-top {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 0 14px;
  margin-top: -42px;
}

.listing-icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  object-fit: cover;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(119, 87, 255, 0.34), rgba(52, 213, 255, 0.2)),
    #202536;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.32);
  font-size: 14px;
  font-weight: 950;
  text-align: center;
}

.listing-card h3 {
  margin-top: 6px;
  padding-right: 48px;
}

.listing-type {
  margin: 45px 0 0;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.listing-card p,
.quest-card p,
.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.listing-card > p,
.listing-card .tags,
.listing-card .listing-actions {
  padding-left: 14px;
  padding-right: 14px;
}

.listing-card > p {
  min-height: 54px;
  font-weight: 700;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  font-weight: 850;
}

.listing-actions {
  align-self: end;
  padding-bottom: 14px;
}

.listing-actions .primary,
.listing-actions .secondary {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

.meta-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
}

.meta-row span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0 7px;
  background: rgba(255, 255, 255, 0.045);
}

.rank-row {
  display: grid;
  grid-template-columns: 54px 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 12px;
}

.rank-row .rank-no {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--lime);
  background: rgba(169, 245, 43, 0.08);
  font-size: 16px;
  font-weight: 950;
}

.rank-row .listing-icon {
  width: 66px;
  height: 58px;
  font-size: 11px;
}

.rank-row h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.rank-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.rank-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rank-row-actions .stat-box {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.rank-row-actions .primary,
.rank-row-actions .secondary {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.quest-card,
.tool-card,
.pending-card,
.empty {
  padding: 18px;
}

.empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-weight: 850;
  background: rgba(20, 23, 34, 0.82);
}

.progress {
  height: 12px;
  margin: 14px 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--lime), var(--cyan));
}

.tool-card {
  display: grid;
  gap: 12px;
}

.price {
  color: var(--lime);
  font-weight: 950;
}

.admin-list {
  display: grid;
  gap: 14px;
}

.pending-card {
  display: grid;
  gap: 12px;
}

.modal {
  width: min(980px, calc(100% - 28px));
  border: 1px solid var(--strong-line);
  border-radius: 8px;
  color: var(--text);
  background: #121620;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(8px);
}

.modal-shell {
  position: relative;
  margin: 0;
  padding: 28px;
}

.modal-shell h2 {
  text-align: center;
}

.modal-shell h2 span {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 16px;
  vertical-align: middle;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 22px;
  font-weight: 950;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin: 24px 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 850;
}

.full {
  grid-column: 1 / -1;
}

.detail-shell {
  max-height: min(82vh, 820px);
  overflow: auto;
}

.detail-hero {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(119, 87, 255, 0.18), rgba(52, 213, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.detail-hero .listing-icon {
  width: 96px;
  height: 96px;
}

.review-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.reviews {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.review {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: 420px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #151925;
  box-shadow: var(--shadow);
  font-weight: 850;
}

@media (max-width: 1240px) {
  .topbar {
    grid-template-columns: var(--sidebar-w) minmax(260px, 1fr) auto;
  }

  .featured-inner {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .featured-stats {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
  }

  .podium-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar-w: 224px;
  }

  .brand small {
    display: none;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 48px 66px minmax(0, 1fr);
  }

  .rank-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 74px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .brand {
    padding: 0 12px;
  }

  .brand strong {
    font-size: 20px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .top-search {
    display: none;
  }

  .top-actions {
    gap: 8px;
    padding-right: 12px;
  }

  .crystal-badge,
  .logout-link {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  main {
    width: calc(100vw - 44px);
    margin: 0 auto;
    padding: calc(var(--header-h) + 18px) 0 70px;
  }

  .mobile-nav {
    display: grid;
  }

  .featured-inner,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .featured-icon {
    width: 132px;
    height: 132px;
  }

  .podium-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .account-pill,
  .user-pill {
    max-width: 150px;
    padding: 0 9px;
  }

  .account-pill small,
  .user-pill small {
    max-width: 78px;
  }

  .hero-panel {
    padding: 20px;
  }

  .hero-panel h1 {
    font-size: 29px;
    line-height: 1.04;
  }

  .hero-actions,
  .featured-actions {
    width: 100%;
  }

  .hero-actions .primary,
  .hero-actions .secondary,
  .featured-actions .primary,
  .featured-actions .secondary {
    flex: 1 1 100%;
    width: 100%;
  }

  .featured-actions .stat-box {
    flex: 1 1 calc(50% - 6px);
  }

  .featured-copy h1 {
    font-size: 28px;
    line-height: 1.08;
  }

  .featured-inner {
    padding: 20px;
  }

  .featured-stats,
  .card-grid,
  .quest-grid,
  .tool-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .toolbar select {
    flex-basis: 100%;
  }

  .rank-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .rank-row .listing-icon {
    grid-column: 1;
  }

  .rank-row .rank-copy {
    grid-column: 2;
  }
}
