:root {
  --bg: #0a0e17;
  --bg2: #101625;
  --card: #141b2d;
  --card-hover: #1a2340;
  --line: #223052;
  --text: #e8edf7;
  --muted: #8b96ad;
  --neon: #22d3ee;
  --neon2: #a78bfa;
  --danger: #fb7185;
  --gold: #fbbf24;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ---------- home ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
header.site {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(10,14,23,.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
header.site .wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; row-gap: 8px; }
.logo {
  font-size: 1.35rem; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo .us { color: var(--text); -webkit-text-fill-color: var(--text); }
.tag-hard {
  margin-left: auto; font-size: .72rem; font-weight: 700; letter-spacing: 2px;
  color: var(--danger); border: 1px solid var(--danger);
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase;
}
.hero { text-align: center; padding: 64px 0 40px; }
.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem); font-weight: 900; line-height: 1.15;
}
.hero h1 span {
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin-top: 14px; font-size: 1.05rem; }
.hero .cta {
  display: inline-block; margin-top: 26px; padding: 13px 34px; border-radius: 12px;
  font-weight: 700; letter-spacing: 1px; color: #06121a;
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  box-shadow: 0 0 24px rgba(34,211,238,.35);
  transition: transform .15s, box-shadow .15s;
}
.hero .cta:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(34,211,238,.55); }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; padding: 24px 0 70px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s, border-color .15s, box-shadow .15s, background .15s;
  position: relative; overflow: hidden;
}
.card:hover {
  transform: translateY(-4px); border-color: var(--neon);
  background: var(--card-hover);
  box-shadow: 0 8px 30px rgba(34,211,238,.18);
}
.card .icon {
  width: 72px; height: 72px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(34,211,238,.09); font-size: 2.3rem;
}
.card-pin {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; z-index: 2;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(10,14,23,.6);
  color: var(--muted); font-size: 1rem; cursor: pointer; display: grid; place-items: center;
  transition: color .15s, border-color .15s, background .15s;
}
.card-pin:hover { color: var(--gold); border-color: var(--gold); }
.card-pin.on { color: var(--gold); border-color: var(--gold); background: rgba(251,191,36,.14); }
.card h3 { font-size: 1.02rem; font-weight: 700; }
.card p { font-size: .82rem; color: var(--muted); line-height: 1.45; flex: 1; }
.card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.card .play {
  font-size: .78rem; font-weight: 800; letter-spacing: 1.5px; color: var(--neon);
}
.card:hover .play { text-shadow: 0 0 12px rgba(34,211,238,.8); }
.skulls { font-size: .72rem; letter-spacing: 1px; }

footer.site {
  border-top: 1px solid var(--line); padding: 26px 0; text-align: center;
  color: var(--muted); font-size: .82rem;
}

/* ---------- SEO content blocks ---------- */
.intro { padding: 6px 0 4px; }
.intro p { color: var(--muted); font-size: .92rem; line-height: 1.6; max-width: 820px; margin: 0 auto; text-align: center; }

