:root {
  --bg: #070b14;
  --bg2: #0a1020;
  --surface: rgba(255, 255, 255, 0.06);
  --surface2: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --border: rgba(255, 255, 255, 0.14);
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.38);
  --shadow2: 0 10px 30px rgba(0, 0, 0, 0.26);
  --ring: 0 0 0 4px rgba(124, 58, 237, 0.22);
  --radius: 16px;
  --radius-sm: 12px;
  --space: 24px;
  --max: 1120px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 150ms;
  --t: 220ms;
}

html[data-theme="light"] {
  --bg: #f6f7fb;
  --bg2: #eef1fb;
  --surface: rgba(0, 0, 0, 0.035);
  --surface2: rgba(0, 0, 0, 0.06);
  --text: rgba(15, 23, 42, 0.94);
  --muted: rgba(15, 23, 42, 0.7);
  --border: rgba(15, 23, 42, 0.14);
  --shadow: 0 16px 36px rgba(2, 6, 23, 0.12);
  --shadow2: 0 10px 22px rgba(2, 6, 23, 0.1);
  --ring: 0 0 0 4px rgba(124, 58, 237, 0.22);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --bg: #f6f7fb;
    --bg2: #eef1fb;
    --surface: rgba(0, 0, 0, 0.035);
    --surface2: rgba(0, 0, 0, 0.06);
    --text: rgba(15, 23, 42, 0.94);
    --muted: rgba(15, 23, 42, 0.7);
    --border: rgba(15, 23, 42, 0.14);
    --shadow: 0 16px 36px rgba(2, 6, 23, 0.12);
    --shadow2: 0 10px 22px rgba(2, 6, 23, 0.1);
    --ring: 0 0 0 4px rgba(124, 58, 237, 0.22);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 10% 10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(6, 182, 212, 0.14), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

a { color: inherit; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  color: var(--text);
}

.brand-text { min-width: 0; }
.brand-title {
  font-weight: 780;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.brand-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56vw;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.icon {
  display: inline-block;
  color: currentColor;
}

.ghost-button,
.icon-button {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 12px;
  font-weight: 650;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

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

.ghost-button:hover,
.icon-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.ghost-button:active,
.icon-button:active { transform: translateY(1px); }

.ghost-button:focus-visible,
.icon-button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

main { padding: 22px 0 40px; }

.controls {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow2);
}

html[data-theme="light"] .controls {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] .controls {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.1);
  }
}

.controls-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 860px) {
  .controls-row {
    grid-template-columns: 1fr auto auto;
    align-items: center;
  }
}

.search {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .search { background: rgba(255, 255, 255, 0.6); }
@media (prefers-color-scheme: light) { html[data-theme="system"] .search { background: rgba(255, 255, 255, 0.6); } }

.search input {
  width: 100%;
  height: 44px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

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

.search:focus-within {
  box-shadow: var(--ring);
  border-color: rgba(124, 58, 237, 0.45);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}

html[data-theme="light"] .segmented { background: rgba(255, 255, 255, 0.6); }
@media (prefers-color-scheme: light) { html[data-theme="system"] .segmented { background: rgba(255, 255, 255, 0.6); } }

.seg {
  height: 36px;
  min-width: 76px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.seg:hover { color: var(--text); }
.seg[aria-pressed="true"] {
  color: rgba(255, 255, 255, 0.94);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(6, 182, 212, 0.78));
}

html[data-theme="light"] .seg[aria-pressed="true"] { color: rgba(15, 23, 42, 0.96); }
@media (prefers-color-scheme: light) { html[data-theme="system"] .seg[aria-pressed="true"] { color: rgba(15, 23, 42, 0.96); } }

.seg:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .select { background: rgba(255, 255, 255, 0.6); }
@media (prefers-color-scheme: light) { html[data-theme="system"] .select { background: rgba(255, 255, 255, 0.6); } }

.select-label { font-size: 12px; color: var(--muted); font-weight: 700; }

.select select {
  height: 36px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
}

.select:focus-within {
  box-shadow: var(--ring);
  border-color: rgba(124, 58, 237, 0.45);
}

.chips-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.chips-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 750;
  flex: 0 0 auto;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: thin;
}

.chip {
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.22); }
.chip[aria-pressed="true"] {
  color: rgba(255, 255, 255, 0.94);
  border-color: rgba(124, 58, 237, 0.55);
  background: rgba(124, 58, 237, 0.16);
}

