:root {
  --bg: #0a0c11;
  --bg-elev: #10141c;
  --panel: #141922;
  --panel-2: #191f2a;
  --panel-3: #202734;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f4f2ec;
  --muted: #939bad;
  --muted-2: #697184;
  --lime: #d7ff64;
  --lime-deep: #bde93c;
  --orange: #ff8a5c;
  --mint: #6ee7d8;
  --blue: #8b9cff;
  --wechat: #55d67b;
  --danger: #ff6b6b;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar: 252px;
  --topbar: 82px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--lime);
  color: #0a0c11;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
}

.ambient-a {
  width: 520px;
  height: 420px;
  top: -180px;
  right: 6%;
  background: rgba(215, 255, 100, 0.075);
}

.ambient-b {
  width: 560px;
  height: 480px;
  bottom: -240px;
  left: 30%;
  background: rgba(255, 138, 92, 0.06);
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 30%),
    rgba(10, 12, 17, 0.7);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--lime);
  color: #10130b;
  box-shadow: 0 0 0 1px rgba(215, 255, 100, 0.25), 0 12px 30px rgba(190, 233, 60, 0.16);
}

.brand-mark svg {
  width: 28px;
  height: 28px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 19px;
  letter-spacing: 0.09em;
  font-weight: 900;
}

.brand-text small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.nav-item.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(215, 255, 100, 0.12), rgba(215, 255, 100, 0.025));
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--lime);
  box-shadow: 0 0 12px rgba(215, 255, 100, 0.6);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: currentColor;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-count {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.nav-item.is-active .nav-count {
  background: rgba(215, 255, 100, 0.14);
  color: var(--lime);
}

.nav-label {
  margin: 20px 12px 7px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.platform-dot {
  width: 8px;
  height: 8px;
  margin-left: 5px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.035);
}

.platform-dot.godot {
  background: #7fb7ff;
}

.platform-dot.wechat {
  background: var(--wechat);
}

.platform-dot.web {
  background: var(--orange);
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(215, 255, 100, 0.09), transparent 55%),
    var(--panel);
}

.library-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -38px;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(215, 255, 100, 0.16);
  border-radius: 50%;
}

.library-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(215, 255, 100, 0.08);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.78); }
}

