:root {
  color-scheme: dark;
  --bg: #0e1210;
  --surface: #151a17;
  --surface-2: #1c231f;
  --surface-3: #242c27;
  --text: #f4f2e9;
  --muted: #a9b0aa;
  --line: #343d37;
  --accent: #b7c95b;
  --accent-strong: #d4e875;
  --accent-ink: #11160f;
  --warm: #d7a851;
  --danger: #e16b5d;
  --sky: #55c9cf;
  --max: 1480px;
}

body.game-palworld {
  --bg: #0d1718;
  --surface: #132124;
  --surface-2: #1a2d30;
  --surface-3: #24383a;
  --line: #365055;
  --accent: #64d7d5;
  --accent-strong: #8ee8e0;
  --accent-ink: #0b1b1b;
  --warm: #f1bb57;
  --danger: #f0787d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

button {
  letter-spacing: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.topbar {
  min-height: 74px;
  padding: 12px max(20px, calc((100vw - var(--max)) / 2));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(13, 17, 15, 0.92);
  backdrop-filter: blur(16px);
}

.topbar > *,
.portal > * {
  min-width: 0;
}

.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent-strong);
  font-weight: 950;
}

.game-switch,
.filter-control,
.metric-tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--surface);
}

.game-tab,
.dashboard-tab,
.filter-button,
.metric-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.game-tab {
  min-width: 108px;
  min-height: 40px;
  padding: 0 18px;
  font-weight: 800;
}

.game-tab.is-active,
.filter-button.is-active,
.metric-button.is-active {
  color: var(--accent-ink);
  background: var(--accent);
}

.account-button,
.primary-button,
.secondary-button,
.portal-enter,
.action-button,
.buy-button {
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent-ink);
  background: var(--accent);
  cursor: pointer;
  font-weight: 850;
}

.account-button {
  justify-self: end;
  padding: 0 18px;
}

.account-button:hover,
.primary-button:hover,
.portal-enter:hover,
.action-button:hover,
.buy-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  color: var(--text);
  border-color: var(--line);
  background: transparent;
}

.secondary-button:hover {
  border-color: var(--accent);
}

.portal {
  min-height: calc(100svh - 138px);
  padding: clamp(36px, 7vh, 82px) clamp(20px, 5vw, 76px) 28px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-image: url("/assets/nme-worlds-hero.png");
  background-position: center;
  background-size: cover;
}

.portal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(5, 9, 7, 0.28);
}

.portal-copy {
  max-width: 760px;
  margin: 0 auto;
  align-self: start;
  text-align: center;
  text-shadow: 0 2px 24px #000;
}

.portal-copy h1 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(68px, 11vw, 166px);
  line-height: 0.82;
  letter-spacing: 0;
}

.portal-copy p:last-child {
  max-width: 590px;
  margin: 24px auto 0;
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.55;
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.world-actions {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 28vw, 560px);
  align-items: end;
}

.world-button {
  min-width: 0;
  min-height: 82px;
  padding: 12px 18px;
  display: grid;
  align-content: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 4px;
  color: #fff;
  background: rgba(10, 14, 12, 0.72);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  white-space: normal;
  backdrop-filter: blur(8px);
}

.world-button span {
  font-size: 26px;
  font-weight: 900;
}

.world-button small {
  color: #d8ded9;
}

.world-server-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-online {
  margin-top: 6px;
  color: var(--accent-strong);
  font-size: 13px;
}

