:root {
  color-scheme: dark;
  --bg: #080a10;
  --surface: #111520;
  --surface-2: #171c29;
  --surface-3: #202738;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f6f7fb;
  --muted: #9ba5ba;
  --accent: #78f2d0;
  --accent-2: #c8ff5a;
  --danger: #ff6f91;
  --warning: #ffd166;
  --info: #77b9ff;
  --good: #79eda8;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 20px;
  --radius-sm: 13px;
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(120, 242, 208, 0.11), transparent 32rem),
    radial-gradient(circle at 100% 40%, rgba(119, 185, 255, 0.09), transparent 28rem),
    var(--bg);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.08;
  letter-spacing: -0.025em;
}

p {
  line-height: 1.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.boot-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
}

.boot-logo {
  width: min(70vw, 300px);
}

.loader {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(86px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.88);
  backdrop-filter: blur(18px);
}

.brand-button {
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.brand-copy {
  min-width: 0;
  text-align: left;
}

.brand-copy strong {
  display: block;
  font-size: 0.92rem;
  white-space: nowrap;
}

.brand-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}

.resources {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.resources::-webkit-scrollbar,
.bottom-nav::-webkit-scrollbar {
  display: none;
}

.resource-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  white-space: nowrap;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.resource-pill .symbol {
  color: var(--accent);
  font-weight: 900;
}

.status-pill.god {
  border-color: rgba(255, 209, 102, 0.45);
  color: var(--warning);
}

.layout {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.side-nav {
  display: none;
}

.main-content {
  min-width: 0;
  padding: 16px 13px 28px;
}

.screen {
  display: grid;
  gap: 14px;
  animation: screen-in 0.22s ease-out;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(5px); }
}

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 2px;
}

.screen-header h1 {
  margin-bottom: 4px;
  font-size: clamp(1.55rem, 7vw, 2.25rem);
}

.screen-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25, 30, 44, 0.97), rgba(15, 18, 28, 0.97));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.card-pad {
  padding: 18px;
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 0.76rem;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.69rem;
  font-weight: 800;
  margin-bottom: 7px;
}

.hero-card {
  min-height: 315px;
  display: flex;
  align-items: flex-end;
  background-position: center;
  background-size: cover;
  isolation: isolate;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(6, 8, 13, 0.98) 5%, rgba(6, 8, 13, 0.64) 54%, rgba(6, 8, 13, 0.1)),
    linear-gradient(to right, rgba(6, 8, 13, 0.68), transparent 70%);
  z-index: -1;
}

.hero-content {
  width: 100%;
  padding: 22px;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  align-items: end;
}

.avatar {
  width: 78px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--surface-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.hero-copy h1 {
  font-size: clamp(1.65rem, 8vw, 2.6rem);
  margin: 0 0 3px;
}

.hero-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.86rem;
}

.hero-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 3px;
}

.mini-stat {
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(7, 10, 16, 0.62);
  text-align: center;
}

.mini-stat strong {
  display: block;
  font-size: 1rem;
}

.mini-stat span {
  color: var(--muted);
  font-size: 0.67rem;
}

.grid-2,
.grid-3,
.dashboard-grid {
  display: grid;
  gap: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack {
  display: grid;
  gap: 10px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 750;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, filter 0.14s ease;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--line-strong);
  filter: brightness(1.06);
}

.btn:active {
  transform: scale(0.975);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-primary {
  color: #07110f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(120, 242, 208, 0.16);
}

.btn-danger {
  color: white;
  background: rgba(255, 111, 145, 0.18);
  border-color: rgba(255, 111, 145, 0.35);
}

.btn-warning {
  color: #1b1502;
  background: var(--warning);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line);
}

.btn-block {
  width: 100%;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.075);
}