.library-number {
  display: block;
  margin-top: 15px;
  font-size: 40px;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.library-caption {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.library-meter {
  height: 3px;
  margin: 16px 0 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.library-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  box-shadow: 0 0 12px rgba(215, 255, 100, 0.5);
  transition: width 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.library-foot {
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 9.5px;
  font-family: var(--mono);
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.side-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-credit {
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.16);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.sidebar-scrim {
  display: none;
}

/* ---------- Top bar ---------- */

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--topbar);
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 17, 0.72);
  backdrop-filter: blur(22px) saturate(140%);
}

.mobile-menu,
.mobile-brand {
  display: none;
}

.search {
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(390px, 42vw);
  height: 42px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.search:focus-within {
  border-color: rgba(215, 255, 100, 0.35);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 0 0 4px rgba(215, 255, 100, 0.05);
}

.search-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
}

.search-icon svg {
  width: 17px;
  height: 17px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

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

.search input::-webkit-search-cancel-button {
  filter: invert(0.7);
}

.search kbd {
  flex: none;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(215, 255, 100, 0.24);
  border-radius: 99px;
  background: rgba(215, 255, 100, 0.07);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.mode-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.mode-pill[hidden] {
  display: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.mobile-menu {
  display: none;
}

html:has(dialog[open]) {
  overflow: hidden;
}

.icon-btn.is-spinning svg {
  animation: spin 800ms linear infinite;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 150ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.btn-primary {
  background: var(--lime);
  color: #11150a;
  box-shadow: 0 8px 24px rgba(190, 233, 60, 0.12);
}

.btn-primary:hover:not(:disabled) {
  background: #e3ff87;
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.btn-danger {
  background: var(--danger);
  color: #1b0909;
}

.btn-small {
  height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

/* ---------- Page & hero ---------- */

.page {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 34px 40px 36px;
}

.hero {
  position: relative;
  min-height: 344px;
  margin-bottom: 46px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  isolation: isolate;
}

.hero-card {
  position: relative;
  min-height: 344px;
  display: flex;
  align-items: flex-end;
  padding: 42px 46px;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 10, 14, 0.94) 0%, rgba(8, 10, 14, 0.74) 42%, rgba(8, 10, 14, 0.2) 74%, rgba(8, 10, 14, 0.42) 100%),
    linear-gradient(0deg, rgba(8, 10, 14, 0.7), transparent 55%);
}

.hero-art .art {
  height: 100%;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 625px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.hero-eyebrow .line {
  width: 28px;
  height: 1px;
  background: var(--lime);
  opacity: 0.5;
}

.hero-title {
  margin: 0;
  font-size: clamp(34px, 4.1vw, 62px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero-desc {
  max-width: 505px;
  margin: 15px 0 23px;
  color: rgba(244, 242, 236, 0.68);
  font-size: 13.5px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 23px;
  color: var(--muted);
  font-size: 11.5px;
}

.hero-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-meta svg {
  width: 14px;
  height: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-side {
  position: absolute;
  top: 28px;
  right: 30px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.hero-stamp {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  background: rgba(10, 12, 17, 0.48);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
}

.hero-stamp .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
}

.hero-index {
  color: rgba(255, 255, 255, 0.25);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.hero-empty {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: center;
  gap: 30px;
  padding: 44px 48px;
  background:
    radial-gradient(100% 120% at 100% 0%, rgba(215, 255, 100, 0.1), transparent 55%),
    radial-gradient(80% 100% at 0% 100%, rgba(255, 138, 92, 0.08), transparent 60%),
    var(--panel);
}

.hero-empty-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero-empty-copy h1 em {
  color: var(--lime);
  font-style: normal;
}

.hero-empty-copy p {
  max-width: 480px;
  margin: 0 0 25px;
  color: var(--muted);
  font-size: 14px;
}

.empty-orbit {
  position: relative;
  display: grid;
  place-items: center;
  height: 230px;
}

.empty-orbit .ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.empty-orbit .ring:nth-child(1) { width: 200px; height: 200px; }
.empty-orbit .ring:nth-child(2) { width: 145px; height: 145px; border-style: dashed; animation: spin 30s linear infinite; }
.empty-orbit .ring:nth-child(3) { width: 86px; height: 86px; border-color: rgba(215, 255, 100, 0.24); }

.empty-orbit .core {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--lime);
  color: #11150a;
  box-shadow: 0 0 50px rgba(215, 255, 100, 0.2);
}

.empty-orbit .core svg {
  width: 30px;
  height: 30px;
}

.empty-orbit .satellite {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 15px var(--orange);
  top: 28px;
  right: 52px;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- Collection ---------- */

.collection-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.collection-head h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.title-count {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.collection-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sort-select {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 4px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-2);
  font-size: 11px;
}

.sort-select select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  cursor: pointer;
}

.sort-select select option {
  background: var(--panel);
  color: var(--text);
}

.view-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.view-toggle button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
}

.view-toggle button.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.view-toggle svg {
  width: 15px;
  height: 15px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(246px, 1fr));
  gap: 24px 20px;
}

.game-card {
  position: relative;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  border-radius: var(--radius-lg);
  cursor: pointer;
  animation: card-in 420ms both;
  animation-delay: calc(var(--i, 0) * 34ms);
}

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

.card-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel-2);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 260ms ease, box-shadow 260ms ease;
}

.game-card:hover .card-cover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.34);
}

.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 10, 14, 0.48));
}

