@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-latin-500-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-latin-600-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-latin-700-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --font-body: "Inter", system-ui, sans-serif;
  --font-display: "Sora", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --bg: #09090a;
  --bg-deep: #050506;
  --surface: #111113;
  --surface-2: #171719;
  --surface-3: #1d1d20;
  --border: #29292d;
  --border-strong: #3a393f;
  --text: #f7f4ee;
  --text-soft: #b7b3ac;
  --muted: #7f7d78;
  --accent: #f6a817;
  --accent-bright: #ffc24d;
  --accent-ink: #171003;
  --accent-soft: rgba(246, 168, 23, 0.12);
  --accent-line: rgba(246, 168, 23, 0.34);
  --secondary: #ff6a32;
  --positive: #3bd59c;
  --positive-soft: rgba(59, 213, 156, 0.12);
  --negative: #ff6b6b;
  --negative-soft: rgba(255, 107, 107, 0.12);
  --info: #65a7ff;
  --focus: rgba(246, 168, 23, 0.36);
  --shadow: 0 18px 64px rgba(0, 0, 0, 0.38);
  --topbar: 64px;
  --sidebar: 72px;
  --radius: 8px;
}

html[data-theme="snow"] {
  --bg: #080b0e;
  --bg-deep: #040608;
  --surface: #10151a;
  --surface-2: #171e24;
  --surface-3: #1d272e;
  --border: #2b3740;
  --border-strong: #435561;
  --text: #f4fbff;
  --text-soft: #b8c8d1;
  --muted: #7f949f;
  --accent: #b9e9ff;
  --accent-bright: #e5f8ff;
  --accent-ink: #071218;
  --accent-soft: rgba(185, 233, 255, 0.11);
  --accent-line: rgba(185, 233, 255, 0.32);
  --secondary: #74c7ec;
  --focus: rgba(185, 233, 255, 0.32);
}

html[data-theme="matrix"] {
  --bg: #050906;
  --bg-deep: #020503;
  --surface: #0b110c;
  --surface-2: #111912;
  --surface-3: #172219;
  --border: #213a27;
  --border-strong: #356443;
  --text: #e9ffed;
  --text-soft: #a8c8ae;
  --muted: #688a70;
  --accent: #54e17f;
  --accent-bright: #8cffaa;
  --accent-ink: #031407;
  --accent-soft: rgba(84, 225, 127, 0.1);
  --accent-line: rgba(84, 225, 127, 0.32);
  --secondary: #e4cb55;
  --focus: rgba(84, 225, 127, 0.32);
}

html[data-theme="dot-link"] {
  --bg: #080a0e;
  --bg-deep: #040507;
  --surface: #10131a;
  --surface-2: #171c25;
  --surface-3: #1d2430;
  --border: #2a3342;
  --border-strong: #3d506a;
  --text: #f5f8ff;
  --text-soft: #b5c0d4;
  --muted: #77859e;
  --accent: #72a8ff;
  --accent-bright: #9bc2ff;
  --accent-ink: #06101f;
  --accent-soft: rgba(114, 168, 255, 0.11);
  --accent-line: rgba(114, 168, 255, 0.34);
  --secondary: #ff9d57;
  --focus: rgba(114, 168, 255, 0.32);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
  scrollbar-color: var(--border-strong) var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

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

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button,
input,
select,
textarea,
a {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  box-shadow: 0 0 0 3px var(--focus);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3,
.brand,
.brand-lockup strong,
.metric-value,
.item-quantity {
  font-family: var(--font-display);
}

h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.16;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.28;
}

h3 {
  font-size: 14px;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.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;
}

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

.mono,
.metric-meta,
.metric-value,
.numeric,
.item-quantity,
.item-detail-quantity,
.page-label {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.cursor-effects {
  position: fixed;
  z-index: 80;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 320px;
  height: var(--topbar);
  padding: 0 18px 0 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 10, 0.94);
  backdrop-filter: blur(18px);
}

html[data-theme="snow"] .topbar,
html[data-theme="matrix"] .topbar,
html[data-theme="dot-link"] .topbar {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.fox-frame {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--accent-line);
  border-radius: 7px;
  background: #f8ecd8;
}

.fox-frame img {
  width: 136%;
  max-width: none;
  height: 136%;
  object-fit: cover;
  object-position: 50% 48%;
}

.brand-logo {
  width: 38px;
  height: 38px;
}

.topbar-actions,
.page-actions,
.filters,
.bulk-toolbar,
.dialog-actions {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 10px;
}

.status-badge,
.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  white-space: nowrap;
}