html[data-theme="light"] .chip[aria-pressed="true"] { color: rgba(15, 23, 42, 0.94); }
@media (prefers-color-scheme: light) { html[data-theme="system"] .chip[aria-pressed="true"] { color: rgba(15, 23, 42, 0.94); } }

.chip:focus-visible { outline: none; box-shadow: var(--ring); }

.summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.summary-title { font-weight: 800; letter-spacing: -0.02em; }
.summary-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.summary-right { color: var(--muted); font-size: 12px; text-align: right; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow2);
  text-decoration: none;
  overflow: hidden;
  min-height: 100%;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.card:hover {
  border-color: rgba(124, 58, 237, 0.5);
  background: var(--surface2);
  box-shadow: var(--shadow);
}

.card:focus-visible {
  outline: none;
  box-shadow: var(--shadow), var(--ring);
}

.thumb-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

html[data-theme="light"] .thumb-container { background: rgba(15, 23, 42, 0.06); }
@media (prefers-color-scheme: light) { html[data-theme="system"] .thumb-container { background: rgba(15, 23, 42, 0.06); } }

.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
  font-size: 36px;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.85);
  background: radial-gradient(800px 240px at 30% 0%, rgba(124, 58, 237, 0.38), transparent 60%),
    radial-gradient(700px 300px at 80% 30%, rgba(6, 182, 212, 0.26), transparent 55%),
    rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .thumb-placeholder { color: rgba(15, 23, 42, 0.82); }
@media (prefers-color-scheme: light) { html[data-theme="system"] .thumb-placeholder { color: rgba(15, 23, 42, 0.82); } }

.card-content {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 118px;
}

.title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--muted);
}

html[data-theme="light"] .badge { border-color: rgba(15, 23, 42, 0.12); background: rgba(15, 23, 42, 0.04); }
@media (prefers-color-scheme: light) { html[data-theme="system"] .badge { border-color: rgba(15, 23, 42, 0.12); background: rgba(15, 23, 42, 0.04); } }

.badge-godot {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.14);
}

.badge-web {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(124, 58, 237, 0.35);
  background: rgba(124, 58, 237, 0.14);
}

html[data-theme="light"] .badge-godot,
html[data-theme="light"] .badge-web { color: rgba(15, 23, 42, 0.92); }
@media (prefers-color-scheme: light) {
  html[data-theme="system"] .badge-godot,
  html[data-theme="system"] .badge-web { color: rgba(15, 23, 42, 0.92); }
}

.meta {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.card-skeleton {
  pointer-events: none;
  overflow: hidden;
}

.thumb-skeleton {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  background-size: 220% 100%;
  animation: shimmer 1.1s linear infinite;
}

.card-body { padding: 12px; display: grid; gap: 10px; }
.line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  background-size: 220% 100%;
  animation: shimmer 1.1s linear infinite;
}
.line-lg { width: 72%; height: 12px; }
.line-sm { width: 52%; }
.line-xs { width: 86%; opacity: 0.7; }

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

.empty {
  grid-column: 1 / -1;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow2);
  padding: 28px 18px;
  text-align: left;
}

.empty-title { font-weight: 850; letter-spacing: -0.02em; }
.empty-meta { margin-top: 6px; color: var(--muted); }

.footer {
  padding: 22px 0 46px;
  margin-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .footer { border-top-color: rgba(15, 23, 42, 0.1); }
@media (prefers-color-scheme: light) { html[data-theme="system"] .footer { border-top-color: rgba(15, 23, 42, 0.1); } }

.footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.footer-title { font-weight: 850; letter-spacing: -0.02em; }
.footer-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.footer-right { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.footer-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.footer-link:hover {
  color: var(--text);
  border-color: rgba(124, 58, 237, 0.6);
}

.footer-link:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