.card-badges {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 99px;
  background: rgba(10, 12, 17, 0.62);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.8);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge.godot { color: #9bc8ff; }
.badge.wechat { color: #74e69a; }
.badge.web { color: #ffb18e; }
.badge.unknown { color: var(--muted); }
.badge.sample { color: var(--lime); }
.badge.warn {
  border-color: rgba(255, 138, 92, 0.25);
  background: rgba(44, 25, 18, 0.72);
  color: #ffb18e;
}

.card-play {
  position: absolute;
  right: 13px;
  bottom: 13px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--lime);
  color: #11150a;
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 200ms ease, transform 200ms ease, background 160ms ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card-play svg {
  width: 17px;
  height: 17px;
  margin-left: 2px;
}

.game-card:hover .card-play,
.game-card:focus-visible .card-play {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.card-play:hover {
  background: #e6ff92;
}

.card-play.is-disabled {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  cursor: not-allowed;
}

.card-body {
  padding: 12px 4px 0;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.015em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-platform {
  flex: none;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.card-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.card-sub .sep {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.card-sub .ready {
  color: var(--lime);
}

/* List view */

.game-grid.is-list {
  grid-template-columns: 1fr;
  gap: 10px;
}

.game-grid.is-list .game-card {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.018);
}

.game-grid.is-list .card-cover {
  aspect-ratio: 16 / 10;
  border-radius: 11px;
}

.game-grid.is-list .game-card:hover .card-cover {
  transform: none;
  box-shadow: none;
}

.game-grid.is-list .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 8px;
}

.game-grid.is-list .card-title {
  font-size: 17px;
}

.game-grid.is-list .card-play {
  opacity: 1;
  transform: none;
  right: 18px;
  bottom: 50%;
  translate: 0 50%;
}

/* ---------- Art ---------- */

.art {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #11151d;
}

.art svg.art-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-word {
  position: absolute;
  left: 15px;
  bottom: 4px;
  color: rgba(255, 255, 255, 0.16);
  font-size: clamp(64px, 9vw, 126px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.08em;
  pointer-events: none;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.18);
}

.hero-art .art-word {
  left: auto;
  right: 38px;
  bottom: 0;
  font-size: clamp(130px, 18vw, 270px);
  opacity: 0.5;
}

.art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 4px),
    radial-gradient(120% 100% at 50% 100%, transparent 50%, rgba(0, 0, 0, 0.2));
  mix-blend-mode: soft-light;
}

/* ---------- Empty ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 76px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-xl);
  text-align: center;
  background: rgba(255, 255, 255, 0.012);
}

.empty-state[hidden] {
  display: none;
}

.empty-art {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 44px;
  margin-bottom: 20px;
}

.empty-art span {
  width: 7px;
  border-radius: 3px;
  background: var(--lime);
  opacity: 0.25;
  animation: eq 1.6s ease-in-out infinite;
}

.empty-art span:nth-child(1) { height: 15px; animation-delay: 0s; }
.empty-art span:nth-child(2) { height: 32px; animation-delay: 0.14s; }
.empty-art span:nth-child(3) { height: 44px; animation-delay: 0.28s; }
.empty-art span:nth-child(4) { height: 26px; animation-delay: 0.42s; }
.empty-art span:nth-child(5) { height: 11px; animation-delay: 0.56s; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.6); opacity: 0.2; }
  50% { transform: scaleY(1); opacity: 0.65; }
}

.empty-state h3 {
  margin: 0 0 7px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.empty-state p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 58px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.footer-dots {
  letter-spacing: 0.2em;
  color: rgba(215, 255, 100, 0.35);
}

/* ---------- Dialogs ---------- */

dialog {
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
}

dialog::backdrop {
  background: rgba(4, 6, 10, 0.78);
  backdrop-filter: blur(9px);
}

dialog[open] {
  animation: dialog-in 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
  width: 620px;
  padding: 28px;
  overflow: auto;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.modal-head h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.modal-sub {
  max-width: 490px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.modal-close {
  flex: none;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 188px;
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(215, 255, 100, 0.045), transparent 70%),
    rgba(255, 255, 255, 0.017);
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: rgba(215, 255, 100, 0.55);
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(215, 255, 100, 0.09), transparent 70%),
    rgba(255, 255, 255, 0.03);
}

.dropzone.is-dragging {
  transform: scale(1.008);
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 13px;
  border: 1px solid rgba(215, 255, 100, 0.18);
  border-radius: 15px;
  background: rgba(215, 255, 100, 0.08);
  color: var(--lime);
}

.dropzone-icon svg {
  width: 23px;
  height: 23px;
}

.dropzone strong {
  font-size: 15px;
  font-weight: 750;
}

.dropzone p {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
}

.dot-sep {
  margin: 0 3px;
  opacity: 0.5;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.selected-file[hidden] {
  display: none;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: rgba(139, 156, 255, 0.1);
  color: var(--blue);
}

.file-icon svg {
  width: 19px;
  height: 19px;
}

.file-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.file-meta strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-meta span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.import-progress {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.import-progress[hidden] {
  display: none;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime), var(--mint));
  transition: width 180ms ease;
}

.progress-track.is-indeterminate span {
  width: 36% !important;
  animation: indeterminate 1.1s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(360%); }
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
}

.import-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.import-notes > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.import-notes p {
  margin: 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.55;
}

.import-notes strong {
  color: var(--text);
  font-size: 11px;
}

.note-badge {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.note-badge.godot {
  background: rgba(127, 183, 255, 0.13);
  color: #9bc8ff;
}

.note-badge.wechat {
  background: rgba(85, 214, 123, 0.13);
  color: #74e69a;
}

.form-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 107, 0.24);
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.07);
  color: #ff9a9a;
  font-size: 11.5px;
}

