* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0714;
  --bg-card: #151022;
  --bg-card-2: #1c1430;
  --border: rgba(168, 85, 247, 0.18);
  --accent: #a855f7;
  --accent-2: #7c3aed;
  --accent-glow: rgba(168, 85, 247, 0.45);
  --text: #ede4ff;
  --text-dim: #9d8cc2;
  --ok: #4ade80;
  --err: #f87171;
}

html { scrollbar-color: #3b2a5e var(--bg); }

.icon { width: 1em; height: 1em; flex-shrink: 0; vertical-align: -0.125em; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background:
    radial-gradient(900px 400px at 50% -100px, rgba(124, 58, 237, 0.18), transparent 70%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- hero ---------- */
.hero { text-align: center; padding: 48px 20px 40px; }
.logo-img {
  width: 96px; height: 96px; border-radius: 24px;
  box-shadow: 0 10px 40px rgba(124, 58, 237, 0.45), 0 0 0 1px var(--border);
  margin-bottom: 16px;
}
.logo-title {
  font-size: 44px; font-weight: 900; letter-spacing: -1px;
}
.logo-title .accent {
  background: linear-gradient(90deg, #c084fc, #a855f7, #7c3aed);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 10px; color: var(--text-dim); font-size: 17px; line-height: 1.55; }
.hero-sub .lua { color: #c084fc; font-weight: 700; }

.searchbar {
  max-width: 620px; margin: 26px auto 0;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 8px 8px 8px 16px;
  box-shadow: 0 8px 40px rgba(124, 58, 237, 0.12);
}
.search-icon { width: 18px; height: 18px; color: #6d5d94; }
.searchbar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; font-family: inherit;
}
.searchbar input::placeholder { color: #6d5d94; }
.btn-search {
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; font-weight: 700; font-family: inherit;
  padding: 11px 26px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
  transition: transform .15s;
}
.btn-search:hover { transform: translateY(-1px); }

/* ---------- grid ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }
.section-head h2 {
  font-size: 22px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.flame { width: 22px; height: 22px; color: var(--accent); }

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 10px 34px rgba(124, 58, 237, 0.25);
}

.thumb {
  position: relative; aspect-ratio: 16 / 9;
  overflow: hidden;
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .3s ease;
}
.card:hover .thumb img { transform: scale(1.05); }
.thumb .views {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px);
  font-size: 11px; padding: 4px 9px; border-radius: 999px;
  display: flex; align-items: center; gap: 5px;
}
.thumb .views .icon { width: 13px; height: 13px; }
.badge-keysystem {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(124, 58, 237, 0.85);
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 6px; color: #fff;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge-keysystem .icon { width: 12px; height: 12px; }

.card-info { padding: 12px 14px 14px; }
.card-game { font-size: 12px; color: #c084fc; font-weight: 600; margin-bottom: 4px; }
.card-title {
  font-size: 14px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 38px;
}

.loadmore-wrap { text-align: center; margin-top: 30px; }
.btn-loadmore {
  border: none; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; font-weight: 700; font-size: 15px;
  padding: 13px 60px; border-radius: 12px;
  box-shadow: 0 6px 26px rgba(124, 58, 237, 0.35);
  transition: transform .15s;
}
.btn-loadmore:hover { transform: translateY(-1px); }
.btn-loadmore:disabled { opacity: .4; cursor: default; transform: none; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  text-align: center; padding: 28px 20px;
  color: var(--text-dim); font-size: 13px;
}
.footer-logo {
  font-weight: 800; font-size: 16px; color: var(--text); margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.footer-logo-img { width: 26px; height: 26px; border-radius: 7px; }
.footer-copy { margin-top: 6px; font-size: 12px; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 3, 12, 0.8); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.modal {
  position: relative;
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 18px;
  box-shadow: 0 20px 80px rgba(124, 58, 237, 0.35);
  animation: pop .3s ease;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 10px;
  border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 15px;
}
.modal-close:hover { background: rgba(168, 85, 247, 0.5); }

.modal-banner {
  position: relative; height: 210px;
  background-size: cover; background-position: center;
}
.modal-banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(21, 16, 34, 0.9), transparent 55%);
}
.modal-banner .badge-keysystem { bottom: 10px; left: 12px; z-index: 1; }

.modal-body { padding: 18px 22px 26px; }
.modal-game { font-size: 13px; color: #c084fc; font-weight: 700; }
.modal-title { font-size: 18px; font-weight: 700; margin: 4px 0 16px; line-height: 1.35; }

/* locked code */
.locked-code {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 18px;
}
.locked-code pre {
  padding: 18px; font-family: Consolas, monospace; font-size: 13px;
  color: #7a68a6; filter: blur(4px); user-select: none;
  background: #0d0918; line-height: 1.5;
}
.locked-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(13, 9, 24, 0.55); text-align: center; padding: 10px;
}
.locked-icon { width: 32px; height: 32px; color: #c084fc; margin-bottom: 8px; }
.locked-text { font-weight: 800; font-size: 16px; }
.locked-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

/* socials */
.socials { display: flex; flex-direction: column; gap: 10px; }
.social-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
  transition: border-color .3s;
}
.social-row.done { border-color: rgba(74, 222, 128, 0.55); }
.social-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.social-icon .icon { width: 20px; height: 20px; }
.social-icon.yt { background: rgba(255, 0, 0, 0.15); color: #ff5252; }
.social-icon.tg { background: rgba(41, 168, 234, 0.15); color: #4fc3f7; }
.social-icon.dc { background: rgba(88, 101, 242, 0.18); color: #8c9eff; }
.social-name { flex: 1; font-weight: 700; font-size: 14px; }
.social-name span { display: block; font-weight: 400; font-size: 11px; color: var(--text-dim); }

.btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 600;
  border-radius: 9px; transition: transform .15s, opacity .2s;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-social {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; font-size: 13px; padding: 9px 16px;
}
.btn-check {
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid var(--border);
  color: var(--text); font-size: 13px; padding: 9px 13px;
}
.social-row.done .btn-check { background: rgba(74, 222, 128, 0.2); border-color: rgba(74, 222, 128, 0.5); color: var(--ok); opacity: 1; }
.social-row.done .btn-social { opacity: .45; pointer-events: none; }

.tg-id-row input {
  width: 100%; padding: 10px 14px;
  background: #0d0918; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 13px; font-family: inherit; outline: none;
}
.tg-id-row input:focus { border-color: var(--accent); }

.steps-msg { min-height: 18px; font-size: 12px; color: var(--err); margin: 10px 2px 4px; }

.progress-bar {
  height: 7px; border-radius: 999px;
  background: rgba(168, 85, 247, 0.12);
  overflow: hidden; margin-top: 4px;
}
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px; transition: width .4s ease;
  box-shadow: 0 0 10px var(--accent-glow);
}
.progress-label { font-size: 12px; color: var(--text-dim); margin: 8px 0 14px; text-align: center; }

.btn-unlock {
  width: 100%; padding: 14px; font-size: 16px; border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #a855f7, #c084fc);
  color: #fff;
  box-shadow: 0 6px 28px var(--accent-glow);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* unlocked */
.unlocked-label {
  font-size: 13px; font-weight: 700; margin: 12px 0 8px;
  display: flex; align-items: center; gap: 6px;
}
.ok-label .icon { color: var(--ok); }
.key-row {
  display: flex; align-items: center; gap: 8px;
}
.key-row code {
  flex: 1; font-family: Consolas, monospace; font-size: 15px;
  background: #0d0918; border: 1px dashed rgba(168, 85, 247, 0.4);
  border-radius: 10px; padding: 12px 14px; color: #d8b4fe;
  word-break: break-all;
}
.btn-mini {
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid var(--border);
  color: var(--text); font-size: 13px; padding: 11px 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-mini .icon { width: 15px; height: 15px; }
.key-timer { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.key-timer span { color: #d8b4fe; font-weight: 700; font-family: Consolas, monospace; }
.key-note {
  font-size: 12px; color: #fbbf24; margin-top: 8px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 8px; padding: 8px 12px;
}

.code-row pre {
  background: #0d0918; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
  font-family: Consolas, monospace; font-size: 12.5px; color: #c4b5fd;
  overflow-x: auto; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
}
.btn-copy-code { margin-top: 10px; width: 100%; }
.hint { font-size: 12px; color: var(--text-dim); margin-top: 12px; }

.hidden { display: none !important; }

@media (max-width: 560px) {
  .logo-title { font-size: 34px; }
  .logo-img { width: 72px; height: 72px; border-radius: 18px; }
  .hero { padding: 32px 16px 28px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card-title { font-size: 13px; min-height: 34px; }
  .social-name span { display: none; }
}
