:root {
  --bg: #0a0f16;
  --surface: #141d2a;
  --surface-2: #1c2838;
  --text: #e6edf7;
  --muted: #9db1cc;
  --accent: #35d0a5;
  --accent-2: #4bb3fd;
  --border: #2c3b50;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  position: relative;
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(75, 179, 253, 0.18), transparent 60%),
    radial-gradient(1000px 700px at 90% -5%, rgba(53, 208, 165, 0.16), transparent 60%),
    var(--bg);
  line-height: 1.5;
}

.page {
  width: min(1080px, 92vw);
  margin: 0 auto;
  padding: 30px 0 42px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.84rem;
  background: rgba(20, 29, 42, 0.7);
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.nav-link:hover {
  color: var(--text);
  border-color: rgba(75, 179, 253, 0.65);
  background: rgba(28, 40, 56, 0.9);
  transform: translateY(-1px);
}

.nav-link:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.nav-link-active {
  color: #d6fbef;
  border-color: rgba(53, 208, 165, 0.7);
  background: rgba(53, 208, 165, 0.18);
}

.hero {
  background: linear-gradient(130deg, rgba(20, 29, 42, 0.9), rgba(28, 40, 56, 0.8));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.title {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0.015em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  opacity: 0.75;
}

.categories {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.hero + .category {
  margin-top: 14px;
}

.games-panel {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.games-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.games-filter {
  display: grid;
  gap: 6px;
}

.games-filter-refresh {
  align-content: end;
}

.games-filter-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.games-input,
.games-select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(20, 29, 42, 0.88);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.games-refresh-button {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(20, 29, 42, 0.88);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.games-refresh-button:hover:not(:disabled) {
  border-color: rgba(75, 179, 253, 0.7);
  background: rgba(28, 40, 56, 0.95);
}

.games-refresh-button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.games-refresh-button:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.games-input::placeholder {
  color: rgba(157, 177, 204, 0.8);
}

.games-input:focus-visible,
.games-select:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.games-status {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(20, 29, 42, 0.78);
  font-size: 0.88rem;
}

.games-status.is-loading {
  color: var(--muted);
}

.games-status.is-success {
  color: #d6fbef;
  border-color: rgba(53, 208, 165, 0.6);
  background: rgba(53, 208, 165, 0.12);
}

.games-status.is-empty {
  color: #f8f2cf;
  border-color: rgba(255, 197, 92, 0.6);
  background: rgba(255, 197, 92, 0.12);
}

.games-status.is-error {
  color: #ffd8d8;
  border-color: rgba(249, 114, 114, 0.65);
  background: rgba(249, 114, 114, 0.12);
}

.games-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(20, 29, 42, 0.88), rgba(15, 22, 33, 0.97));
  box-shadow: var(--shadow);
}

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

.games-table th,
.games-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(44, 59, 80, 0.75);
  font-size: 0.88rem;
}

.games-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(12, 18, 27, 0.96);
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.games-sort-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.games-sort-button:hover {
  color: var(--text);
}

.games-sort-button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}

.games-sort-button-active {
  color: #d6fbef;
}

.games-sort-icon {
  flex: 0 0 auto;
  font-family: "IBM Plex Mono", Consolas, monospace;
  color: var(--muted);
}

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

.games-table tbody tr:hover {
  background: rgba(75, 179, 253, 0.06);
}

.games-table tbody tr:last-child td {
  border-bottom: none;
}

.games-cell-title {
  min-width: 220px;
  font-weight: 500;
}

.games-table td {
  overflow-wrap: anywhere;
}

.games-empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 20px 12px;
}

.category {
  background: linear-gradient(160deg, rgba(20, 29, 42, 0.85), rgba(15, 22, 33, 0.95));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  animation: reveal 400ms ease both;
}

.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.category-title {
  margin: 0;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.category-count {
  color: var(--muted);
  font-size: 0.8rem;
}

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

.command {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 11px;
  display: grid;
  gap: 7px;
}

.command-triggers {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
  color: #d5f9ef;
  background: rgba(53, 208, 165, 0.15);
  border: 1px solid rgba(53, 208, 165, 0.4);
  border-radius: 999px;
  padding: 3px 8px;
}

.chip:hover {
  background: rgba(53, 208, 165, 0.24);
  border-color: rgba(53, 208, 165, 0.62);
  transform: translateY(-1px);
}

.chip:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.chip-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.chip-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.chip-copied {
  background: rgba(75, 179, 253, 0.24);
  border-color: rgba(75, 179, 253, 0.7);
}

.command-description {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
}



.toast {
  position: absolute;
  transform: translate(-50%, -100%);
  opacity: 0;
  pointer-events: none;
  background: rgba(10, 15, 22, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--accent);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.78rem;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast-visible {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 6px));
}

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

@media (max-width: 760px) {
  .page {
    padding-top: 18px;
  }

  .site-nav {
    margin-bottom: 8px;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .hero {
    padding: 16px;
  }

  .category {
    padding: 10px;
  }

  .games-controls {
    grid-template-columns: 1fr;
  }
}