.import-format-note {
  margin: 11px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.6;
}

.form-error[hidden] {
  display: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

/* ---------- Detail ---------- */

.detail-modal {
  width: min(900px, calc(100vw - 32px));
  overflow: auto;
}

.detail-art {
  position: relative;
  height: 252px;
  background: var(--panel-2);
  overflow: hidden;
}

.detail-art .art {
  height: 100%;
}

.detail-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(20, 25, 34, 0.92));
}

.detail-body {
  position: relative;
  padding: 4px 34px 28px;
}

.detail-close {
  position: absolute;
  top: -232px;
  right: 18px;
  z-index: 5;
  background: rgba(10, 12, 17, 0.55);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
  margin-bottom: 8px;
}

.detail-badges:empty {
  display: none;
}

.detail-body h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.detail-desc {
  max-width: 680px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.detail-tags:empty {
  display: none;
}

.tag {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 10px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 20px;
}

.detail-notice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 138, 92, 0.22);
  border-radius: 13px;
  background: rgba(255, 138, 92, 0.06);
  color: #ffc5ad;
  font-size: 12px;
  line-height: 1.7;
}

.detail-notice[hidden] {
  display: none;
}

.detail-notice.is-info {
  border-color: rgba(110, 231, 216, 0.22);
  background: rgba(110, 231, 216, 0.055);
  color: #bff4ec;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--line);
}

.detail-grid > div {
  padding: 13px 15px;
  background: var(--panel);
}

.detail-grid dt {
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.detail-grid dd {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.edit-panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
}

.edit-panel summary {
  padding: 13px 15px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.edit-panel summary::-webkit-details-marker {
  display: none;
}

.edit-panel summary::before {
  content: "+";
  display: inline-block;
  width: 16px;
  color: var(--lime);
  font-family: var(--mono);
}

.edit-panel[open] summary::before {
  content: "−";
}

.edit-panel form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 3px 15px 16px;
}

.edit-panel label,
.color-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
}

.edit-panel input,
.edit-panel textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  font-size: 12px;
  resize: vertical;
}

.edit-panel input:focus,
.edit-panel textarea:focus {
  border-color: rgba(215, 255, 100, 0.4);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatches button {
  width: 26px;
  height: 26px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.swatches button.is-selected {
  border-color: var(--text);
  outline: 2px solid rgba(255, 255, 255, 0.24);
  outline-offset: 2px;
}

.background-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}

.background-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10.5px;
}

.background-head span:last-child {
  color: rgba(215, 255, 100, 0.72);
  font-size: 9.5px;
  text-align: right;
}

