/* ─────────────────────────────────────────────────────────────────────────
   engame hub — steel-blue + gold "game platform" theme (matches the logo).
   ───────────────────────────────────────────────────────────────────────── */
:root, html[data-theme="dark"] {
  --bg-0:   #080b12;
  --bg-1:   #0e1626;
  --panel:  rgba(18, 26, 42, 0.72);
  --panel-2:rgba(24, 34, 54, 0.92);
  --line:   rgba(110, 162, 224, 0.16);
  --line-2: rgba(110, 162, 224, 0.30);
  --steel:  #6ea2e0;
  --steel-d:#3f6bb0;
  --gold:   #e9a23a;
  --gold-l: #f4c878;
  --text:   #e8eef8;
  --muted:  #93a3bb;
  --danger: #f0683a;
  --ok:     #4ad6a0;
  --input-bg: rgba(8, 12, 20, 0.7);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --body-bg:
    radial-gradient(1100px 700px at 78% -8%, rgba(233, 162, 58, 0.10), transparent 60%),
    radial-gradient(1000px 760px at 10% 110%, rgba(63, 107, 176, 0.18), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-0) 70%);
  --r:      16px;
  /* Google Sans (now on Google Fonts, with a Thai subset → covers Latin + Thai). */
  --thai:   'Google Sans', 'Noto Sans Thai', system-ui, sans-serif;
  --disp:   'Oxanium', var(--thai);
}
html[data-theme="light"] {
  --bg-0:   #e6ecf6;
  --bg-1:   #f6f8fc;
  --panel:  rgba(255, 255, 255, 0.80);
  --panel-2:rgba(255, 255, 255, 0.97);
  --line:   rgba(40, 74, 130, 0.16);
  --line-2: rgba(40, 74, 130, 0.32);
  --steel:  #3f6bb0;
  --steel-d:#2e5494;
  --gold:   #cf8413;
  --gold-l: #e7a838;
  --text:   #16203a;
  --muted:  #5a6a85;
  --danger: #d2452a;
  --ok:     #1f9b6e;
  --input-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 16px 44px rgba(40, 74, 130, 0.18);
  --body-bg:
    radial-gradient(1100px 700px at 80% -10%, rgba(233, 162, 58, 0.14), transparent 60%),
    radial-gradient(1000px 760px at 8% 110%, rgba(63, 107, 176, 0.16), transparent 60%),
    linear-gradient(160deg, #ffffff, #e7eef8 75%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--thai);
  color: var(--text);
  background: var(--body-bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: color 0.2s, background 0.2s;
}
.screen { position: fixed; inset: 0; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ── Boot spinner ────────────────────────────────────────── */
#boot { display: grid; place-items: center; background: var(--bg-0); z-index: 50; }
.boot-spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(110, 162, 224, 0.2);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth screen ─────────────────────────────────────────── */
#auth { display: grid; place-items: center; padding: 24px; z-index: 30; }
.bg-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background-image:
    linear-gradient(rgba(110, 162, 224, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 162, 224, 0.07) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(closest-side at 50% 42%, #000 60%, transparent);
}
.bg-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(620px 360px at 50% 30%, rgba(233, 162, 58, 0.14), transparent 70%);
}
.auth-card {
  position: relative; width: min(420px, 92vw);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 34px 30px 26px;
  box-shadow: var(--shadow); backdrop-filter: blur(14px);
  text-align: center;
  animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.brand-logo { width: min(260px, 70%); height: auto; display: block; margin: 0 auto 12px;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.5)); }
.brand-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; line-height: 1.5; }

.tabs { display: flex; gap: 6px; background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line); padding: 5px; border-radius: 12px; margin-bottom: 18px; }
.tab { flex: 1; padding: 9px 0; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 14px; transition: 0.18s; }
.tab.active { background: linear-gradient(180deg, var(--steel), var(--steel-d));
  color: #fff; box-shadow: 0 4px 14px rgba(63, 107, 176, 0.45); }

.auth-form { display: grid; gap: 11px; }
.auth-form input {
  width: 100%; padding: 13px 15px; border-radius: 11px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--line); font-size: 15px; transition: 0.16s;
}
.auth-form input::placeholder { color: #5e6c82; }
.auth-form input:focus { outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(233, 162, 58, 0.16); }

.btn-primary {
  margin-top: 4px; padding: 13px; border: 0; border-radius: 11px;
  font-weight: 700; font-size: 15.5px; color: #2a1a05;
  background: linear-gradient(180deg, var(--gold-l), var(--gold));
  box-shadow: 0 8px 22px rgba(233, 162, 58, 0.35); transition: 0.16s;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); }

.auth-msg { min-height: 20px; margin-top: 14px; font-size: 13.5px; color: var(--danger); }
.auth-msg.ok { color: var(--ok); }