.progress > span {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.progress.hp > span {
  background: linear-gradient(90deg, #ff6f91, #ffac7b);
}

.progress.enemy > span {
  background: linear-gradient(90deg, #ff6f91, #c45cff);
}

.progress.energy > span {
  background: linear-gradient(90deg, #77b9ff, #78f2d0);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.quest-card {
  padding: 18px;
}

.quest-card .quest-index {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(120, 242, 208, 0.11);
  color: var(--accent);
  font-size: 0.71rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.reward-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.reward-chip,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #dbe2ef;
  font-size: 0.73rem;
}

.tag.accent {
  color: var(--accent);
  border-color: rgba(120, 242, 208, 0.25);
}

.tag.warning {
  color: var(--warning);
  border-color: rgba(255, 209, 102, 0.28);
}

.choice-list {
  display: grid;
  gap: 9px;
}

.choice-button {
  text-align: left;
  justify-content: flex-start;
  min-height: 58px;
  line-height: 1.35;
}

.district-list {
  display: grid;
  gap: 13px;
}

.district-card {
  min-height: 210px;
  padding: 18px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.district-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(6, 8, 13, 0.97), rgba(6, 8, 13, 0.2));
}

.district-card.locked {
  filter: saturate(0.35);
}

.district-card.locked::after {
  content: "ЗАКРЫТО";
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.75);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.district-copy h2 {
  margin-bottom: 6px;
}

.district-copy p {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
}

.battle-stage {
  display: grid;
  gap: 13px;
}

.fighter-card {
  padding: 16px;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: center;
}

.fighter-card.enemy-card {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 111, 145, 0.12), transparent 50%),
    linear-gradient(145deg, rgba(27, 22, 34, 0.98), rgba(14, 16, 25, 0.98));
}

.fighter-portrait {
  width: 92px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
}

.fighter-meta h2 {
  margin-bottom: 5px;
}

.fighter-meta p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.battle-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.action-btn {
  min-height: 58px;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
}

.action-btn small {
  color: currentColor;
  opacity: 0.7;
  font-weight: 600;
  font-size: 0.67rem;
}

.battle-log {
  max-height: 210px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding-right: 3px;
}

.log-entry {
  padding: 8px 10px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 0 8px 8px 0;
}

.inventory-grid,
.shop-grid,
.skill-grid,
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.item-card,
.skill-card,
.achievement-card {
  padding: 12px;
  min-width: 0;
}

.item-art {
  width: 100%;
  aspect-ratio: 1.15;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  margin-bottom: 10px;
}

.item-card h3,
.skill-card h3 {
  font-size: 0.9rem;
  min-height: 1.95em;
  margin-bottom: 5px;
}

.item-card p,
.skill-card p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  min-height: 2.7em;
  margin-bottom: 8px;
}

.item-card .btn,
.skill-card .btn {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.76rem;
}

.rarity-common { border-color: rgba(255, 255, 255, 0.1); }
.rarity-uncommon { border-color: rgba(121, 237, 168, 0.28); }
.rarity-rare { border-color: rgba(119, 185, 255, 0.35); }
.rarity-epic { border-color: rgba(196, 92, 255, 0.42); }
.rarity-legendary { border-color: rgba(255, 209, 102, 0.48); }

.equipment-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.slot {
  min-height: 92px;
  padding: 10px 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  text-align: center;
  display: grid;
  place-content: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.025);
}

.slot strong {
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.slot span {
  color: var(--muted);
  font-size: 0.65rem;
}

.skill-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  border-radius: 13px;
  margin-bottom: 9px;
  background: rgba(120, 242, 208, 0.11);
  color: var(--accent);
  font-weight: 900;
}

.skill-card.locked {
  opacity: 0.6;
}