.faq { padding: 10px 0 50px; }
.faq h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 18px; text-align: center; }
.faq-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px; margin-bottom: 12px;
}
.faq-item h3 { font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
.faq-item p { color: var(--muted); font-size: .86rem; line-height: 1.55; }

.seo-note {
  max-width: 640px; margin: 0 auto; padding: 0 16px 6px; text-align: center;
  color: var(--muted); font-size: .82rem; line-height: 1.6;
}
.related {
  max-width: 640px; margin: 0 auto; padding: 4px 16px 40px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  font-size: .8rem;
}
.related span { color: var(--muted); margin-right: 2px; }
.related a {
  color: var(--neon); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; transition: border-color .15s, color .15s;
}
.related a:hover { border-color: var(--neon); text-shadow: 0 0 10px rgba(34,211,238,.6); }

/* ---------- game shell ---------- */
.game-page { display: flex; flex-direction: column; min-height: 100vh; }
.game-top {
  display: flex; align-items: center; gap: 10px 14px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap; row-gap: 8px;
}
.game-top .back {
  font-size: .85rem; font-weight: 700; color: var(--muted);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.game-top .back:hover { color: var(--neon); border-color: var(--neon); }
.game-top h1 { font-size: 1.05rem; font-weight: 800; }
.game-top .best { margin-left: auto; font-size: .85rem; color: var(--gold); font-weight: 700; }
.stage {
  flex: 1; display: grid; place-items: center; padding: 14px;
  background: radial-gradient(ellipse at 50% 0%, #121a2e 0%, var(--bg) 65%);
}
canvas.game {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  max-width: 100%; height: auto; touch-action: none; display: block;
  box-shadow: 0 0 40px rgba(34,211,238,.08);
}
.hint { text-align: center; color: var(--muted); font-size: .82rem; padding: 0 16px 18px; }

/* ---------- auth / leaderboard ---------- */
#cug-auth { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.game-top #cug-auth { margin-left: 0; }
.game-top .best { margin-left: auto; }
.cug-btn {
  font: 700 .8rem 'Segoe UI', sans-serif; letter-spacing: .5px; cursor: pointer;
  color: var(--text); background: var(--card); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 10px; transition: border-color .15s, color .15s;
}
.cug-btn:hover { border-color: var(--neon); color: var(--neon); }
.cug-fav-btn { display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1; padding: 7px 12px; }
.cug-fav-btn.on { color: var(--gold); border-color: var(--gold); }
.cug-fav-btn.on:hover { color: var(--gold); border-color: var(--gold); }
.cug-out { display: inline-flex; align-items: center; justify-content: center; padding: 7px 10px; }
.cug-google { background: linear-gradient(90deg, var(--neon), var(--neon2)); color: #06121a; border: 0; }
.cug-google:hover { color: #06121a; box-shadow: 0 0 16px rgba(34,211,238,.4); }
.cug-user { font-weight: 700; font-size: .85rem; color: var(--neon); padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 10px; max-width: 160px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cug-user:hover { border-color: var(--neon); }
.cug-lb-panel {
  position: fixed; top: 0; right: 0; width: min(320px, 100vw); height: 100vh; z-index: 50;
  background: var(--card); border-left: 1px solid var(--line); padding: 20px;
  transform: translateX(100%); transition: transform .25s ease; overflow-y: auto;
}
.cug-lb-panel.open { transform: translateX(0); box-shadow: -12px 0 40px rgba(0,0,0,.5); }
.cug-lb-panel h2 { font-size: 1rem; margin-bottom: 14px; padding-right: 26px; }
.cug-lb-close {
  position: absolute; top: 14px; right: 14px; width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; font-size: 1rem; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.cug-lb-close:hover { color: var(--neon); border-color: var(--neon); }
.cug-lb-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  font-size: .88rem; border-bottom: 1px solid var(--line);
}
.cug-lb-row .r { width: 28px; text-align: center; font-weight: 800; }
.cug-lb-row .flag { width: 20px; text-align: center; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cug-flag {
  width: 20px; height: 15px; object-fit: cover; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12); vertical-align: middle;
}
.cug-lb-row .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cug-lb-row .s { color: var(--gold); font-weight: 700; }
.cug-lb-note { margin-top: 12px; font-size: .78rem; color: var(--muted); }

/* ---------- login gate ---------- */
.cug-gate {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(10,14,23,.72); backdrop-filter: blur(6px); padding: 20px;
}
.cug-gate-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 34px 30px; max-width: 380px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.cug-gate-box .gicon { font-size: 2.4rem; margin-bottom: 10px; }
.cug-gate-box h2 { font-size: 1.25rem; margin-bottom: 10px; }
.cug-gate-box p { color: var(--muted); font-size: .9rem; line-height: 1.55; margin-bottom: 20px; }
.cug-gate-box .gbtn { display: flex; justify-content: center; margin-bottom: 16px; min-height: 40px; }
.cug-gate-box .ghome { font-size: .82rem; font-weight: 700; color: var(--muted); }
.cug-gate-box .ghome:hover { color: var(--neon); }

/* ---------- home search & plays ---------- */
.searchbar { display: flex; justify-content: center; margin: 8px 0 4px; }
.searchbar input {
  width: min(460px, 100%); padding: 12px 18px; border-radius: 12px; outline: none;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  font: 600 .95rem 'Segoe UI', sans-serif;
}
.searchbar input:focus { border-color: var(--neon); box-shadow: 0 0 14px rgba(34,211,238,.25); }
.card .plays { font-size: .74rem; color: var(--muted); }
.card .plays b { color: var(--neon); }

/* ---------- profile / admin ---------- */
.panel-page { max-width: 760px; margin: 0 auto; padding: 30px 20px 60px; }
.profile-back { display: inline-block; margin-bottom: 16px; }
.panel-page h1 { font-size: 1.5rem; margin-bottom: 6px; }
.panel-page .sub { color: var(--muted); margin-bottom: 24px; font-size: .9rem; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; margin-bottom: 18px;
}
.panel h2 { font-size: 1rem; margin-bottom: 14px; }
.uname-row { display: flex; gap: 10px; flex-wrap: wrap; }
.uname-row input {
  flex: 1; min-width: 180px; padding: 11px 14px; border-radius: 10px; outline: none;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  font: 700 .95rem 'Segoe UI', sans-serif;
}
.uname-row input:focus { border-color: var(--neon); }
.btn-primary {
  font: 800 .85rem 'Segoe UI', sans-serif; letter-spacing: .5px; cursor: pointer;
  background: linear-gradient(90deg, var(--neon), var(--neon2)); color: #06121a;
  border: 0; border-radius: 10px; padding: 11px 22px;
}
.stat-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stat-table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: .88rem; }
.stat-table th { text-align: left; color: var(--muted); font-size: .74rem;
  text-transform: uppercase; letter-spacing: 1px; padding: 8px 10px; }
.stat-table td { padding: 10px; border-top: 1px solid var(--line); }
.stat-table .num { text-align: right; font-weight: 700; }
.stat-table .rank { color: var(--gold); font-weight: 800; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tile .v { font-size: 1.6rem; font-weight: 900; color: var(--neon); }
.tile .l { font-size: .75rem; color: var(--muted); margin-top: 4px; letter-spacing: 1px; }
.msg-note { color: var(--muted); font-size: .88rem; }
.msg-note a { color: var(--neon); }

/* ---------- favorite games (profile) ---------- */
.fav-list { display: flex; flex-direction: column; gap: 8px; }
.fav-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--line); transition: border-color .15s;
}
.fav-row:hover { border-color: var(--neon); }
.fav-row .fav-icon { font-size: 1.3rem; width: 30px; text-align: center; }
.fav-row .fav-name { flex: 1; font-weight: 700; font-size: .92rem; }
.fav-row .fav-play { font-size: .74rem; font-weight: 800; letter-spacing: 1px; color: var(--neon); }
.fav-unpin {
  background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 8px;
  width: 28px; height: 28px; cursor: pointer; font-size: .85rem; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.fav-unpin:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- donate button ---------- */
.cug-donate-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 45;
  display: flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-radius: 999px; border: none; cursor: pointer;
  font: 800 .88rem 'Segoe UI', sans-serif; letter-spacing: .3px; white-space: nowrap;
  color: #3a0a12; background: linear-gradient(90deg, var(--gold), var(--danger));
  box-shadow: 0 6px 24px rgba(251,113,133,.35);
  animation: cugDonatePulse 2.6s ease-in-out infinite;
  transition: transform .15s, box-shadow .15s;
}
.cug-donate-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 32px rgba(251,113,133,.55);
}
.cug-donate-btn .heart { font-size: 1.1rem; line-height: 1; }
@keyframes cugDonatePulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(251,113,133,.35), 0 0 0 0 rgba(251,191,36,.45); }
  50% { box-shadow: 0 6px 24px rgba(251,113,133,.5), 0 0 0 9px rgba(251,191,36,0); }
}
@media (max-width: 680px) {
  .cug-donate-btn { right: 14px; bottom: 14px; padding: 14px; border-radius: 50%; }
  .cug-donate-btn .label { display: none; }
  .cug-donate-btn .heart { font-size: 1.3rem; }
}

/* ---------- mobile ---------- */
@media (max-width: 680px) {
  header.site .wrap { flex-direction: column; }
  .tag-hard, header.site #cug-auth { margin-left: 0; }

  .hero { padding: 36px 0 26px; }
  .hero p { font-size: .95rem; }

  .game-top { justify-content: center; }
  .game-top .best { margin-left: 0; }

  .cug-lb-panel { width: 100vw; }

  .panel-page { padding: 24px 16px 50px; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

