:root {
  color-scheme: dark;
  --bg: #111414;
  --panel: #151918;
  --panel-raised: #1a1f1d;
  --line: #2a302e;
  --line-strong: #3b4440;
  --text: #ecebe4;
  --muted: #9d9f98;
  --faint: #6f7670;
  --green: #52d68d;
  --green-soft: #0f372a;
  --cyan: #59d3df;
  --cyan-soft: #12333a;
  --gold: #e7bd49;
  --gold-soft: #3b3113;
  --rose: #e66687;
  --rose-soft: #3b1c27;
  --red: #ef6d67;
  --red-soft: #3b2020;
  --blue: #7bb1f2;
  --blue-soft: #14263f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  --font-sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(82, 214, 141, 0.1), transparent 28rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 320px;
  min-height: 100dvh;
}

.game-rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  border-right: 1px solid var(--line);
  background: rgba(18, 21, 20, 0.9);
  padding: 22px 14px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--cyan);
}

.game-list {
  display: grid;
  gap: 8px;
}

.game-pill {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 10px;
  text-align: left;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.game-pill strong,
.game-pill small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-pill strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.game-pill small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.game-pill.is-active {
  border-color: rgba(82, 214, 141, 0.22);
  background: rgba(82, 214, 141, 0.08);
}

.game-pill:active {
  transform: translateY(1px) scale(0.99);
}

.game-icon {
  display: block;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(231, 189, 73, 0.7), transparent 34%),
    linear-gradient(315deg, rgba(82, 214, 141, 0.55), transparent 38%),
    #252b28;
}

.game-icon-muted {
  background: #242827;
  opacity: 0.5;
}

.workspace {
  min-width: 0;
  padding: 28px 24px 46px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 20px;
  max-width: 1440px;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 0.98;
}

h2 {
  font-size: 22px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.icon-button,
.import-button,
.tool-button,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.import-button,
.tool-button,
.chip-button {
  padding: 0 13px;
  font-size: 13px;
  font-weight: 700;
}

.icon-button:hover,
.import-button:hover,
.tool-button:hover,
.chip-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.icon-button:active,
.import-button:active,
.tool-button:active,
.chip-button:active {
  transform: translateY(1px) scale(0.99);
}

.import-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.status-strip,
.metrics-grid,
.control-band,
.selection-row,
.table-shell {
  max-width: 1440px;
  margin-inline: auto;
}

.status-strip {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.status-strip > div {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.status-strip strong {
  color: var(--text);
  font-weight: 700;
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(82, 214, 141, 0.12);
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.86);
    opacity: 0.72;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.metric {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    var(--panel);
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  animation: rise 420ms ease both;
}

.metric:nth-child(2) {
  animation-delay: 50ms;
}

.metric:nth-child(3) {
  animation-delay: 100ms;
}

.metric:nth-child(4) {
  animation-delay: 150ms;
}

.metric:nth-child(5) {
  animation-delay: 200ms;
}

.metric:nth-child(6) {
  animation-delay: 250ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 18px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 24px;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-online strong {
  color: var(--green);
}

.control-band {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  padding: 0 14px;
  color: var(--muted);
}

.search-field:focus-within {
  border-color: rgba(82, 214, 141, 0.45);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder {
  color: var(--faint);
}

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

.segmented button {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
}

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

.segmented button.is-active {
  background: rgba(82, 214, 141, 0.13);
  color: var(--text);
}

select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-raised);
  color: var(--text);
  padding: 0 34px 0 12px;
  outline: 0;
}

.dropdown {
  position: relative;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  min-width: 176px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(24, 29, 27, 0.98);
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 4;
}

.dropdown.is-open .menu-panel {
  display: grid;
  gap: 4px;
}

.menu-panel label,
.menu-panel button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0 8px;
  text-align: left;
}

.menu-panel label:hover,
.menu-panel button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.selection-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.selection-row span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  padding: 7px 11px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.chip-button {
  min-height: 34px;
  color: var(--muted);
  padding: 0 11px;
}

.table-shell {
  position: relative;
  min-height: 320px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 20, 20, 0.68);
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #151918;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  z-index: 1;
}

th button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-weight: inherit;
}

th button::after {
  content: "";
  width: 12px;
  height: 12px;
  background: linear-gradient(currentColor, currentColor) center / 1px 10px no-repeat;
  opacity: 0.5;
}

tbody tr {
  cursor: pointer;
  transition: background 160ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

tbody tr.is-selected {
  background: rgba(82, 214, 141, 0.07);
}

.select-col {
  width: 44px;
}

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

.account-cell {
  display: grid;
  gap: 3px;
}

.account-cell strong {
  color: var(--text);
  font-weight: 800;
}

.account-cell span {
  color: var(--faint);
  font-size: 12px;
}

.number {
  font-family: var(--font-mono);
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.pill-green {
  background: var(--green-soft);
  color: #78e5aa;
}

.pill-gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.pill-rose {
  background: var(--rose-soft);
  color: #f47aa0;
}

.pill-red {
  background: var(--red-soft);
  color: var(--red);
}

.pill-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.pill-muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.status-pill {
  gap: 7px;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.perk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 260px;
}

.perk-list .pill {
  min-height: 24px;
  padding: 0 8px;
  font-family: var(--font-sans);
  font-size: 11px;
}

.table-loading {
  position: absolute;
  inset: 56px 0 auto;
  display: grid;
  gap: 1px;
  z-index: 2;
}

.table-loading span {
  height: 54px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  background-size: 240% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

.table-shell.is-ready .table-loading {
  display: none;
}

.empty-state,
.error-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 260px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong,
.error-state strong {
  color: var(--text);
}

.error-state {
  color: var(--red);
}

[hidden] {
  display: none !important;
}

[data-hidden-column="true"] {
  display: none;
}

.details-panel {
  position: sticky;
  top: 0;
  height: 100dvh;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(82, 214, 141, 0.06), transparent 36%),
    rgba(18, 21, 20, 0.94);
  padding: 28px 22px;
  overflow-y: auto;
}

.close-details {
  position: absolute;
  top: 18px;
  right: 18px;
}

.detail-stack {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.detail-item {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-item strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 18px;
}

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

@media (min-width: 1680px) {
  .control-band {
    grid-template-columns: minmax(320px, 1fr) auto auto auto auto auto;
  }
}

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

  .game-rail {
    padding: 18px 10px;
  }

  .brand-lockup span:last-child,
  .game-pill span:last-child {
    display: none;
  }

  .game-pill {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .details-panel {
    position: fixed;
    top: auto;
    right: 16px;
    bottom: 16px;
    width: min(380px, calc(100vw - 32px));
    height: auto;
    max-height: 72dvh;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform: translateY(calc(100% + 24px));
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 6;
  }

  .details-panel.is-open {
    transform: translateY(0);
  }

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

  .control-band {
    grid-template-columns: minmax(260px, 1fr) auto auto;
  }
}

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  .game-rail {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-lockup span:last-child,
  .game-pill span:last-child {
    display: block;
  }

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

  .game-pill {
    grid-template-columns: 34px minmax(0, 1fr);
    justify-items: stretch;
  }

  .workspace {
    padding: 22px 14px 36px;
  }

  .topbar,
  .status-strip {
    display: grid;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .metrics-grid,
  .control-band {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 98px;
  }

  .segmented,
  .tool-button,
  .dropdown,
  select {
    width: 100%;
  }

  .segmented button,
  .tool-button,
  select {
    flex: 1;
  }

  .menu-panel {
    left: 0;
    right: auto;
    width: 100%;
  }

  .selection-row {
    flex-wrap: wrap;
  }
}

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