.stats-list {
  display: grid;
  gap: 8px;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.stat-line:last-child {
  border-bottom: 0;
}

.stat-line span {
  color: var(--muted);
  font-size: 0.83rem;
}

.stat-line strong {
  font-variant-numeric: tabular-nums;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.field > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.input,
.select {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 7, 12, 0.7);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.input:focus,
.select:focus {
  border-color: rgba(120, 242, 208, 0.55);
  box-shadow: 0 0 0 3px rgba(120, 242, 208, 0.09);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.admin-grid {
  display: grid;
  gap: 12px;
}

.warning-box,
.info-box,
.success-box {
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid rgba(255, 209, 102, 0.28);
  background: rgba(255, 209, 102, 0.08);
  color: #ffe8aa;
  font-size: 0.78rem;
  line-height: 1.45;
}

.info-box {
  border-color: rgba(119, 185, 255, 0.28);
  background: rgba(119, 185, 255, 0.08);
  color: #cfe5ff;
}

.success-box {
  border-color: rgba(121, 237, 168, 0.28);
  background: rgba(121, 237, 168, 0.08);
  color: #c8fbd9;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 8px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.93);
  backdrop-filter: blur(20px);
  scrollbar-width: none;
}

.nav-button {
  flex: 1 0 48px;
  min-width: 48px;
  min-height: 54px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-content: center;
  gap: 3px;
  cursor: pointer;
}

.nav-button .nav-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.nav-button .nav-label {
  font-size: 0.62rem;
  font-weight: 750;
}

.nav-button.active {
  color: var(--accent);
  background: rgba(120, 242, 208, 0.08);
}

.nav-button.battle-active {
  color: var(--danger);
}

.onboarding {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(120, 242, 208, 0.15), transparent 35rem),
    url('/assets/districts/tower-zero.svg') center/cover fixed;
  isolation: isolate;
}

.onboarding::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(5, 7, 12, 0.87);
  backdrop-filter: blur(4px);
}

.onboarding-panel {
  width: min(100%, 860px);
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: rgba(11, 14, 22, 0.94);
  box-shadow: var(--shadow);
}

.owner-gate-panel {
  width: min(100%, 480px);
  text-align: center;
}

.owner-gate-panel .onboarding-logo {
  width: min(72%, 280px);
}

.owner-gate-panel h1 {
  margin: 8px 0 10px;
}

.owner-login-form {
  margin: 0 auto;
  text-align: left;
}

.owner-login-form .btn {
  margin-top: 4px;
}

.onboarding-logo {
  width: min(76%, 320px);
  margin: 0 auto 14px;
}

.onboarding-lead {
  max-width: 620px;
  margin: 0 auto 22px;
  text-align: center;
  color: var(--muted);
}

.selection-grid {
  display: grid;
  gap: 10px;
}

.selection-card {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.selection-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.selection-inner {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.selection-inner h3 {
  margin-bottom: 5px;
}

.selection-inner p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.selection-card input:checked + .selection-inner {
  border-color: rgba(120, 242, 208, 0.58);
  background: rgba(120, 242, 208, 0.075);
  transform: translateY(-2px);
}

.section-title {
  margin: 20px 0 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
}

.toast-root {
  position: fixed;
  z-index: 100;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  width: min(calc(100% - 28px), 480px);
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: rgba(18, 23, 34, 0.97);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  animation: toast-in 0.2s ease-out;
}

.toast.error {
  border-color: rgba(255, 111, 145, 0.45);
}

.toast.success {
  border-color: rgba(121, 237, 168, 0.45);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 14px;
  background: rgba(2, 3, 6, 0.72);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(100%, 560px);
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: modal-in 0.22s ease-out;
}

.modal-head,
.modal-body {
  padding: 16px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px); }
}

.ending-card {
  min-height: 430px;
  display: flex;
  align-items: flex-end;
  background: url('/assets/districts/tower-zero.svg') center/cover;
  isolation: isolate;
}

.ending-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(5, 7, 12, 0.98), rgba(5, 7, 12, 0.18));
}

.ending-copy {
  padding: 22px;
}

.ending-copy h1 {
  font-size: clamp(2rem, 10vw, 3.6rem);
}

.empty-state {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}

.offline-badge {
  position: fixed;
  z-index: 90;
  right: 12px;
  top: 78px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.9);
  color: #171100;
  font-size: 0.7rem;
  font-weight: 850;
}

@media (min-width: 620px) {
  .main-content {
    padding: 22px 20px 36px;
  }

  .grid-2,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-grid,
  .shop-grid,
  .skill-grid,
  .achievement-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .selection-grid.factions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-grid.classes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .battle-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .modal-backdrop {
    place-items: center;
  }
}

@media (min-width: 920px) {
  .app-shell {
    padding-bottom: 0;
  }

  .topbar {
    padding-left: 24px;
    padding-right: 24px;
  }

  .layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: calc(100vh - 68px);
  }

  .side-nav {
    display: grid;
    align-content: start;
    gap: 6px;
    position: sticky;
    top: 68px;
    height: calc(100vh - 68px);
    padding: 20px 12px;
    border-right: 1px solid var(--line);
    background: rgba(10, 12, 19, 0.66);
  }

  .side-nav .nav-button {
    min-height: 48px;
    grid-template-columns: 24px 1fr;
    justify-content: start;
    align-items: center;
    text-align: left;
    padding: 0 12px;
  }

  .side-nav .nav-label {
    font-size: 0.78rem;
  }

  .bottom-nav {
    display: none;
  }

  .main-content {
    padding: 26px 28px 52px;
  }

  .hero-card {
    min-height: 390px;
  }

  .hero-content {
    grid-template-columns: 96px minmax(0, 1fr) minmax(300px, 0.65fr);
  }

  .avatar {
    width: 96px;
  }

  .hero-stats {
    grid-column: auto;
    margin: 0;
  }

  .district-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-grid,
  .shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .battle-stage {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  }

  .battle-stage .battle-controls {
    grid-row: span 2;
  }

  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