.world-button.is-active {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.world-palworld {
  text-align: right;
}

.portal-enter {
  width: min(330px, 100%);
  max-width: 100%;
  margin: 24px auto 0;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 16px;
}

.steam-glyph {
  width: 18px;
  height: 18px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.steam-glyph::after {
  content: "";
  width: 8px;
  height: 2px;
  position: absolute;
  left: -7px;
  top: 9px;
  background: currentColor;
  transform: rotate(28deg);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 12px;
  color: #fff;
  text-decoration: none;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 8px #000;
}

.portal-details {
  min-height: 134px;
  padding: 24px max(20px, calc((100vw - var(--max)) / 2));
  display: grid;
  grid-template-columns: 1fr minmax(280px, 0.85fr) auto;
  gap: 36px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.portal-details h2,
.section-heading h2,
.leader-heading h2,
.feature-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.portal-details p:not(.kicker) {
  color: var(--muted);
  line-height: 1.55;
}

.primary-button {
  padding: 0 20px;
}

a.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.dashboard {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.is-hidden {
  display: none !important;
}

.profile-band {
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 30px;
  font-weight: 900;
}

.identity h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(25px, 4vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
}

.steam-name,
.profile-note {
  margin: 7px 0 0;
  color: var(--muted);
}

.verified {
  margin-left: 8px;
  padding: 2px 5px;
  color: #bce6ff;
  border: 1px solid #3e7191;
  font-size: 9px;
  font-weight: 900;
}

.balances {
  display: flex;
  gap: 10px;
}

.balances > div {
  min-width: 144px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
}

.balances > div > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.balances strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.balances strong span {
  display: inline;
}

.dashboard-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.dashboard-tab {
  min-width: 120px;
  min-height: 52px;
  padding: 0 18px;
  white-space: nowrap;
  font-weight: 800;
}

.dashboard-tab.is-active {
  color: var(--text);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.dashboard-layout {
  padding-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-heading,
.leader-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.status-pill,
.balance-inline,
.season {
  padding: 6px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-height: 126px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.stat-card .sprite-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  color: var(--accent-strong);
  font-size: clamp(22px, 3vw, 34px);
  overflow-wrap: anywhere;
}

.overview-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
}

.feature-panel,
.leaderboard,
.account-panel,
.faction-hero,
.compact-monitor {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feature-panel p:not(.kicker),
.faction-hero p:not(.kicker) {
  color: var(--muted);
  line-height: 1.55;
}

.mission-progress {
  height: 7px;
  margin: 18px 0 8px;
  overflow: hidden;
  background: var(--surface-3);
}

.mission-progress span {
  height: 100%;
  display: block;
  background: var(--accent);
}

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

.product-button {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
}

.product-button b,
.product-button span {
  display: block;
}

.product-button span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.product-button:hover {
  border-color: var(--accent);
}

.faction-hero {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  border-left: 4px solid var(--accent);
}

.rank-mark,
.bounty-value {
  min-width: 112px;
  text-align: center;
  color: var(--accent-strong);
  font-size: 42px;
  font-weight: 950;
}

.content-grid,
.shop-grid,
.achievement-grid,
.mission-grid,
.weapon-grid {
  display: grid;
  gap: 12px;
}

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

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

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

.item-card,
.mission-card,
.achievement-card,
.weapon-card {
  min-height: 188px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.item-card:hover,
.weapon-card:hover,
.mission-card:hover {
  border-color: #657268;
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  border-radius: 8px;
  background: var(--accent);
  font-size: 21px;
  font-weight: 950;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.item-card h3,
.mission-card h3,
.achievement-card h3,
.weapon-card h3 {
  margin: 11px 0 7px;
  letter-spacing: 0;
}

.item-card p,
.mission-card p,
.achievement-card p,
.weapon-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.weapon-card code,
.good-card code,
.dialog-weapon-head code {
  display: block;
  margin-bottom: 10px;
  overflow: hidden;
  color: #8fa29a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-button,
.buy-button,
.secondary-button {
  margin-top: auto;
  padding: 0 14px;
}

.action-button:disabled,
.buy-button:disabled,
.product-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.locked-card {
  opacity: 0.68;
}

.achievement-card.is-done {
  border-color: #657831;
}

.achievement-progress {
  margin-top: auto;
}

.achievement-progress span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.achievement-progress div {
  height: 6px;
  background: var(--surface-3);
}

.achievement-progress i {
  height: 100%;
  display: block;
  background: var(--accent);
}

.side-column {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 98px;
}

.metric-tabs {
  width: 100%;
  overflow: hidden;
}

.metric-button {
  min-height: 36px;
  flex: 1;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.leader-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.leader-row:last-child {
  border-bottom: 0;
}

.leader-position {
  color: var(--muted);
  font-weight: 900;
}

.leader-row:nth-child(1) .leader-position {
  color: var(--warm);
}

.leader-player {
  min-width: 0;
}

.leader-player strong,
.leader-player span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-player span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.leader-value {
  color: var(--accent-strong);
  font-weight: 900;
}

.account-panel {
  display: grid;
  gap: 14px;
}

.account-panel div span,
.account-panel code {
  display: block;
}

.account-panel div span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.account-panel code {
  overflow: hidden;
  text-overflow: ellipsis;
}

.wanted-sheet {
  max-width: 560px;
  padding: 28px;
  color: #272016;
  border: 1px solid #8a7040;
  border-radius: 4px;
  background: #d8c18c;
  text-align: center;
}

.wanted-sheet span {
  font-size: 13px;
  font-weight: 900;
}

.wanted-sheet h2 {
  margin: 8px 0;
  color: #35291a;
  font-family: Georgia, serif;
  font-size: clamp(42px, 7vw, 72px);
  letter-spacing: 0;
}

.wanted-sheet strong {
  display: block;
  font-size: 34px;
}

.toast {
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #202823;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: var(--danger);
}

.footer {
  min-height: 88px;
  padding: 22px max(20px, calc((100vw - var(--max)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #0b0e0c;
}

.footer div {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer a {
  color: var(--text);
}

.sprite-icon {
  width: 58px;
  height: 58px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 8px;
  background-image: url("/assets/ui-icons-atlas.png");
  background-repeat: no-repeat;
  background-size: 400% 400%;
}

.icon-profile { background-position: 0 0; }
.icon-infected { background-position: 33.333% 0; }
.icon-clock { background-position: 66.667% 0; }
.icon-mission { background-position: 100% 0; }
.icon-money { background-position: 0 33.333%; }
.icon-crystal { background-position: 33.333% 33.333%; }
.icon-license { background-position: 66.667% 33.333%; }
.icon-rank { background-position: 100% 33.333%; }
.icon-weapon { background-position: 0 66.667%; }
.icon-ammo { background-position: 33.333% 66.667%; }
.icon-magazine { background-position: 66.667% 66.667%; }
.icon-attachment { background-position: 100% 66.667%; }
.icon-server { background-position: 0 100%; }
.icon-achievement { background-position: 33.333% 100%; }
.icon-identity { background-position: 66.667% 100%; }
.icon-compass { background-position: 100% 100%; }

.empty-state {
  color: var(--muted);
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 20px;
}

.icon-button:hover {
  border-color: var(--accent);
}

.compact-monitor .leader-heading {
  align-items: center;
}

.compact-server {
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.compact-server:last-child {
  border-bottom: 0;
}

.compact-server .sprite-icon {
  width: 40px;
  height: 40px;
  opacity: 0.58;
}

.compact-server.is-online .sprite-icon {
  opacity: 1;
}

.compact-server strong,
.compact-server span {
  display: block;
}

.compact-server span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.compact-server a {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.feature-panel > .sprite-icon,
.faction-hero .sprite-icon {
  float: left;
  width: 52px;
  height: 52px;
  margin: 0 14px 8px 0;
}

.guild-section,
.license-section,
.armory-section {
  margin-top: 28px;
}

.license-panel {
  padding: 20px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid #6f703f;
  border-left: 4px solid var(--warm);
  border-radius: 8px;
  background: var(--surface-2);
}

.license-panel .sprite-icon {
  width: 64px;
  height: 64px;
}

.license-copy h2,
.license-copy p {
  margin-top: 0;
}

.license-copy p {
  color: var(--muted);
}

.license-progress {
  height: 7px;
  overflow: hidden;
  background: var(--surface-3);
}

.license-progress span {
  height: 100%;
  display: block;
  background: var(--warm);
}

.license-buy {
  min-width: 190px;
  display: grid;
  gap: 8px;
  text-align: right;
}

.license-buy strong {
  color: var(--warm);
  font-size: 24px;
}

.catalog-tools {
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
}

.search-control span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.search-control input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: var(--surface-2);
}

.search-control input:focus {
  border-color: var(--accent);
  outline: 0;
}

.rank-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.rank-filter {
  min-height: 38px;
  padding: 0 12px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.rank-filter.is-active {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
}

.catalog-grid .weapon-card {
  min-width: 0;
}

.weapon-card .sprite-icon,
.item-card .sprite-icon,
.achievement-card .sprite-icon,
.mission-card .sprite-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
}

.weapon-card .secondary-button {
  margin-bottom: 8px;
}

.button-hint {
  display: block;
  margin-top: 7px;
  color: #c9a7a2;
  font-size: 10px;
  line-height: 1.35;
}

.catalog-pagination {
  margin-top: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.catalog-pagination .secondary-button {
  min-width: 120px;
}

.weapon-dialog {
  width: min(920px, calc(100% - 32px));
  max-height: min(86vh, 900px);
  padding: 24px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #111714;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.65);
}

.weapon-dialog::backdrop {
  background: rgba(3, 6, 4, 0.78);
  backdrop-filter: blur(4px);
}

.dialog-close {
  width: 40px;
  height: 40px;
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 25px;
}

.dialog-weapon-head {
  padding-right: 52px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.dialog-weapon-head .sprite-icon {
  width: 74px;
  height: 74px;
}

.dialog-weapon-head h2 {
  margin: 0 0 5px;
  font-size: 32px;
}

.dialog-weapon-head > strong {
  color: var(--accent-strong);
  font-size: 25px;
}

.dialog-note {
  margin: 18px 0;
  color: var(--muted);
  line-height: 1.55;
}

.dialog-actions {
  max-width: 280px;
  margin-bottom: 28px;
}

.dialog-actions .buy-button {
  width: 100%;
}

.goods-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.good-card {
  min-height: 92px;
  padding: 12px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.good-card .sprite-icon {
  width: 50px;
  height: 50px;
}

.good-card strong,
.good-card span {
  display: block;
}

.good-card span {
  color: var(--accent-strong);
  font-weight: 900;
}

.good-card .buy-button {
  min-width: 92px;
}

@media (max-width: 1120px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    position: static;
  }

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

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

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .game-switch {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .game-tab {
    flex: 1;
  }

  .account-button {
    width: 168px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .portal {
    min-height: calc(100svh - 132px);
    background-position: center;
  }

  .world-actions {
    gap: 12px;
  }

  .portal-details,
  .overview-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .profile-band {
    align-items: stretch;
    flex-direction: column;
  }

  .balances {
    width: 100%;
  }

  .balances > div {
    min-width: 0;
    flex: 1;
  }

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

@media (max-width: 560px) {
  .topbar {
    padding: 10px 14px;
  }

  .brand span:last-child {
    display: none;
  }

  .portal {
    padding: 32px 14px 28px;
  }

  .portal-copy h1 {
    font-size: 64px;
  }

  .portal-copy p:last-child {
    font-size: 15px;
  }

  .world-button {
    min-height: 70px;
    padding: 10px;
  }

  .portal-copy p {
    overflow-wrap: anywhere;
  }

  .world-button span {
    font-size: 19px;
  }

  .world-button small {
    font-size: 10px;
  }

  .portal-enter {
    margin-top: 14px;
  }

  .dashboard {
    width: min(100% - 28px, var(--max));
    padding-top: 20px;
  }

  .identity {
    align-items: flex-start;
  }

  .avatar {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }

  .balances {
    flex-direction: column;
  }

  .section-heading,
  .leader-heading,
  .faction-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading,
  .leader-heading {
    display: grid;
  }

  .faction-hero {
    display: flex;
  }

  .stats-grid,
  .shop-grid,
  .weapon-grid,
  .mission-grid,
  .product-row {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 100px;
  }

  .filter-control,
  .metric-tabs {
    width: 100%;
  }

  .filter-button,
  .metric-button {
    min-width: 0;
    flex: 1;
    padding: 8px 5px;
  }

  .dashboard-tab {
    min-width: 0;
    flex: 1;
    padding: 0 7px;
    font-size: 12px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer div {
    display: grid;
    gap: 9px;
  }
}

@media (max-width: 820px) {
  .goods-grid {
    grid-template-columns: 1fr;
  }

  .license-panel {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .license-buy {
    grid-column: 1 / -1;
    text-align: left;
  }
}

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

  .license-buy {
    min-width: 0;
  }

  .catalog-pagination {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-pagination span {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .dialog-weapon-head {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .dialog-weapon-head .sprite-icon {
    width: 58px;
    height: 58px;
  }

  .dialog-weapon-head > strong {
    grid-column: 1 / -1;
  }

  .good-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .good-card .buy-button,
  .good-card .button-hint {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .toast {
    transition: none;
  }
}
