/* ===========================================================
   Botgem Game Hub — giao diện dùng chung (theme + nav + auth)
   =========================================================== */
:root {
  --bg-0: #0b1020;
  --bg-1: #111936;
  --bg-2: #161f44;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #eef2ff;
  --muted: #9aa7c7;
  --muted-2: #6b78a0;

  --brand: #7c5cff;
  --brand-2: #20d0ff;
  --brand-grad: linear-gradient(135deg, #7c5cff 0%, #20d0ff 100%);
  --gold: #ffce4a;
  --green: #28d17c;
  --red: #ff5d6c;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(2, 6, 23, 0.55);
  --glow: 0 0 0 1px rgba(124, 92, 255, 0.4), 0 12px 40px rgba(124, 92, 255, 0.25);
  --nav-h: 64px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html, body { min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(1000px 600px at 100% 0%, rgba(32, 208, 255, 0.15), transparent 55%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 60%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Navbar (desktop) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.5px;
}
.nav-brand .logo-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--brand-grad);
  box-shadow: var(--glow);
  font-size: 19px;
}
.nav-brand b { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 10px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 15px;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active { background: var(--surface-2); color: var(--text); }

.nav-spacer { flex: 1; }

/* ---------- Auth chip ---------- */
.auth-area { display: flex; align-items: center; gap: 10px; }
.btn-google {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px; border-radius: 11px;
  background: #fff; color: #1f2330; font-weight: 700; font-size: 14px;
  border: none; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.btn-google svg { width: 18px; height: 18px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 7px 5px 5px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; position: relative;
}
.user-chip img, .user-chip .avatar-fallback {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  background: var(--brand-grad); display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #fff;
}
.user-chip .uc-name { font-weight: 600; font-size: 14px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .uc-caret { color: var(--muted); font-size: 11px; }

.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 200px; padding: 8px;
  background: #141b34; border: 1px solid var(--border-strong);
  border-radius: 14px; box-shadow: var(--shadow);
  display: none; flex-direction: column; gap: 2px;
}
.user-menu.open { display: flex; }
.user-menu .um-head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu .um-head .nm { font-weight: 700; }
.user-menu .um-head .em { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.user-menu a, .user-menu button {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: 9px;
  background: none; border: none; color: var(--text);
  font: inherit; font-size: 14px; cursor: pointer; text-align: left; width: 100%;
}
.user-menu a:hover, .user-menu button:hover { background: var(--surface-2); }
.user-menu .danger { color: var(--red); }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px;
  font-family: var(--font); font-weight: 700; font-size: 15px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-lg { padding: 15px 26px; font-size: 16px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  :root { --nav-h: 58px; }
  .nav-links { display: none; }            /* chuyển xuống bottom-nav */
  .nav-brand { font-size: 17px; }
  .user-chip .uc-name { display: none; }
  .btn-google span { display: none; }
  .btn-google { padding: 9px 11px; }

  body { padding-bottom: 70px; }            /* chừa chỗ cho bottom-nav */

  .bottom-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: 64px;
    background: rgba(11, 16, 32, 0.94);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 11px; font-weight: 600;
  }
  .bottom-nav a .bn-ico { font-size: 21px; line-height: 1; }
  .bottom-nav a.active { color: var(--brand-2); }
}