.status-badge {
  min-height: 30px;
  padding: 4px 10px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
}

.status-dot,
.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.status-badge.online .status-dot,
.state-pill.online .state-dot {
  background: var(--positive);
  box-shadow: 0 0 10px rgba(59, 213, 156, 0.54);
}

.status-badge.connecting .status-dot {
  background: var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
}

.status-badge.offline .status-dot,
.state-pill.offline .state-dot {
  background: var(--negative);
}

.theme-control,
.profile-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.theme-control {
  gap: 6px;
  padding-left: 9px;
}

.theme-control svg {
  width: 15px;
  color: var(--accent);
}

.theme-control select {
  min-width: 88px;
  height: 32px;
  padding: 0 28px 0 2px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
}

.profile-chip {
  gap: 8px;
  padding: 3px 10px 3px 4px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-family: var(--font-display);
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--sidebar);
  padding: 16px 0;
  border-right: 1px solid var(--border);
  background: var(--bg-deep);
}

.game-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.game-nav {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.game-nav::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 140ms ease, transform 140ms ease;
}

.game-nav img {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  filter: saturate(0.72) brightness(0.8);
  transition: filter 140ms ease;
}

.game-nav:hover,
.game-nav.active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.game-nav:hover img,
.game-nav.active img {
  filter: saturate(1) brightness(1);
}

.game-nav.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.game-nav::after {
  position: absolute;
  z-index: 2;
  left: 55px;
  top: 50%;
  width: max-content;
  max-width: 220px;
  padding: 6px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-3);
  box-shadow: var(--shadow);
  color: var(--text);
  content: attr(aria-label);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity 120ms ease, transform 120ms ease;
}

.game-nav:hover::after,
.game-nav:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.sidebar-lock {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: auto;
  color: var(--muted);
}

.sidebar-lock svg {
  width: 16px;
}

.workspace {
  width: calc(100% - var(--sidebar));
  min-width: 0;
  margin-left: var(--sidebar);
  padding: calc(var(--topbar) + 32px) clamp(22px, 3vw, 48px) 64px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: 1680px;
  margin: 0 auto 24px;
}

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

.game-cover {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.34);
}

.eyebrow,
.section-kicker,
.kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.eyebrow,
.section-kicker {
  margin-bottom: 5px;
}

.eyebrow svg,
.section-kicker svg,
.kicker svg {
  width: 14px;
  height: 14px;
}

.page-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  gap: 8px;
  flex: 0 0 auto;
}

.updating {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 4px;
  color: var(--muted);
  font-size: 12px;
}

.updating svg {
  width: 14px;
  animation: spin 900ms linear infinite;
}

.button,
.icon-button,
.text-button,
.sort-button,
.account-link,
.row-action {
  border: 0;
  background: transparent;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button svg,
.icon-button svg,
.row-action svg {
  width: 16px;
  height: 16px;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button.primary:hover:not(:disabled) {
  border-color: var(--accent-bright);
  background: var(--accent-bright);
}

.button.secondary {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
}

.button.secondary:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-3);
  color: var(--text);
}

.button.danger {
  border-color: rgba(255, 107, 107, 0.32);
  background: var(--negative-soft);
  color: #ff9b9b;
}

.button.danger:hover:not(:disabled) {
  border-color: var(--negative);
  background: rgba(255, 107, 107, 0.18);
}

.button.compact {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 7px;
  color: var(--muted);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.icon-button:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.icon-button.bordered {
  border: 1px solid var(--border);
  background: var(--surface);
}

.text-button {
  padding: 4px 0;
  color: var(--accent);
  font-weight: 600;
}

.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1680px;
  margin: 0 auto 20px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 107, 0.34);
  border-radius: 7px;
  background: var(--negative-soft);
  color: #ffb2b2;
}

