:root {
  --bg: #0a0a12;
  --bg-2: #10101d;
  --panel: #161628;
  --panel-2: #1d1d33;
  --border: #2a2a45;
  --text: #eef0ff;
  --muted: #9aa0c0;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-hot: #ff4d6d;
  --good: #34d399;
  --danger: #ff5470;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
  --maxw: 1160px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(124,92,255,.18), transparent 60%),
              radial-gradient(900px 500px at 0% 0%, rgba(34,211,238,.10), transparent 55%),
              var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }
.muted { color: var(--muted); }
.main { flex: 1; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10,10,18,.72);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0a12; font-weight: 900; font-size: 15px; letter-spacing: -.5px;
  box-shadow: 0 4px 16px rgba(124,92,255,.5);
}
.brand-name { letter-spacing: -.3px; }
.brand-accent { color: var(--accent); }
.topnav { display: flex; gap: 20px; margin-left: 6px; }
.topnav a { color: var(--muted); font-weight: 600; font-size: 15px; transition: color .15s; }
.topnav a:hover, .topnav a.active { color: var(--text); }
.topbar-auth { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--panel-2);
  border: 1px solid var(--border); font-size: 14px; font-weight: 600; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: border-color .15s, color .15s;
}
a.user-chip:hover { border-color: var(--accent); color: var(--accent); }
.inline { display: inline; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 14.5px;
  cursor: pointer; border: 1px solid transparent; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s;
  font-family: inherit; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #9b7bff); color: #fff; box-shadow: 0 6px 20px rgba(124,92,255,.4); }
.btn-primary:hover { box-shadow: 0 8px 26px rgba(124,92,255,.55); }
.btn-ghost { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-admin { background: rgba(34,211,238,.12); color: var(--accent-2); border-color: rgba(34,211,238,.4); }
.btn-admin:hover { background: rgba(34,211,238,.2); }
.btn-danger { background: rgba(255,84,112,.12); color: var(--danger); border-color: rgba(255,84,112,.4); }
.btn-danger:hover { background: rgba(255,84,112,.22); }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Flash / banners ---------- */
.flash { max-width: var(--maxw); margin: 14px auto 0; padding: 12px 18px; border-radius: 10px; font-weight: 600; }
.flash-success { background: rgba(52,211,153,.14); color: var(--good); border: 1px solid rgba(52,211,153,.35); }
.flash-error { background: rgba(255,84,112,.14); color: var(--danger); border: 1px solid rgba(255,84,112,.35); }
.verify-banner { background: rgba(124,92,255,.14); color: #c7b8ff; text-align: center; padding: 10px 18px; font-size: 14px; border-bottom: 1px solid var(--border); }

/* ---------- Hero ---------- */
.hero { position: relative; text-align: center; padding: 120px 22px 130px; overflow: hidden; }
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 50% 20%, rgba(124,92,255,.35), transparent 70%);
}
.hero-content { position: relative; max-width: 820px; margin: 0 auto; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: 4px; font-size: 12.5px; color: var(--accent-2); font-weight: 700; margin: 0 0 18px; }
.hero-title { font-size: clamp(40px, 7vw, 76px); font-weight: 900; letter-spacing: -2px; margin: 0 0 20px; }
.grad { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(16px, 2.2vw, 20px); color: var(--muted); max-width: 620px; margin: 0 auto 34px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.scroll-cue { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 14px; display: grid; place-items: start center; padding-top: 8px; }
.scroll-cue span { width: 4px; height: 8px; background: var(--accent-2); border-radius: 2px; animation: scroll 1.5s infinite; }
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- Sections ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 40px 22px 80px; }
.container.narrow { max-width: 780px; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: 34px; font-weight: 800; }

/* Games "barrier" band — a separate raised surface below the hero */
.games-section {
  position: relative;
  margin-top: 24px;
  background: linear-gradient(180deg, #0c0c19, var(--bg-2) 240px);
  border-top: 1px solid var(--border);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -30px 60px rgba(0,0,0,.5);
}
/* glowing divider line across the top edge of the band */
.games-section::before {
  content: "";
  position: absolute; top: -1px; left: 8%; right: 8%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  filter: blur(.3px);
  opacity: .8;
}
.games-inner { max-width: var(--maxw); margin: 0 auto; padding: 66px 22px 90px; }

/* ---------- Games grid (square buttons) ---------- */
.games-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; max-width: 860px; margin: 0 auto; }
.game-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.game-card-img {
  aspect-ratio: 1 / 1; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, var(--panel-2), var(--panel));
  padding: 26px; position: relative;
}
.game-card-img img { max-width: 78%; max-height: 78%; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0,0,0,.4)); }
.game-card-initial { font-size: 68px; font-weight: 900; color: var(--accent); }
.game-card-body { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; }
.game-card-body { padding: 18px 20px; }
.game-card-title { font-weight: 800; font-size: 20px; }
.game-card-count { font-size: 14px; color: var(--muted); font-weight: 600; }
.game-card-add { border-style: dashed; }
.game-card-add .plus { font-size: 56px; color: var(--muted); font-weight: 300; }
.game-card-add:hover .plus { color: var(--accent); }