.background-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
  line-height: 1.6;
}

.background-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.background-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0e13;
}

.background-preview img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 3px;
}

.delete-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 107, 107, 0.65);
  font-size: 10.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.delete-link:hover {
  color: var(--danger);
}

/* ---------- Help ---------- */

.help-modal {
  width: 660px;
  padding: 28px;
}

.help-steps {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--line);
}

.help-step {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: var(--panel);
}

.step-no {
  flex: none;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding-top: 3px;
}

.help-step h3 {
  margin: 0 0 5px;
  font-size: 13.5px;
  font-weight: 750;
}

.help-step p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.help-step b {
  color: var(--text);
}

.help-step code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.92em;
}

/* ---------- Mobile access ---------- */

.mobile-modal {
  width: 590px;
}

.mobile-access-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px solid rgba(215, 255, 100, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(100% 120% at 100% 0%, rgba(215, 255, 100, 0.09), transparent 60%),
    rgba(255, 255, 255, 0.022);
}

.mobile-access-card.is-disabled {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.mobile-access-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border: 1px solid rgba(215, 255, 100, 0.2);
  border-radius: 13px;
  background: rgba(215, 255, 100, 0.08);
  color: var(--lime);
}

.mobile-access-icon svg {
  width: 23px;
  height: 23px;
}

.mobile-access-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.mobile-access-copy span {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.mobile-access-copy code {
  overflow: hidden;
  color: var(--lime);
  font-family: var(--mono);
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mobile-access-card.is-disabled .mobile-access-copy code {
  color: var(--muted);
  font-size: 13px;
}

.mobile-access-card .btn {
  flex: none;
}

.mobile-alt {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.mobile-alt[hidden] {
  display: none;
}

.mobile-alt-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: left;
}

.mobile-alt-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
}

.mobile-alt-link svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.mobile-warning {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 138, 92, 0.25);
  border-radius: 11px;
  background: rgba(255, 138, 92, 0.06);
  color: #ffc5ad;
  font-size: 11px;
  line-height: 1.7;
}

.mobile-warning[hidden] {
  display: none;
}

.mobile-help {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.mobile-help-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.mobile-help-item b {
  flex: none;
  padding-top: 1px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 9px;
}

.mobile-note {
  margin: 13px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.7;
}

.mobile-note code,
.mobile-warning code {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.92em;
}

/* ---------- Confirm ---------- */

.confirm-modal {
  width: 380px;
  padding: 26px;
  text-align: center;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(255, 107, 107, 0.1);
  color: var(--danger);
}

.confirm-icon svg {
  width: 20px;
  height: 20px;
}

.confirm-modal h2 {
  margin: 0 0 7px;
  font-size: 20px;
  font-weight: 800;
}

.confirm-modal p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.confirm-modal .modal-actions {
  justify-content: center;
}

/* ---------- PWA install ---------- */

.pwa-install-cta {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(20, 25, 34, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
  animation: pwa-in 280ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes pwa-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.pwa-install-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  background: var(--lime);
  color: #11150a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.pwa-install-main:hover {
  background: #e6ff92;
}

.pwa-install-main svg {
  width: 16px;
  height: 16px;
}

.pwa-install-close {
  width: 30px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* ---------- Toasts ---------- */

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(23, 29, 39, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
  color: var(--text);
  font-size: 12px;
  pointer-events: auto;
  animation: toast-in 220ms ease both;
}

.toast.is-out {
  animation: toast-out 180ms ease both;
}

.toast .toast-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(215, 255, 100, 0.6);
}

.toast.error .toast-dot {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
}

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

@keyframes toast-out {
  to { opacity: 0; transform: translateY(5px); }
}

/* ---------- Loading skeleton ---------- */

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(246px, 1fr));
  gap: 24px 20px;
}

.skeleton-card {
  border-radius: var(--radius-lg);
}