.error-copy {
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-copy svg {
  width: 16px;
  flex: 0 0 auto;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 1680px;
  margin: 0 auto 38px;
}

.metric {
  min-width: 0;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 140ms ease, background 140ms ease;
}

.metric:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.metric-label {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.metric-icon svg {
  width: 14px;
  height: 14px;
}

.metric-value {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.accounts-section,
.items-section,
.utility-section {
  max-width: 1680px;
  margin: 0 auto;
}

.accounts-section,
.items-section {
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.items-section,
.utility-section {
  margin-top: 44px;
}

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

.section-heading h2 + .muted {
  margin-top: 4px;
  font-size: 12px;
}

.filters {
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.filters label {
  min-width: 0;
}

.search-field,
.field-control {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field svg,
.field-control > svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  transition: border-color 140ms ease, background 140ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

input,
select {
  height: 38px;
}

input {
  min-width: 0;
  padding: 0 11px;
}

select {
  padding: 0 32px 0 10px;
}

textarea {
  min-height: 94px;
  padding: 10px 11px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #64636a;
}

.search-field input {
  width: min(300px, 28vw);
  padding-left: 35px;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.bulk-toolbar {
  position: sticky;
  z-index: 15;
  top: calc(var(--topbar) + 8px);
  min-height: 44px;
  gap: 8px;
  margin-bottom: 10px;
  padding: 5px 7px 5px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
}

.bulk-toolbar > strong {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 12px;
}

.bulk-spacer {
  flex: 1;
}

.table-shell {
  position: relative;
  overflow-x: auto;
  min-height: 232px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-deep);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  height: 50px;
  padding: 0 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 42px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

tbody tr {
  transition: background 100ms ease;
}

tbody tr:hover {
  background: var(--surface);
}

tbody tr.selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 var(--accent);
}

tbody tr:last-child td {
  border-bottom: 0;
}

th.numeric,
td.numeric {
  text-align: right;
}

.select-column {
  width: 44px;
  min-width: 44px;
  padding-right: 8px;
  padding-left: 14px;
  text-align: center;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-height: 32px;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

th.numeric .sort-button {
  width: 100%;
  justify-content: flex-end;
}

.sort-button svg {
  width: 13px;
  height: 13px;
  opacity: 0.54;
}

.sort-button.active {
  color: var(--accent-bright);
}

.sort-button.active svg {
  opacity: 1;
}

.account-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 172px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
}

.account-link {
  max-width: 200px;
  padding: 4px 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-link:hover {
  color: var(--accent-bright);
}

.state-pill {
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 600;
}

.state-pill.online {
  border-color: rgba(59, 213, 156, 0.24);
  background: var(--positive-soft);
  color: #8ceac7;
}

.state-pill.offline {
  border-color: rgba(255, 107, 107, 0.2);
  background: var(--negative-soft);
  color: #ffaaa5;
}

.row-action {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--muted);
}

.row-action:hover {
  background: var(--surface-2);
  color: var(--text);
}

.table-state {
  position: absolute;
  inset: 42px 0 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--bg-deep);
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
}

.pagination > span {
  margin-right: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.item-grid {
  min-height: 150px;
}

.item-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.item-group + .item-group {
  margin-top: 26px;
}

.item-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.item-group-heading .muted {
  font-family: var(--font-mono);
  font-size: 10px;
}

.item-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.item-card:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.item-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-deep);
}

.item-art img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.item-art svg {
  width: 20px;
  color: var(--muted);
}

.item-art.large {
  width: 112px;
  height: 112px;
}

.item-art.large img {
  width: 96px;
  height: 96px;
}

.item-copy {
  min-width: 0;
}

.item-name {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 5px;
}

.rarity,
.item-category {
  display: inline-block;
  max-width: 110px;
  padding: 2px 5px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rarity-godly,
.rarity-mythic,
.rarity-secret {
  border-color: rgba(255, 76, 91, 0.3);
  background: rgba(255, 76, 91, 0.1);
  color: #ff9098;
}

.rarity-ancient,
.rarity-unique,
.rarity-super {
  border-color: rgba(246, 168, 23, 0.34);
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.rarity-legendary,
.rarity-epic {
  border-color: rgba(188, 120, 255, 0.3);
  background: rgba(188, 120, 255, 0.1);
  color: #d8aeff;
}

.rarity-rare,
.rarity-vintage,
.rarity-classic {
  border-color: rgba(101, 167, 255, 0.3);
  background: rgba(101, 167, 255, 0.1);
  color: #9bc5ff;
}

.rarity-uncommon {
  border-color: rgba(59, 213, 156, 0.28);
  background: var(--positive-soft);
  color: #88e8c5;
}

.item-quantity {
  color: var(--accent-bright);
  font-size: 12px;
}

.show-more {
  width: 100%;
  margin-top: 12px;
}

.empty-inline {
  padding: 34px 12px;
  color: var(--muted);
  text-align: center;
}

.utility-section {
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.utility-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.utility-block {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.mail-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.mail-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  flex: 1;
}

.utility-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.status-list {
  border-top: 1px solid var(--border);
}

.status-row {
  display: grid;
  grid-template-columns: 86px minmax(120px, 1fr) 2fr auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  border-top: 1px solid var(--border);
}

.class-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding-right: 18px;
  border-bottom: 1px solid var(--border);
}

.auth-gate {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 18px;
  overflow: hidden;
  background: #070708;
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid #2b2927;
  border-radius: 8px;
  background: rgba(15, 15, 16, 0.96);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.56);
}

.auth-panel::before {
  position: absolute;
  top: -1px;
  right: 56px;
  left: 56px;
  height: 1px;
  background: var(--accent);
  content: "";
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.auth-logo {
  width: 44px;
  height: 44px;
}

.brand-lockup {
  display: grid;
  gap: 1px;
}

.brand-lockup strong {
  font-size: 15px;
}

.brand-lockup span {
  color: var(--muted);
  font-size: 10px;
}

.auth-copy {
  margin: 38px 0 24px;
}

.auth-copy h1 {
  margin-top: 9px;
  font-size: 27px;
}

.auth-copy .muted {
  margin-top: 7px;
}

.auth-form,
.auth-field {
  display: grid;
}

.auth-form {
  gap: 15px;
}

.auth-field {
  gap: 7px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.field-control input {
  width: 100%;
  height: 46px;
  padding-right: 42px;
  padding-left: 38px;
  background: #0b0b0d;
}

.field-icon-button {
  position: absolute;
  right: 5px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.field-icon-button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.field-icon-button svg {
  width: 16px;
}

.login-submit {
  min-height: 46px;
  margin-top: 5px;
}

.auth-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.auth-foot svg {
  width: 15px;
  flex: 0 0 auto;
  color: var(--accent);
}

dialog {
  width: min(calc(100% - 28px), 880px);
  max-height: min(86vh, 840px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(5px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.dialog-header h2 {
  overflow-wrap: anywhere;
}

.detail-body,
.item-dialog-body {
  max-height: calc(86vh - 140px);
  padding: 18px;
  overflow-y: auto;
}

.dialog-actions {
  justify-content: flex-end;
  gap: 8px;
  min-height: 62px;
  padding: 11px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.dialog-actions .danger:first-child {
  margin-right: auto;
}

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

.detail-stat {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-deep);
}

.detail-stat span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-stat strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-inventory {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.detail-inventory h3 {
  margin-bottom: 10px;
}

.detail-item-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.item-detail-hero {
  display: flex;
  align-items: center;
  gap: 20px;
}

.item-detail-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.item-detail-quantity {
  color: var(--accent-bright);
  font-size: 18px;
}

.item-metadata {
  display: grid;
  grid-template-columns: minmax(110px, 0.6fr) 1.4fr;
  margin: 22px 0 0;
  border-top: 1px solid var(--border);
}

.item-metadata dt,
.item-metadata dd {
  min-width: 0;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.item-metadata dt {
  color: var(--muted);
  font-size: 11px;
}

.item-metadata dd {
  color: var(--text-soft);
  font-size: 11px;
}

.confirm-dialog {
  width: min(calc(100% - 28px), 430px);
  padding: 22px;
  overflow: visible;
}

.confirm-dialog .dialog-actions {
  min-height: 0;
  margin-top: 22px;
  padding: 16px 0 0;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 107, 107, 0.32);
  border-radius: 7px;
  background: var(--negative-soft);
  color: var(--negative);
}

.confirm-icon svg {
  width: 19px;
}

.confirm-dialog .muted {
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(calc(100% - 36px), 360px);
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-3);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  animation: toast-in 180ms ease-out;
}

.toast svg {
  width: 16px;
  flex: 0 0 auto;
  color: var(--positive);
}

.toast.danger svg {
  color: var(--negative);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  50% { opacity: 0.4; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .filters {
    width: 100%;
    justify-content: flex-start;
  }

  .search-field {
    flex: 1;
  }

  .search-field input {
    width: 100%;
  }

  .mail-form {
    align-items: stretch;
    flex-direction: column;
  }

  .mail-form .button {
    align-self: flex-end;
  }
}

@media (max-width: 800px) {
  :root {
    --topbar: 58px;
  }

  .topbar {
    padding: 0 10px;
  }

  .brand > strong,
  .profile-chip,
  .connectionLabel {
    display: none;
  }

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

  .status-badge {
    width: 31px;
    min-height: 31px;
    justify-content: center;
    padding: 0;
  }

  .status-badge > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .theme-control select {
    min-width: 72px;
    width: 72px;
  }

  .sidebar {
    z-index: 45;
    top: auto;
    right: 0;
    bottom: 0;
    width: auto;
    height: 66px;
    padding: 7px 10px;
    border-top: 1px solid var(--border);
    border-right: 0;
    background: color-mix(in srgb, var(--bg-deep) 95%, transparent);
    backdrop-filter: blur(18px);
  }

  .game-list {
    flex: 1;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
  }

  .game-nav {
    width: 48px;
    height: 48px;
  }

  .game-nav::before {
    top: auto;
    right: 9px;
    bottom: -8px;
    left: 9px;
    width: auto;
    height: 3px;
    transform: scaleX(0.4);
  }

  .game-nav.active::before {
    transform: scaleX(1);
  }

  .game-nav::after,
  .sidebar-lock {
    display: none;
  }

  .workspace {
    width: 100%;
    margin-left: 0;
    padding: calc(var(--topbar) + 22px) 14px 94px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .button {
    flex: 1;
  }

  .updating {
    display: none;
  }

  .game-cover {
    width: 52px;
    height: 52px;
  }

  h1 {
    font-size: 23px;
  }

  .metric-grid {
    margin-bottom: 32px;
  }

  .metric {
    min-height: 102px;
    padding: 13px;
  }

  .metric-value {
    font-size: 20px;
  }

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

  .search-field {
    grid-column: 1 / -1;
  }

  .filters select,
  .filters label {
    width: 100%;
  }

  .bulk-toolbar {
    top: calc(var(--topbar) + 6px);
    flex-wrap: wrap;
  }

  .bulk-spacer {
    min-width: 20px;
  }

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

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

  .item-art {
    width: 42px;
    height: 42px;
  }

  .item-art img {
    width: 36px;
    height: 36px;
  }

  .item-quantity {
    grid-column: 2;
    font-size: 10px;
  }

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

  .status-row {
    grid-template-columns: 78px minmax(0, 1fr) auto;
    padding: 8px 0;
  }

  .status-row .muted {
    grid-column: 2 / -1;
  }

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

@media (max-width: 520px) {
  .topbar-actions {
    gap: 5px;
  }

  .theme-control {
    padding-left: 6px;
  }

  .theme-control select {
    min-width: 90px;
    width: 90px;
    padding-right: 18px;
    font-size: 11px;
  }

  .workspace {
    padding-right: 10px;
    padding-left: 10px;
  }

  .page-subtitle {
    display: none;
  }

  .metric-grid {
    gap: 7px;
  }

  .metric {
    min-height: 94px;
    padding: 11px;
  }

  .metric-head {
    margin-bottom: 8px;
  }

  .metric-label {
    font-size: 10px;
  }

  .metric-icon {
    width: 25px;
    height: 25px;
  }

  .metric-value {
    font-size: 17px;
  }

  .button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bulk-toolbar > strong {
    width: 100%;
  }

  .bulk-toolbar .bulk-spacer {
    display: none;
  }

  .bulk-toolbar .button {
    flex: 1;
  }

  .item-card-grid {
    grid-template-columns: 1fr;
  }

  .item-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
  }

  .item-quantity {
    grid-column: auto;
    font-size: 11px;
  }

  .mail-fields {
    grid-template-columns: 1fr;
  }

  .mail-form .button {
    width: 100%;
  }

  .item-detail-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-body,
  .item-dialog-body {
    padding: 14px;
  }

  .dialog-actions {
    padding-right: 14px;
    padding-left: 14px;
  }

  .dialog-actions .button {
    min-width: 0;
  }

  .confirm-dialog {
    padding: 18px;
  }

  .auth-panel {
    padding: 22px;
  }

  .toast-region {
    right: 10px;
    bottom: 76px;
    width: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cursor-effects {
    display: none;
  }
}