/* ---------- Page head ---------- */
.page-head { border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(124,92,255,.06), transparent); }
.page-head-inner { max-width: var(--maxw); margin: 0 auto; padding: 34px 22px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.page-head-icon { width: 74px; height: 74px; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.page-head-icon img { max-width: 72%; max-height: 72%; object-fit: contain; }
.page-head-icon span { font-size: 34px; font-weight: 900; color: var(--accent); }
.page-head h1 { font-size: 30px; font-weight: 800; }
.page-head-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumbs a:hover { color: var(--text); }
.crumbs span { opacity: .5; margin: 0 4px; }

/* ---------- Product grid & page ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.product-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s; }
.product-card:hover { transform: translateY(-4px); border-color: var(--accent-2); box-shadow: var(--shadow); }
.product-card-img { aspect-ratio: 16 / 9; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-img span { font-size: 44px; font-weight: 900; color: var(--muted); }
.product-card-body { padding: 16px; }
.product-card-body h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.price { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; background: rgba(52,211,153,.14); color: var(--good); font-weight: 700; font-size: 13px; }
.price-lg { font-size: 18px; padding: 5px 14px; margin-top: 10px; }

.guide { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 34px; }
.guide-summary { font-size: 18px; color: var(--text); font-weight: 600; margin-bottom: 18px; }
.guide-body { white-space: pre-wrap; word-wrap: break-word; color: #d7dbf5; font-size: 15.5px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--panel); }
.empty p { color: var(--muted); margin-bottom: 16px; font-size: 16px; }

/* ---------- Forms ---------- */
.form label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 16px; }
.form input, .form textarea {
  width: 100%; margin-top: 7px; padding: 12px 14px; font-size: 15px; font-family: inherit;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.2); }
.form textarea { resize: vertical; line-height: 1.6; }
.hint { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.form small.hint { display: inline; margin-left: 4px; }
.card-form { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 30px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

/* ---------- Dropzone ---------- */
.dropzone { margin: 7px 0 4px; border: 2px dashed var(--border); border-radius: 12px; background: var(--bg-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone.dragover { border-color: var(--accent); background: rgba(124,92,255,.08); }
.dropzone-inner { min-height: 150px; display: grid; place-items: center; padding: 18px; text-align: center; }
.dropzone-prompt .dz-icon { font-size: 30px; display: block; margin-bottom: 6px; color: var(--accent); }
.dropzone-prompt p { margin: 0 0 4px; font-weight: 600; }
.dropzone-prompt .link { color: var(--accent); text-decoration: underline; }
.dropzone-preview { max-width: 100%; max-height: 220px; border-radius: 8px; object-fit: contain; }

/* ---------- Auth ---------- */
.auth-wrap { display: grid; place-items: center; padding: 70px 22px; min-height: 60vh; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px 32px; box-shadow: var(--shadow); }
.auth-card.center { text-align: center; }
.auth-card h1 { font-size: 26px; font-weight: 800; }
.auth-card .form { margin-top: 22px; }
.auth-alt { margin-top: 18px; font-size: 14px; color: var(--muted); text-align: center; }
.auth-alt a { color: var(--accent); font-weight: 700; }
.dev-note { margin-top: 20px; padding: 18px; border: 1px dashed var(--accent); border-radius: 12px; background: rgba(124,92,255,.07); }
.dev-note p { margin: 0 0 12px; font-size: 14px; }

/* ---------- Admin ---------- */
.admin-h2 { font-size: 22px; margin-bottom: 18px; }
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-row { display: flex; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.admin-row-icon { width: 52px; height: 52px; border-radius: 10px; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.admin-row-icon img { max-width: 78%; max-height: 78%; object-fit: contain; }
.admin-row-icon span { font-weight: 900; color: var(--accent); font-size: 22px; }
.admin-row-main { display: flex; flex-direction: column; }
.admin-row-title { font-weight: 800; font-size: 16px; }
.admin-row-title:hover { color: var(--accent); }
.admin-row-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Account ---------- */
.account-page .card-form { margin-bottom: 22px; }
.account-page .admin-h2 { font-size: 19px; margin-bottom: 16px; }
.badge { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; vertical-align: middle; }
.badge-good { background: rgba(52,211,153,.14); color: var(--good); border: 1px solid rgba(52,211,153,.35); }
.badge-warn { background: rgba(255,84,112,.14); color: var(--danger); border: 1px solid rgba(255,84,112,.35); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); margin-top: auto; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 40px 22px 20px; display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-inner .brand-name { font-size: 20px; font-weight: 800; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--text); }
.footer-legal { text-align: center; padding: 0 22px 26px; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .topnav { display: none; }
  .hero { padding: 80px 20px 100px; }
  .games-grid { grid-template-columns: 1fr; }
  .page-head-actions { margin-left: 0; width: 100%; }
  .admin-row { flex-wrap: wrap; }
  .admin-row-actions { margin-left: 0; width: 100%; }
}

/* Checkbox row (admin script/key forms) */
.checkrow { display: flex; align-items: center; gap: 0.6rem; flex-direction: row; cursor: pointer; }
.checkrow input[type="checkbox"] { width: 1.05rem; height: 1.05rem; margin: 0; flex: 0 0 auto; accent-color: var(--accent, #6c5ce7); }
.checkrow span { font-weight: 500; }
.form.card-form textarea[spellcheck="false"] { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.82rem; line-height: 1.45; }