.skeleton-card .sk-cover {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, var(--panel) 25%, var(--panel-2) 38%, var(--panel) 55%);
  background-size: 250% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-card .sk-line {
  height: 12px;
  margin-top: 12px;
  border-radius: 5px;
  background: var(--panel-2);
}

.skeleton-card .sk-line.short {
  width: 55%;
  margin-top: 7px;
}

@keyframes shimmer {
  to { background-position: -150% 0; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  :root {
    --sidebar: 224px;
  }

  .page {
    padding-inline: 30px;
  }

  .topbar {
    padding-inline: 30px;
  }

  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 920px) {
  :root {
    --sidebar: 258px;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar);
    transform: translateX(-102%);
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
    background: rgba(14, 17, 23, 0.98);
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.45);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(5, 7, 11, 0.62);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  .sidebar-scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .mobile-brand {
    display: block;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.12em;
  }

  .search {
    width: min(360px, 100%);
  }

  .topbar {
    gap: 12px;
  }

  .page {
    padding: 24px 24px 30px;
  }

  .hero,
  .hero-card {
    min-height: 310px;
  }

  .hero-card {
    padding: 32px;
  }

  .hero-empty {
    grid-template-columns: 1fr;
    padding: 34px;
  }

  .empty-orbit {
    display: none;
  }
}

@media (max-width: 700px) {
  .topbar {
    height: 70px;
    padding: 0 16px;
  }

  .mobile-brand {
    display: none;
  }

  .search {
    height: 38px;
    padding-left: 11px;
  }

  .search kbd {
    display: none;
  }

  .btn {
    height: 38px;
  }

  .mobile-access-btn {
    display: none;
  }

  .btn-label {
    display: none;
  }

  .top-actions .btn-primary {
    width: 38px;
    padding: 0;
  }

  .page {
    padding: 18px 16px 26px;
  }

  .hero {
    border-radius: 20px;
    margin-bottom: 30px;
  }

  .hero-card {
    min-height: 300px;
    padding: 24px;
    align-items: flex-end;
  }

  .hero-art::after {
    background:
      linear-gradient(90deg, rgba(8, 10, 14, 0.9), rgba(8, 10, 14, 0.35)),
      linear-gradient(0deg, rgba(8, 10, 14, 0.82), transparent 60%);
  }

  .hero-title {
    font-size: 34px;
  }

  .hero-desc {
    font-size: 12px;
    -webkit-line-clamp: 3;
  }

  .hero-side {
    top: 16px;
    right: 16px;
  }

  .hero-index {
    display: none;
  }

  .hero-empty {
    padding: 28px 24px;
  }

  .hero-empty-copy h1 {
    font-size: 34px;
  }

  .collection-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .collection-tools {
    width: 100%;
    justify-content: space-between;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
  }

  .card-badges .badge.sample {
    display: none;
  }

  .badge {
    height: 20px;
    padding: 0 6px;
    font-size: 8.5px;
  }

  .card-title {
    font-size: 13.5px;
  }

  .card-sub {
    font-size: 9.5px;
  }

  .card-play {
    width: 36px;
    height: 36px;
    opacity: 1;
    transform: none;
  }

  .game-grid.is-list .game-card {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
  }

  .game-grid.is-list .card-play {
    width: 34px;
    height: 34px;
  }

  .detail-modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .detail-art {
    height: 210px;
  }

  .detail-body {
    padding: 4px 20px 24px;
  }

  .detail-close {
    top: -190px;
  }

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

  .modal {
    width: calc(100vw - 20px);
    padding: 20px;
    border-radius: 18px;
  }

  .modal-head h2 {
    font-size: 25px;
  }

  .import-notes {
    grid-template-columns: 1fr;
  }

  .mobile-access-card {
    flex-wrap: wrap;
  }

  .mobile-access-card .btn {
    width: 100%;
  }

  .dropzone {
    min-height: 165px;
  }

  .toast-stack {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }

  .page-footer {
    margin-top: 38px;
  }
}

@media (max-width: 380px) {
  .game-grid {
    grid-template-columns: 1fr;
  }

  .search {
    min-width: 0;
  }
}

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