:root {
  --bg: #0c0e12;
  --panel: #14171e;
  --panel-hover: #1b1f29;
  --border: #232936;
  --border-soft: #1c212c;
  --text: #eef0f4;
  --muted: #9aa3b2;
  --accent: #7aa2f7;
  --accent-soft: rgba(122, 162, 247, 0.14);
  --ok: #9ece6a;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(1200px 700px at 50% -240px, #1a2030 0%, rgba(26, 32, 48, 0) 62%);
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

code, .mono { font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; }

/* ----------------------------------------------------------------- */
/* Sticky header — search AND the activation command stay visible.    */
/* ----------------------------------------------------------------- */
.topbar {
  position: static;
  flex: none;
  z-index: 50;
  background: rgba(12, 14, 18, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  width: 100%;
  margin: 0;
  padding: 14px 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row { display: flex; align-items: center; gap: 14px; }
.row-top { justify-content: space-between; }

/* Right side of the header: MeowClient link + language switcher */
.header-right {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.meow-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  white-space: nowrap;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.meow-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--panel-hover);
}

/* Language switcher (top right) */
.lang {
  display: inline-flex;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: 600 12.5px "Inter", sans-serif;
  letter-spacing: 0.3px;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.lang-btn:hover { color: var(--text); }

.lang-btn.active {
  background: var(--accent);
  color: #0a0d12;
}

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

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.2px;
}

.count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* Activation command bar — always visible */
.activate {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.activate:hover { border-color: var(--accent); background: var(--panel-hover); }

.activate-label {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 9px;
  border-radius: 7px;
  white-space: nowrap;
}

.activate-cmd {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activate-copy {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 7px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.activate:hover .activate-copy { color: var(--text); border-color: var(--accent); }

/* Search */
.search {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search::placeholder { color: var(--muted); }

/* ----------------------------------------------------------------- */
/* Grid                                                               */
/* ----------------------------------------------------------------- */
main {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  padding: 22px 28px 40px;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Scrollbar — match the site's dark theme (WebKit/Chromium) */
main::-webkit-scrollbar {
  width: 12px;
}
main::-webkit-scrollbar-track {
  background: transparent;
}
main::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
  /* inset look so the thumb sits inside the track */
  border: 3px solid var(--bg);
  background-clip: padding-box;
}
main::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  border: 3px solid var(--bg);
  background-clip: padding-box;
}

.grid {
  position: relative;
  width: 100%;
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 8px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.14s ease,
              border-color 0.14s ease, box-shadow 0.14s ease;
  user-select: none;
}

.card:hover {
  background: var(--panel-hover);
  border-color: #2f3747;
  transform: scale(1.045);
  box-shadow: var(--shadow);
}

.card:active { transform: scale(1.03); }

.card canvas,
.card img.tee {
  width: 96px;
  height: 64px;
  max-width: 100%;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.card .name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card.copied {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.22);
}
.card.copied .name { color: #ffffff; }
.card.copied canvas,
.card.copied img.tee { filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.45)); }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 70px 0;
  font-size: 15px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(18px);
  background: var(--text);
  color: #0a0d12;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 560px) {
  .activate { flex-wrap: wrap; }
  .activate-cmd { flex-basis: 100%; order: 3; white-space: normal; }
}