/* ── Topbar (launcher) ───────────────────────────────────── */
#home { display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 22, 38, 0.92), rgba(14, 22, 38, 0.6));
  backdrop-filter: blur(10px); z-index: 5;
}
.topbar-logo { height: 34px; width: auto; }
.topbar-spacer { flex: 1; }
.wallet-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 15px;
  color: var(--gold-l);
  background: rgba(233, 162, 58, 0.10); border: 1px solid rgba(233, 162, 58, 0.4);
  box-shadow: inset 0 0 18px rgba(233, 162, 58, 0.08);
}
.wallet-pill .coin { width: 19px; height: 19px; display: block; object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font-weight: 600; font-size: 14px;
}
.user-btn:hover { border-color: var(--line-2); }
.user-avatar { display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: linear-gradient(180deg, var(--steel), var(--steel-d)); font-size: 15px; overflow: hidden; }
.user-avatar.has-img { background: none; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 220px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; box-shadow: var(--shadow); z-index: 20;
}
.up-name { font-weight: 700; }
.up-email { color: var(--muted); font-size: 12.5px; margin: 2px 0 12px; word-break: break-all; }
.up-menu-list { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--line); }
.up-logout { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px; border: 1px solid rgba(240, 104, 58, 0.35);
  background: rgba(240, 104, 58, 0.10); color: #ffb59c; border-radius: 10px; font-weight: 600; font-size: 13.5px; }
.up-logout:hover { background: rgba(240, 104, 58, 0.18); }

/* ── Home main ───────────────────────────────────────────── */
.home-main { flex: 1; overflow-y: auto; padding: 38px 26px 120px; }
.home-hero { max-width: 1100px; margin: 0 auto 26px; }
.home-hero h1 { font-family: var(--disp); font-size: clamp(24px, 4vw, 36px); font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(180deg, #fff, var(--steel)); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { color: var(--muted); margin-top: 8px; font-size: 14.5px; max-width: 640px; line-height: 1.6; }

.game-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.grid-empty { color: var(--muted); }

.game-card {
  position: relative; text-align: left; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0; min-height: 240px;
  border-radius: var(--r); color: var(--text);
  border: 1px solid var(--line);
  background:
    radial-gradient(420px 180px at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--panel);
  box-shadow: var(--shadow); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.game-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; z-index: 3;
  background: var(--accent);
}
.game-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.game-card.launching { opacity: 0.6; pointer-events: none; }

/* Cover art (games/<slug>/media/logo.png) fills the card; a bottom scrim keeps
   the title/tagline/button readable. Cards without art fall back (.no-cover). */
.gc-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  z-index: 0; transition: transform 0.3s ease; }
.game-card:hover .gc-cover { transform: scale(1.04); }
.gc-scrim { position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(8,11,18,0.97) 12%, rgba(8,11,18,0.55) 44%, rgba(8,11,18,0.04) 100%); }
.game-card.no-cover .gc-scrim { display: none; }

.gc-body { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 20px 18px; }
.gc-icon { font-size: 40px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.gc-icon img { width: 40px; height: 40px; object-fit: contain; }
/* On cover-art cards the key art already shows the icon + title, so hide the
   redundant overlay versions and let the art speak. */
.game-card:not(.no-cover) .gc-icon,
.game-card:not(.no-cover) .gc-name { display: none; }
.gc-name { font-family: var(--disp); font-size: 21px; font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
/* #cdd7e8 is tuned for the dark scrim behind cover art — always dark
   regardless of theme, so a fixed light color is correct there. Cards with
   no cover art have no scrim (see .no-cover rule above), so the tagline sits
   directly on the theme panel color instead — needs to track the theme. */
.gc-tagline { color: #cdd7e8; font-size: 13px; line-height: 1.5; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
.game-card.no-cover .gc-tagline { color: var(--muted); text-shadow: none; }
.gc-play { align-self: flex-start; margin-top: 10px; font-weight: 700; font-size: 13.5px;
  color: var(--accent); padding: 7px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, rgba(8,11,18,0.6));
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  backdrop-filter: blur(2px); }
.game-card:hover .gc-play { background: var(--accent); color: #14110a; }

/* ── Chat dock ───────────────────────────────────────────── */
.chat-dock {
  position: fixed; right: 22px; bottom: 22px; width: min(360px, 92vw); z-index: 15;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); backdrop-filter: blur(12px); overflow: hidden;
  display: flex; flex-direction: column; max-height: 460px;
}
.chat-toggle {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 13px 16px; border: 0; background: transparent; color: var(--text);
  font-weight: 700; font-size: 14.5px;
}
.chat-toggle-ico { font-size: 18px; }
.chat-toggle-label { flex: 1; text-align: left; }
.chat-badge { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; }
.chat-dock.collapsed .chat-body { display: none; }
.chat-dock.collapsed { width: auto; }

.chat-body { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column;
  gap: 8px; min-height: 220px; max-height: 320px; }
.chat-msg { max-width: 86%; align-self: flex-start; padding: 7px 11px; border-radius: 12px;
  background: rgba(110, 162, 224, 0.12); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; }
.chat-msg.mine { align-self: flex-end; background: rgba(233, 162, 58, 0.14);
  border-color: rgba(233, 162, 58, 0.35); }
.chat-msg.system { align-self: center; background: rgba(255, 255, 255, 0.05);
  border-style: dashed; color: var(--steel); font-size: 12.5px; text-align: center; }
.cm-who { display: block; font-size: 11px; font-weight: 700; color: var(--steel); margin-bottom: 2px; }
.cm-body { word-wrap: break-word; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; padding: 10px 13px; border-radius: 10px; font-size: 14px;
  background: var(--input-bg); border: 1px solid var(--line); color: var(--text); }
.chat-form input:focus { outline: none; border-color: var(--gold); }
.chat-form button { width: 42px; border: 0; border-radius: 10px; color: #2a1a05; font-size: 15px;
  background: linear-gradient(180deg, var(--gold-l), var(--gold)); }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 560px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar-logo { height: 28px; }
  .user-btn #user-name { display: none; }
  .home-main { padding: 24px 16px 110px; }
  .chat-dock { right: 12px; bottom: 12px; left: 12px; width: auto; }
}

/* ── Theme toggle + admin button + light-theme touch-ups ──────────────────── */
.topbar-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 18px; line-height: 1;
  display: grid; place-items: center; transition: border-color .15s, transform .08s;
}
.topbar-btn:hover { border-color: var(--line-2); }
.topbar-btn:active { transform: scale(.92); }
.lang-btn { width: auto; min-width: 40px; padding: 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .3px; }
html[data-theme="light"] .topbar { background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.55)); }
html[data-theme="light"] .tabs { background: rgba(40,74,130,.06); }
html[data-theme="light"] .up-logout { color: #b23a1c; }
html[data-theme="light"] .auth-form input::placeholder { color: #8593a8; }

.up-admin { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 9px;
  border: 1px solid transparent; background: transparent; color: var(--text);
  border-radius: 10px; font-weight: 600; font-size: 13.5px; text-align: left; }
.up-admin .ttl-ico { flex: 0 0 auto; width: 30px; height: 30px; padding: 6px; margin-right: 0;
  border-radius: 9px; background: var(--panel); box-sizing: border-box;
  display: grid; place-items: center; font-size: 17px; }
.up-admin:hover { background: var(--panel); border-color: var(--line); }
.up-admin:hover .ttl-ico { background: var(--panel-2); }
.up-admin .fr-badge { margin-left: auto; }
.up-admin#btn-admin .ttl-ico { background: color-mix(in srgb, var(--gold) 20%, var(--panel)); }

/* ── Flaticon icon font ──────────────────────────────────────────────────────
   All hub chrome icons are uicons-regular-rounded glyphs (see src/icons.js).
   They colour with currentColor and scale with font-size. */
i.fi { font-style: normal; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center; }
i.fi::before { line-height: 1; }
/* Icon that fronts a title/label/button — scales with the adjacent text. */
.ttl-ico { font-size: 1.05em; vertical-align: -0.14em; margin-right: 3px; }
.topbar-ico { font-size: 18px; }
/* Context sizes/colours for standalone glyph icons. */
.wallet-pill i.coin { font-size: 18px; color: var(--gold); }
.user-avatar i.fi { font-size: 17px; color: var(--muted); }
.stat-ico i.fi { font-size: 24px; }
.as-ico i.fi { font-size: 26px; }
.pf-pic i.fi { font-size: 44px; color: var(--muted); }
.pf-check i.fi { font-size: 12px; }
.gc-icon i.fi { font-size: 40px; }
.topup-tile-ico i.fi { color: var(--gold); }
.asr-thumb.pkg-thumb i.fi { font-size: 26px; color: var(--gold); }

/* ── Slides carousel ─────────────────────────────────────────────────────── */
.slides { max-width: 1100px; margin: 0 auto 26px; }
.slides-track { display: grid; border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow); }
/* All slides occupy the same grid cell (stacked); we crossfade with opacity so
   every slide is laid out + painted from the start — no blank "revealed" slide. */
.slide { grid-area: 1 / 1; position: relative; min-height: 250px;
  background-color: var(--panel-2);
  background-image: radial-gradient(140% 160% at 100% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  border: 1px solid var(--line); display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none; z-index: 0; transition: opacity .55s ease; }
.slide.on { opacity: 1; pointer-events: auto; z-index: 1; }
.slide::before { content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8,11,18,.9), rgba(8,11,18,.25) 55%, rgba(8,11,18,0) 88%); }
.slide-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.slide-inner { position: relative; z-index: 1; padding: 30px 34px; max-width: 74%; }
.slide-title { font-family: var(--disp); font-size: clamp(20px, 3vw, 30px); font-weight: 800;
  color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.slide-sub { color: #dde5f2; margin-top: 8px; line-height: 1.6; font-size: 14.5px;
  text-shadow: 0 1px 8px rgba(0,0,0,.85); }
.slide-cta { margin-top: 16px; padding: 10px 22px; border: 0; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: #14110a; background: var(--accent);
  box-shadow: 0 8px 22px rgba(0,0,0,.4); transition: .15s; }
.slide-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.slides-dots { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.slide-dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0;
  background: var(--line-2); cursor: pointer; transition: .25s; }
.slide-dot.on { background: var(--gold); width: 24px; border-radius: 6px; }

/* ── Stats strip ─────────────────────────────────────────────────────────── */
.stats { max-width: 1100px; margin: 0 auto 28px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 18px; box-shadow: var(--shadow); }
.stat-ico { font-size: 21px; }
.stat-ico img { width: 24px; height: 24px; object-fit: contain; }
.stat-val { font-family: var(--disp); font-size: 26px; font-weight: 800; color: var(--text); margin-top: 2px; }
.stat-label { color: var(--muted); font-size: 12.5px; }

/* ── Admin panel ─────────────────────────────────────────────────────────── */
.admin-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: 20px; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
.admin-card { width: min(680px, 96vw); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden; }
.admin-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.admin-title { font-family: var(--disp); font-weight: 800; font-size: 18px; flex: 1; color: var(--text); }
.admin-close { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 15px; }
.admin-tabs { display: flex; gap: 6px; padding: 12px 16px 0; }
.admin-tab { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--muted); font-weight: 600; font-size: 14px; }
.admin-tab.sel { background: linear-gradient(180deg, var(--steel), var(--steel-d)); color: #fff; border-color: transparent; }
.admin-body { padding: 16px; overflow-y: auto; }
.admin-loading, .admin-empty { color: var(--muted); padding: 22px; text-align: center; }

/* ── Friends panel ──────────────────────────────────────────────────────── */
.fr-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 4px; border-radius: 9px; background: #ff5d6c; color: #fff; font-size: 11px; font-weight: 800; }
.fr-card { width: min(520px, 96vw); }
.fr-add-row { display: flex; gap: 8px; }
.fr-add-input { flex: 1 1 auto; min-width: 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--input-bg); color: var(--text); font-family: inherit; font-size: 14px; }
.fr-add-input:focus { outline: none; border-color: var(--steel); }
.fr-add-btn { flex: 0 0 auto; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  background: linear-gradient(180deg, var(--steel), var(--steel-d)); color: #fff; font-weight: 700; font-size: 13.5px; font-family: inherit; }
.fr-add-btn:hover { filter: brightness(1.06); }
.fr-add-btn:disabled { opacity: .6; }
.fr-add-hint { color: var(--muted); font-size: 12px; margin: 6px 2px 14px; }
.fr-head { font-size: 13px; font-weight: 700; color: var(--ember-2, #ffb07a); margin: 14px 2px 8px; }
.fr-head:first-child { margin-top: 2px; }
.fr-empty { color: var(--muted); padding: 10px 2px; font-size: 14px; }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 8px; }
.fr-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--ember, #ff7a3c), var(--ember-2, #ffb07a)); }
.fr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fr-info { flex: 1 1 auto; min-width: 0; }
.fr-name { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-sub { font-size: 12px; color: var(--muted); }
.fr-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.fr-btn { padding: 7px 12px; border-radius: 9px; border: 0; cursor: pointer; font-size: 13px; font-weight: 700;
  font-family: inherit; }
.fr-btn.ok { background: linear-gradient(180deg, #56c46a, #3da354); color: #08240f; }
.fr-btn.no { background: var(--panel); color: var(--muted); border: 1px solid var(--line-2); }
.fr-btn:hover { filter: brightness(1.07); }

/* ── Profile-picture picker ─────────────────────────────────────────────── */
.pf-card { width: min(460px, 96vw); }
.pf-hint { color: var(--muted); font-size: 13px; margin-bottom: 14px; line-height: 1.5; }
.pf-empty { color: var(--muted); padding: 10px 2px; font-size: 14px; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.pf-tile { position: relative; padding: 12px 8px; border-radius: 14px; cursor: pointer; font-family: inherit;
  border: 2px solid var(--line); background: var(--panel-2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pf-tile.sel { border-color: var(--ember, #ff7a3c); box-shadow: 0 0 0 3px rgba(255,122,60,.18); }
.pf-tile:hover { filter: brightness(1.06); }
.pf-pic { width: 82px; height: 82px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  font-size: 36px; background: linear-gradient(135deg, var(--ember, #ff7a3c), var(--ember-2, #ffb07a)); }
.pf-pic img { width: 100%; height: 100%; object-fit: cover; }
.pf-name { font-size: 12.5px; font-weight: 700; color: var(--text); text-align: center; }
.pf-check { position: absolute; top: 7px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ember, #ff7a3c); color: #2a1505; display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.admin-add { padding: 10px 16px; border: 1px dashed var(--line-2); border-radius: 10px;
  background: transparent; color: var(--gold-l); font-weight: 700; margin-bottom: 12px; }
.upd-hint { margin-bottom: 14px; line-height: 1.6; }
.upd-upload-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; padding: 12px;
  border: 1px dashed var(--line-2); border-radius: 12px; }
.upd-file-input { flex: 1 1 200px; min-width: 0; color: var(--text); font-size: 13px; }
.upd-note-input { flex: 1 1 220px; min-width: 0; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--input-bg); color: var(--text); font-family: inherit; font-size: 13.5px; }
.upd-note-input:focus { outline: none; border-color: var(--steel); }
.upd-check-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 16px; }
.upd-check-result { font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; }
.upd-check-result.ok { color: #4ad6a0; }
.upd-check-result.avail { color: var(--steel); font-weight: 700; }
.upd-check-result.bad { color: var(--danger); }
.admin-slide-list { display: flex; flex-direction: column; gap: 10px; }
.admin-slide-row { display: flex; align-items: center; gap: 12px; padding: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.asr-thumb { flex: 0 0 auto; width: 72px; height: 44px; border-radius: 8px; overflow: hidden;
  background: var(--accent, var(--steel)); border: 1px solid var(--line); }
.asr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asr-info { flex: 1; min-width: 0; }
.asr-title { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asr-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asr-btn { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 13px; font-weight: 600; }
.asr-btn.danger { color: var(--danger); border-color: rgba(240,104,58,.35); }
.admin-form { display: grid; gap: 12px; }
.admin-field { display: grid; gap: 5px; }
.admin-field label { font-size: 12.5px; color: var(--muted); }
.admin-field input, .admin-field select, .admin-field textarea { padding: 10px 12px; border-radius: 10px;
  background: var(--input-bg); border: 1px solid var(--line); color: var(--text); font-size: 14px; font-family: inherit; width: 100%; }
.admin-field textarea { resize: vertical; line-height: 1.6; }
.admin-field input[type=color] { height: 42px; padding: 4px; }
.admin-form-head { font-family: var(--disp); font-weight: 800; font-size: 17px; color: var(--text); margin-bottom: 4px; }
.admin-form-actions { display: flex; gap: 10px; margin-top: 6px; }
.admin-save { flex: 1; padding: 12px; border: 0; border-radius: 10px; font-weight: 700;
  color: #2a1a05; background: linear-gradient(180deg, var(--gold-l), var(--gold)); }
.admin-cancel { padding: 12px 20px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text); }
.admin-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.admin-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.as-ico { font-size: 24px; }
.as-ico img { width: 26px; height: 26px; object-fit: contain; }
.as-val { font-family: var(--disp); font-size: 28px; font-weight: 800; margin: 4px 0; color: var(--text); }
.as-label { color: var(--muted); font-size: 12.5px; }

/* ── Admin analytics report ──────────────────────────────────────────── */
.analytics { display: flex; flex-direction: column; gap: 6px; }
.analytics-range { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.analytics-range-label { color: var(--muted); font-size: 13px; }
.analytics-range-btn { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); font-size: 13px; cursor: pointer; }
.analytics-range-btn.sel { background: linear-gradient(180deg, var(--steel), var(--steel-d)); color: #fff; border-color: transparent; }
.analytics-title { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14.5px;
  color: var(--text); margin: 16px 0 4px; }
.analytics-title img { width: 17px; height: 17px; object-fit: contain; }
.analytics-select { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--input-bg); color: var(--text); font-size: 13.5px; margin-bottom: 8px; align-self: flex-start; }
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px 4px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 9.5px; font-family: var(--thai); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.chart-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.analytics-table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 13px; }
.analytics-table th, .analytics-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.analytics-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.analytics-td-game, .analytics-table th:first-child { text-align: left; color: var(--text); font-weight: 600; }

@media (max-width: 560px) {
  .slide-inner { max-width: 88%; padding: 22px; }
  .admin-tab { font-size: 12.5px; padding: 9px 4px; }
  .topbar { gap: 8px; padding: 10px 14px; }
}

/* ── Pre-login landing (promote games beside the login) ───────────────────── */
#auth { overflow-y: auto; align-items: start; padding-top: 44px; }   /* push the landing toward the top */
.landing {
  position: relative; z-index: 1; width: min(1240px, 95vw); margin: 0 auto;
  display: grid; grid-template-columns: 1.65fr 0.8fr; gap: 34px; align-items: start;
}
/* brand header sits above the grid so the login card lines up with the slides */
.landing-head { width: min(1240px, 95vw); margin: 0 auto 18px; }
.landing-head .brand-logo { width: min(280px, 60vw); margin: 0 0 10px; }
.landing-head .brand-sub { text-align: left; margin: 0; }
.landing-promo { min-width: 0; }
.landing-promo .slides { max-width: none; margin: 0 0 18px; }
.landing-promo .slide { min-height: 250px; }
.land-h { font-family: var(--disp); font-weight: 800; font-size: 16px; color: var(--text); margin: 0 0 12px; }
.land-h.hidden { display: none; }
.land-games { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.land-game {
  position: relative; overflow: hidden; text-align: left; cursor: pointer; padding: 0;
  min-height: 116px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel-2); color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end;
  box-shadow: var(--shadow); transition: transform .2s, border-color .2s;
}
.land-game:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.land-game::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); z-index: 3; }
.lg-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.land-game.no-cover .lg-cover { display: none; }
.lg-scrim { position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(8,11,18,.92), rgba(8,11,18,.2) 70%, transparent); }
.lg-name { position: relative; z-index: 2; padding: 12px 14px 2px; font-family: var(--disp);
  font-weight: 800; font-size: 16px; text-shadow: 0 1px 8px rgba(0,0,0,.8); }
.lg-tag { position: relative; z-index: 2; padding: 0 14px 12px; font-size: 11.5px; color: #dde5f2;
  text-shadow: 0 1px 6px rgba(0,0,0,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* keep the login card fixed in view while only the left promo column scrolls */
.landing .auth-card { width: 100%; max-width: 460px; margin: 0 auto; position: sticky; top: 24px; align-self: start; }
.auth-card-head { font-family: var(--disp); font-weight: 800; font-size: 17px; color: var(--text);
  text-align: center; margin-bottom: 14px; }

@media (max-width: 860px) {
  #auth { place-items: start center; padding: 22px 16px; }
  .landing { grid-template-columns: 1fr; gap: 20px; width: min(480px, 94vw); }
  .landing-head { width: min(480px, 94vw); text-align: center; }
  .landing-head .brand-logo { margin-inline: auto; }
  .landing-head .brand-sub { text-align: center; }
  .landing-promo { text-align: center; }
  .landing .auth-card { position: static; top: auto; }   /* stacked layout → no sticky */
}

/* ── Coming-soon games (shown in the list but not playable yet) ───────────── */
.soon-badge {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  background: rgba(8,11,18,.82); color: #fff; border: 1px solid var(--accent);
  font-weight: 700; font-size: 11px; padding: 4px 11px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4); letter-spacing: .3px;
}
.game-card.coming-soon, .land-game.coming-soon { cursor: default; opacity: 1; }
.game-card.coming-soon:hover, .land-game.coming-soon:hover { transform: none; box-shadow: var(--shadow); }
.game-card.coming-soon .gc-cover, .land-game.coming-soon .lg-cover { filter: grayscale(.4) brightness(.6); }
.game-card.coming-soon .gc-play {
  color: #d6deea; background: rgba(255,255,255,.07); border-color: var(--line);
}

/* Coming-soon slide CTA — visible but not actionable */
.slide-cta.soon { background: rgba(8,11,18,.72); color: #fff; border: 1px solid var(--accent); cursor: default; }
.slide-cta.soon:hover { filter: none; transform: none; }

/* ── Admin redesign: sidebar-menu backoffice ─────────────────────────────── */
.admin-card-wide { width: min(920px, 96vw); height: min(680px, 90vh); }
.admin-split { display: flex; flex: 1; min-height: 0; }
.admin-nav { flex: 0 0 200px; display: flex; flex-direction: column; gap: 4px; padding: 12px 10px;
  border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
.admin-nav-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; text-align: left;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  font-weight: 600; font-size: 13.5px; font-family: inherit; cursor: pointer; }
.admin-nav-item:hover { background: var(--panel-2); color: var(--text); }
.admin-nav-item.sel { background: linear-gradient(180deg, var(--steel), var(--steel-d)); color: #fff; }
.admin-nav-item.sel img { filter: brightness(2); }
.admin-nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: inline-grid; place-items: center; background: #ff5d6c; color: #fff; font-size: 11px; font-weight: 800; }
.admin-split .admin-body { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .admin-split { flex-direction: column; }
  .admin-nav { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
}
.pkg-thumb { display: grid; place-items: center; font-size: 22px; background: var(--panel-2); }
.asr-btn.ok { color: #4ad6a0; border-color: rgba(74,214,160,.4); }
.topup-pill { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.topup-pill.pending { background: rgba(255,176,0,.16); color: #ffb300; }
.topup-pill.ok { background: rgba(74,214,160,.16); color: #4ad6a0; }
.topup-pill.bad { background: rgba(240,104,58,.16); color: var(--danger); }
.admin-search { display: flex; gap: 8px; margin-bottom: 12px; }
.admin-search input { flex: 1; padding: 10px 12px; border-radius: 10px;
  background: var(--input-bg); border: 1px solid var(--line); color: var(--text); font-size: 14px; }

/* ── Coin top-up (user-facing) ───────────────────────────────────────────── */
.topup-btn { margin-left: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-l), var(--gold)); color: #2a1a05;
  font-weight: 900; font-size: 15px; line-height: 1; display: grid; place-items: center; }
.topup-btn:hover { filter: brightness(1.08); }
.topup-card { width: min(560px, 96vw); }
.topup-hint { color: var(--muted); font-size: 13px; margin-bottom: 14px; line-height: 1.5; }
.topup-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.topup-tile { padding: 16px 12px; border-radius: 14px; cursor: pointer; font-family: inherit; text-align: center;
  border: 2px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.topup-tile:hover { border-color: var(--gold); filter: brightness(1.05); }
.topup-tile-ico { font-size: 30px; }
.topup-tile-name { font-weight: 800; color: var(--text); font-family: var(--disp); }
.topup-tile-coins { font-weight: 700; color: var(--gold-l); }
.topup-tile-bonus { font-size: 12px; color: #4ad6a0; font-weight: 700; }
.topup-tile-price { margin-top: 4px; padding: 5px 14px; border-radius: 999px; font-weight: 800; font-size: 13.5px;
  background: linear-gradient(180deg, var(--gold-l), var(--gold)); color: #2a1a05; }
.topup-mine-head { font-size: 13px; font-weight: 700; color: var(--muted); margin: 16px 2px 8px; }
.topup-mine-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); margin-bottom: 6px; font-size: 13px; color: var(--text); }
.topup-mine-row .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Tiny hub toast ──────────────────────────────────────────────────────── */
.eg-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px);
  z-index: 90; padding: 12px 20px; border-radius: 12px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.eg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── PromptPay QR panel ──────────────────────────────────────────────────── */
.pp-qr { display: grid; place-items: center; margin: 12px 0; }
.pp-canvas { width: 232px; height: 232px; border-radius: 12px; border: 0.5px solid var(--line);
  background: #fff; }
.pp-line { text-align: center; color: var(--text); font-size: 14px; margin-top: 4px; }
.pp-amount { font-weight: 800; font-size: 18px; color: var(--gold-l); }
.pp-fallback { margin-top: 12px; font-size: 12px; color: var(--muted); }
.pp-fallback summary { cursor: pointer; }
.pp-payload { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); word-break: break-all;
  font-family: var(--mono, monospace); font-size: 11px; color: var(--text); }

/* ── Admin payment settings ──────────────────────────────────────────────── */
.admin-field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pay-methods { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pay-method-card { text-align: left; padding: 12px; border-radius: 12px; cursor: pointer; font-family: inherit;
  border: 2px solid var(--line); background: var(--panel); }
.pay-method-card.sel { border-color: var(--gold); background: var(--panel-2); }
.pay-method-name { font-weight: 700; color: var(--text); font-size: 14px; }
.pay-method-hint { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.pay-block { display: grid; gap: 12px; padding: 12px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line); }

/* ── In-app modal dialogs (alert/confirm/prompt replacements) ─────────────── */
.egm-overlay { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center;
  padding: 20px; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.egm-card { width: min(400px, 94vw); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); padding: 20px 22px; }
.egm-title { font-family: var(--disp); font-weight: 800; font-size: 17px; color: var(--text); margin-bottom: 8px; }
.egm-msg { color: var(--text); font-size: 14.5px; line-height: 1.55; white-space: pre-line; }
.egm-field { display: grid; gap: 5px; margin-top: 12px; }
.egm-field label { font-size: 12.5px; color: var(--muted); }
.egm-input { width: 100%; padding: 10px 12px; border-radius: 10px; box-sizing: border-box;
  background: var(--input-bg); border: 1px solid var(--line); color: var(--text); font-size: 14px; font-family: inherit; }
.egm-input:focus { outline: none; border-color: var(--gold); }
.egm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.egm-btn { padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer;
  background: var(--panel); color: var(--text); font-weight: 700; font-size: 14px; font-family: inherit; }
.egm-btn:hover { filter: brightness(1.05); }
.egm-btn.ghost { background: transparent; color: var(--muted); }
.egm-btn.primary { border: 0; color: #2a1a05; background: linear-gradient(180deg, var(--gold-l), var(--gold)); }
.egm-btn.danger { border: 0; color: #fff; background: linear-gradient(180deg, #f0683a, #d8492a); }

/* ── Friend DM chat ──────────────────────────────────────────────────────── */
.chat-loading, .chat-empty { padding: 20px 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.chat-note { padding: 8px 12px; font-size: 12px; color: var(--muted); }
.chat-expire { display: flex; align-items: center; gap: 4px; background: var(--panel);
  border-bottom: 1px solid var(--line); color: var(--gold-l); font-weight: 600; }
.chat-friends { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.chat-friend { display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer;
  font-family: inherit; color: var(--text); }
.chat-friend:hover { background: var(--panel); }
.chat-friend-av { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 14px;
  background: linear-gradient(135deg, var(--ember, #ff7a3c), var(--ember-2, #ffb07a)); }
.chat-friend-av img { width: 100%; height: 100%; object-fit: cover; }
.chat-friend-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-convo-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); }
.chat-back { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.chat-convo-name { font-weight: 700; color: var(--text); font-size: 14.5px; }

/* ── Game detail page (consistent Roblox-style entry: logo · about · how-to · Play) ── */
.gd-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: start center;
  overflow-y: auto; padding: 60px 18px 40px; background: rgba(3, 6, 12, 0.95);
  animation: gd-fade .2s ease; }
@keyframes gd-fade { from { opacity: 0; } }
.gd-back { position: fixed; top: 16px; left: 16px; z-index: 2; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); padding: 9px 15px; border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.gd-back:hover { background: var(--panel-2); }
.gd-card { width: 100%; max-width: 560px; background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); animation: gd-pop .3s cubic-bezier(.34,1.56,.64,1); }
@keyframes gd-pop { from { transform: translateY(18px) scale(.96); opacity: 0; } }
.gd-hero { position: relative; height: 210px; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 26%, var(--panel-2)), var(--panel-2)); }
.gd-logo { max-width: 78%; max-height: 82%; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0,0,0,.5)); }
/* Cover art → show the WHOLE image full-bleed (no crop, no letterbox padding) */
.gd-hero.gd-hero-cover { height: auto; display: block; }
.gd-hero.gd-hero-cover .gd-logo { max-width: 100%; max-height: 60vh; width: 100%; height: auto; object-fit: contain; display: block; filter: none; }
.gd-hero-icon { display: none; font-size: 88px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.4)); }
.gd-hero.no-logo .gd-hero-icon { display: block; }
.gd-body { padding: 22px 24px 26px; }
.gd-name { font-family: var(--disp); font-weight: 800; font-size: clamp(26px, 5vw, 34px);
  letter-spacing: .5px; color: var(--text); margin: 0 0 6px; }
.gd-tag { color: var(--gold-l, var(--gold)); font-weight: 600; font-size: 15px; margin: 0 0 12px; }
.gd-desc { color: var(--muted); font-size: 14.5px; line-height: 1.7; margin: 0 0 18px; }
.gd-howto { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; margin-bottom: 22px; }
.gd-howto-h { font-family: var(--disp); font-weight: 800; font-size: 16px; color: var(--text); margin: 0 0 10px; }
.gd-howto-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.gd-howto-list li { position: relative; padding-left: 22px; color: var(--text); font-size: 14.5px; line-height: 1.55; }
.gd-howto-list li::before { content: ''; position: absolute; left: 3px; top: 8px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
.gd-play { width: 100%; padding: 15px; border: none; border-radius: 15px; cursor: pointer;
  font-family: var(--disp); font-weight: 800; font-size: 18px; letter-spacing: .5px; color: #14100a;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .15s, filter .15s; }
.gd-play:hover { transform: translateY(-2px); filter: brightness(1.06); }
.gd-play.launching { opacity: .7; pointer-events: none; }
.gd-play.locked { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
  box-shadow: none; cursor: not-allowed; }
body.gd-open { overflow: hidden; }
@media (max-width: 560px) { .gd-hero { height: 160px; } .gd-overlay { padding-top: 54px; } }

/* ── Game detail: achievements/badges ── */
.gd-ach { background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 22px; }
.gd-ach-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gd-ach-h { font-family: var(--disp); font-weight: 800; font-size: 16px; color: var(--text); margin: 0; }
.gd-ach-count { font-family: var(--disp); font-weight: 800; font-size: 14px; color: var(--gold-l); background: rgba(233,162,58,.12);
  border: 1px solid rgba(233,162,58,.35); border-radius: 999px; padding: 3px 11px; }
.gd-ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.gd-badge { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 6px 9px;
  border-radius: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.03); text-align: center; opacity: .6; transition: transform .15s; }
.gd-badge.on { opacity: 1; border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 22%, transparent); }
.gd-badge:hover { transform: translateY(-2px); }
.gd-badge-ico { font-size: 30px; line-height: 1; filter: grayscale(.6); }
.gd-badge.on .gd-badge-ico { filter: none; }
.gd-badge-name { font-size: 11.5px; font-weight: 700; color: var(--text); line-height: 1.25; }
.gd-badge:not(.on) .gd-badge-name { color: var(--muted); }
.gd-badge-req { font-size: 10px; font-weight: 800; color: var(--gold-l); background: rgba(0,0,0,.25); border-radius: 999px; padding: 1px 7px; }

/* ── Admin: game cover upload ── */
/* ── Custom game-status dropdown (Flaticon icons per state) ─────────────────── */
.admin-status { position: relative; flex: 0 0 auto; }
.admin-status-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--input-bg); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.admin-status-btn:hover { border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.admin-status-ico { font-size: 16px; }
.admin-status-caret { font-size: 14px; color: var(--muted); margin-left: 2px; }
.admin-status-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 210px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 5px; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.admin-status-menu.hidden { display: none; }
.admin-status-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text); font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.admin-status-item .admin-status-lbl { flex: 1 1 auto; }
.admin-status-item:hover { background: var(--panel-2); }
.admin-status-item.sel { background: color-mix(in srgb, var(--gold) 14%, var(--panel)); }
.admin-status-check { font-size: 14px; color: var(--gold); }

.admin-cover { position: relative; display: flex; flex-direction: column; gap: 8px; }
.admin-cover.drag { outline: 2px dashed var(--gold); outline-offset: 4px; border-radius: 14px; }
.admin-cover-prev { width: 100%; max-width: 280px; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.admin-cover-prev.hidden { display: none; }
.admin-cover-up-ico { font-size: 16px; }
.admin-cover-drophint { display: none; position: absolute; left: 0; right: 0; top: 0; max-width: 280px; aspect-ratio: 16/9;
  align-items: center; justify-content: center; border-radius: 12px; background: color-mix(in srgb, var(--gold) 22%, rgba(10,8,16,.72));
  color: #fff; font-weight: 800; font-size: 15px; pointer-events: none; }
.admin-cover.drag .admin-cover-drophint { display: flex; }
.admin-cover-btns { display: flex; gap: 8px; align-items: center; }
.admin-cover-up { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 11px; cursor: pointer;
  border: 1px dashed var(--line-2); background: rgba(233,162,58,.1); color: var(--gold-l); font-weight: 700; font-size: 13.5px; }
.admin-cover-up:hover { background: rgba(233,162,58,.2); }
.admin-cover-up.busy { opacity: .55; pointer-events: none; }
.admin-cover-clear { padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }

/* ── Recently-played strip (per user) ─────────────────────────────────────── */
.recent-section { max-width: 1100px; margin: 0 auto 26px; }
.recent-h { font-family: var(--disp); font-size: 19px; font-weight: 800; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.recent-h .ttl-ico { color: var(--accent, #ff7a3c); }
.recent-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.recent-grid .game-card { min-height: 200px; }

/* ── Game vote bar (thumbs up/down + popularity score) ────────────────────── */
/* The pill is a fixed dark translucent chip over the cover art, so its icons +
   score are ALWAYS light (never theme vars) — otherwise they go dark-on-dark on
   the light theme and vanish. */
.gc-votes { position: absolute; top: 10px; right: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 5px; border-radius: 999px; background: rgba(8,11,18,0.72); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(4px); box-shadow: 0 2px 8px rgba(0,0,0,.28); }
.gc-vote { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; cursor: pointer;
  color: rgba(255,255,255,.82); transition: background .15s, color .15s, transform .1s; }
.gc-vote:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); color: #fff; }
.gc-vote .fi { font-size: 15px; line-height: 1; }
.gc-thumb { width: 16px; height: 16px; display: block; }
.gc-vote.down .fi, .gc-vote.down .gc-thumb { transform: scaleY(-1); }
.gc-vote.up.on { color: #4ade80; background: rgba(74,222,128,.22); }
.gc-vote.down.on { color: #f87171; background: rgba(248,113,113,.22); }
.gc-score { min-width: 22px; text-align: center; font-weight: 800; font-size: 13px; color: #fff; }
