/* ═══════════════════════════════════════════
   ZenUbb — Liquid Chrome Theme
   ═══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --c0: #0a0c10;
  --c1: #0e1520;
  --c2: #111d2e;
  --chrome-1: #c8d8e8;
  --chrome-2: #8aaec8;
  --chrome-3: #4a7090;
  --chrome-hi: #e8f4ff;
  --gold: #d4a843;
  --gold-hi: #f0c860;
  --gold-lo: #7a5c1a;
  --cyan: #38c8e8;
  --cyan-hi: #70e4f8;
  --cyan-lo: #1a6880;
  --text: #ddeeff;
  --text-dim: rgba(200, 220, 240, 0.45);
  --text-dimmer: rgba(180, 205, 230, 0.25);
  --border: rgba(140, 180, 220, 0.12);
  --border-hi: rgba(180, 220, 255, 0.22);
  --glass: rgba(20, 35, 55, 0.7);
  --glass-hi: rgba(30, 50, 75, 0.8);
  --r-card: 1.6rem;
  --r-sm: 0.8rem;
}

/* ── Light Theme ── */
body.light {
  --c0: #d8e8f4;
  --c1: #e4eff8;
  --c2: #ffffff;
  --chrome-1: #3a6080;
  --chrome-2: #5a80a0;
  --chrome-3: #7aa0c0;
  --chrome-hi: #1a3050;
  --cyan: #a07010;
  --cyan-hi: #8a5e08;
  --cyan-lo: #5a3a00;
  --gold: #b07800;
  --gold-hi: #8a5e08;
  --gold-lo: #5a3a00;
  --text: #0d2035;
  --text-dim: rgba(15, 40, 65, 0.5);
  --text-dimmer: rgba(15, 40, 65, 0.28);
  --border: rgba(60, 100, 140, 0.14);
  --border-hi: rgba(40, 80, 120, 0.28);
  --glass: rgba(255, 255, 255, 0.75);
  --glass-hi: rgba(240, 248, 255, 0.9);
}

/* ── Reset & Base ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--c0);
  color: var(--text);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  transition: background .4s, color .4s;
}

body.zenubb-legal-page {
  width: 100%;
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ── Background Layer ── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--chrome-3);
  border-radius: 4px;
}

/* ── Light Theme Overrides ── */
body.light .s-item.active {
  background: linear-gradient(120deg, rgba(160, 112, 16, .12), rgba(160, 112, 16, .04));
  border-color: rgba(160, 112, 16, .25);
  color: var(--gold-hi);
}

body.light .s-item.active::before {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
}

body.light .auth-tab.active {
  background: linear-gradient(135deg, rgba(160, 112, 16, .15), rgba(160, 112, 16, .06));
  color: var(--gold-hi);
}

body.light .chrome-input:focus {
  border-color: rgba(160, 112, 16, .5);
  background: rgba(160, 112, 16, .05);
  box-shadow: 0 0 0 3px rgba(160, 112, 16, .1);
}

body.light .btn-chrome {
  background: linear-gradient(135deg, var(--gold), #7a5500);
  box-shadow: 0 4px 20px rgba(160, 112, 16, .35);
}

body.light .cat-pill.active {
  background: rgba(160, 112, 16, .1);
  border-color: rgba(160, 112, 16, .4);
  color: var(--gold-hi);
}

body.light .game-card {
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 2px 12px rgba(0, 50, 100, .08);
}

body.light .game-card:hover {
  box-shadow: 0 2px 12px rgba(0, 50, 100, .08);
}

body.light .pay-btn {
  color: var(--gold-hi);
}

body.light .shop-card {
  background: rgba(255, 255, 255, .75);
}

body.light .ach-row {
  background: rgba(255, 255, 255, .7);
}

body.light .chrome-input {
  background: rgba(0, 0, 0, .05);
  border-color: var(--border);
}

body.light .toggle-thumb {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(160, 112, 16, .5);
}

body.light .toggle-pill {
  background: rgba(160, 112, 16, .15);
  border-color: rgba(160, 112, 16, .3);
}

body.light .top-bar {
  background: rgba(240, 248, 255, .5);
}

body.light .top-bar::after {
  background: linear-gradient(90deg, transparent, rgba(0, 180, 210, .4), transparent);
}

body.light aside::after {
  background: linear-gradient(180deg, rgba(0, 180, 210, .25), rgba(160, 112, 16, .2) 50%, rgba(0, 180, 210, .15));
}

body.light .bisi-bar {
  border-left: 3px solid rgba(0, 180, 210, .35);
}

body.light #timer-txt {
  color: #007a8a;
}

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
#auth-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  display: none;
  height: 100vh;
  position: relative;
  z-index: 10;
}

#app.visible {
  display: flex;
}

/* ═══════════════════════════════════════════
   AUTH
   ═══════════════════════════════════════════ */
.auth-wrap {
  width: 400px;
  max-width: 93vw;
  animation: slideUp .6s cubic-bezier(.22, 1, .36, 1) both;
}

.auth-card {
  background: var(--glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-hi);
  border-radius: 2rem;
  padding: 2.5rem 2.2rem;
  box-shadow: 0 8px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 200, 232, .15), transparent 70%);
  pointer-events: none;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 2rem;
}

.logo-gem {
  width: 46px;
  height: 46px;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--cyan-hi), var(--chrome-3));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(56, 200, 232, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  position: relative;
  overflow: hidden;
}

.logo-gem::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .25), transparent);
  border-radius: 1rem 1rem 0 0;
}

.logo-gem svg {
  position: relative;
  z-index: 1;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -.02em;
}

.brand-name span {
  color: var(--gold);
}

.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, .05);
  border-radius: .7rem;
  margin-bottom: 1.6rem;
  border: 1px solid var(--border);
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: .65rem;
  text-align: center;
  cursor: pointer;
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  transition: all .25s;
}

.auth-tab.active {
  background: linear-gradient(135deg, rgba(56, 200, 232, .18), rgba(212, 168, 67, .1));
  color: var(--cyan-hi);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

.chrome-input {
  width: 100%;
  padding: .85rem 1.1rem;
  margin-bottom: .85rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: .75rem;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: .92rem;
  outline: none;
  transition: all .25s;
}

.chrome-input:focus {
  border-color: rgba(56, 200, 232, .5);
  background: rgba(56, 200, 232, .06);
  box-shadow: 0 0 0 3px rgba(56, 200, 232, .1);
}

.chrome-input::placeholder {
  color: var(--text-dimmer);
}

.btn-chrome {
  width: 100%;
  padding: .9rem;
  border: none;
  border-radius: .75rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: .9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, var(--cyan), var(--chrome-3));
  color: #fff;
  margin-bottom: .7rem;
  box-shadow: 0 4px 20px rgba(56, 200, 232, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: all .25s;
  position: relative;
  overflow: hidden;
}

.btn-chrome::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent);
  pointer-events: none;
}

.btn-chrome:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(56, 200, 232, .4);
}

.btn-ghost {
  width: 100%;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: .83rem;
  cursor: pointer;
  transition: all .25s;
}

.btn-ghost:hover {
  border-color: var(--border-hi);
  color: var(--text);
}

.guest-note {
  text-align: center;
  font-size: .7rem;
  color: var(--text-dimmer);
  margin-top: .6rem;
}

.divider {
  position: relative;
  text-align: center;
  margin: .9rem 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.divider span {
  position: relative;
  padding: 0 .75rem;
  background: transparent;
  font-size: .72rem;
  color: var(--text-dimmer);
}

.auth-err {
  font-size: .77rem;
  color: #e05050;
  text-align: center;
  margin-bottom: .6rem;
  min-height: 1.2em;
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
aside {
  width: 260px;
  min-width: 260px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: .95rem .82rem;
  overflow-y: hidden;
  position: relative;
  z-index: 20;
  transition: background .4s;
}

aside::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(56, 200, 232, .2) 30%, rgba(212, 168, 67, .15) 70%, transparent);
  pointer-events: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1rem;
  padding: 0 .2rem;
}

.s-section {
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  font-weight: 500;
  color: var(--text-dimmer);
  text-transform: uppercase;
  letter-spacing: .18em;
  padding: 0 .6rem;
  margin: .7rem 0 .3rem;
}

.s-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .52rem .68rem;
  border-radius: .9rem;
  cursor: pointer;
  font-weight: 600;
  font-size: .8rem;
  color: var(--text-dim);
  transition: all .22s;
  border: 1px solid transparent;
  margin-bottom: .1rem;
  position: relative;
}

.s-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .05);
}

body.light .s-item:hover {
  background: rgba(0, 0, 0, .05);
}

.s-item.active {
  background: linear-gradient(120deg, rgba(56, 200, 232, .12), rgba(56, 200, 232, .04));
  border-color: rgba(56, 200, 232, .2);
  color: var(--cyan-hi);
}

.s-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan-hi), var(--cyan));
  border-radius: 0 2px 2px 0;
}

.s-item.gold-item.active {
  background: linear-gradient(120deg, rgba(212, 168, 67, .12), rgba(212, 168, 67, .04));
  border-color: rgba(212, 168, 67, .2);
  color: var(--gold-hi);
}

.s-item.gold-item.active::before {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
}

.user-badge {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .75rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  margin-bottom: .85rem;
  transition: background .4s;
}

body.light .user-badge {
  background: rgba(0, 0, 0, .04);
}

.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .68rem;
  border-radius: .8rem;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: all .22s;
  border: 1px solid transparent;
  margin-bottom: .1rem;
}

.theme-row:hover {
  background: rgba(255, 255, 255, .05);
  color: var(--text);
}

body.light .theme-row:hover {
  background: rgba(0, 0, 0, .05);
}

.toggle-pill {
  width: 38px;
  height: 21px;
  border-radius: 11px;
  background: rgba(56, 200, 232, .15);
  border: 1px solid rgba(56, 200, 232, .25);
  position: relative;
  transition: background .3s;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(56, 200, 232, .5);
  transition: left .3s;
}

body.light .toggle-thumb {
  left: 20px;
}

.bisi-bar {
  margin-top: .75rem;
  background: linear-gradient(135deg, rgba(212, 168, 67, .07), rgba(56, 200, 232, .04));
  border: 1px solid rgba(212, 168, 67, .18);
  border-radius: .95rem;
  padding: .8rem .85rem;
}

.sidebar-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .55rem 0 .15rem;
  padding: .55rem .15rem 0;
  border-top: 1px solid var(--border);
}

.sidebar-legal-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .34rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-decoration: none;
  font-size: .7rem;
  line-height: 1;
  transition: all .2s;
}

.sidebar-legal-links a:hover {
  color: var(--cyan-hi);
  border-color: var(--border-hi);
  background: rgba(56, 200, 232, .06);
}

.sidebar-copyright {
  margin-top: .7rem;
  padding: .55rem .7rem 0;
  font-size: .65rem;
  line-height: 1.4;
  color: var(--text-dimmer);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   MAIN
   ═══════════════════════════════════════════ */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.top-bar {
  height: 60px;
  padding: 0 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 16, .4);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
  position: relative;
}

.search-shell {
  flex: 1 1 420px;
  max-width: 460px;
  display: none;
  align-items: center;
  gap: .65rem;
  padding: .45rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  background: linear-gradient(135deg, rgba(56, 200, 232, .08), rgba(212, 168, 67, .05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-hi);
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: .88rem;
}

.search-input::placeholder {
  color: var(--text-dimmer);
}

.mobile-nav-toggle {
  display: none;
  padding: .45rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  background: rgba(56, 200, 232, .12);
  color: var(--cyan-hi);
  font-family: 'Outfit', sans-serif;
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
}

.top-bar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 200, 232, .3), transparent);
}

.cat-strip {
  padding: .65rem 1.8rem;
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cat-strip::-webkit-scrollbar {
  height: 0;
}

.cat-pill {
  padding: .38rem 1rem;
  border-radius: 2rem;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  transition: all .22s;
  font-family: 'Outfit', sans-serif;
}

.cat-pill:hover {
  border-color: var(--border-hi);
  color: var(--text);
}

.cat-pill.active {
  background: linear-gradient(135deg, rgba(56, 200, 232, .15), rgba(56, 200, 232, .05));
  border-color: rgba(56, 200, 232, .4);
  color: var(--cyan-hi);
}

#content-area {
  flex: 1;
  padding: 1.4rem 1.8rem;
  overflow-y: auto;
}

/* ═══════════════════════════════════════════
   GAME CARDS
   ═══════════════════════════════════════════ */
.game-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 1.4rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
  overflow: hidden;
}

.featured-thumb-card {
  padding: .85rem;
  border-radius: 1.45rem;
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1.15rem;
  overflow: hidden;
  margin-bottom: .85rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  position: relative;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: var(--thumb-object-fit, cover);
  object-position: var(--thumb-object-position, center center);
  display: block;
  transition: object-position .18s ease, transform .18s ease;
}

/* Per personalizzare la miniatura di una singola card, aggiungi
   la classe `game-<id>` (già presente nel markup) e definisci
   variabili CSS per quella classe. Esempi: */
.game-navale {
  --thumb-object-fit: cover;
  --thumb-object-position: 40% 30%;
}

.game-snake {
  --thumb-object-fit: cover;
  --thumb-object-position: center 52%;
}

.game-quiz {
  --thumb-object-fit: cover;
  --thumb-object-position: 45% 20%;
}

.game-dama {
  --thumb-object-fit: cover;
  --thumb-object-position: 0% 20%;
}

.game-scacchi {
  --thumb-object-fit: cover;
  --thumb-object-position: 100% 20%;
}

.game-dama {
  --thumb-object-fit: cover;
  --thumb-object-position: 45% 20%;
}

.game-connect4 {
  --thumb-object-fit: cover;
  --thumb-object-position: 15% 20%;
}

.game-2048 {
  --thumb-object-fit: cover;
  --thumb-object-position: 30% 20%;
}

/* Se vuoi ridimensionare o usare 'contain' per una sola miniatura:
.game-quiz { --thumb-object-fit: contain; --thumb-object-position: center center; }
*/

  .featured-thumb {
  aspect-ratio: 16 / 9;
  min-height: 160px;
  border-radius: 1.35rem;
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
  overflow: hidden;
}

.featured-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, .02) 0%, rgba(2, 6, 23, .38) 100%),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .12), transparent 28%),
    linear-gradient(135deg, rgba(56, 200, 232, .08), rgba(212, 168, 67, .04));
  pointer-events: none;
}

.card-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: .8rem;
  gap: .35rem;
  z-index: 1;
}

.card-thumb-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: .28rem .56rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #1c2550;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
}

.card-thumb-title {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: .35rem .65rem;
  border-radius: .8rem;
  background: rgba(4, 10, 25, .72);
  color: #fff;
  font-size: .86rem;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2);
}

.game-card::before {
  content: none;
}

.game-card::after {
  content: none;
}

.game-card:hover {
  border-color: var(--border-hi);
  background: var(--glass);
}

.game-card:hover::before {
  content: none;
}

.game-card:hover::after {
  content: none;
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(56, 200, 232, .15), rgba(56, 200, 232, .05));
  border: 1px solid rgba(56, 200, 232, .2);
  margin-bottom: 1rem;
  transition: none;
}

.game-card .card-icon-fallback {
  display: flex;
}

.game-card:not(.thumb-missing) .card-icon-fallback {
  display: none;
}

.featured-thumb-card:not(.thumb-missing) .card-icon-fallback,
.featured-thumb-card:not(.thumb-missing) h4,
.featured-thumb-card:not(.thumb-missing) p,
.featured-thumb-card:not(.thumb-missing) .card-tag {
  display: none;
}

.featured-thumb-card.thumb-missing .card-thumb {
  display: none;
}

.featured-thumb-card.thumb-missing .card-icon-fallback {
  display: flex;
}

.featured-thumb-card .visits-badge,
.featured-thumb-card .hot-badge {
  z-index: 2;
}

.card-tag {
  display: inline-block;
  font-size: .62rem;
  padding: .18rem .55rem;
  background: rgba(56, 200, 232, .08);
  border: 1px solid rgba(56, 200, 232, .15);
  border-radius: 2rem;
  color: rgba(56, 200, 232, .8);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: .15rem .15rem 0 0;
}

.hot-badge {
  position: absolute;
  top: .85rem;
  right: .85rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-lo));
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  padding: .18rem .55rem;
  border-radius: 2rem;
  letter-spacing: .08em;
  box-shadow: 0 2px 8px rgba(212, 168, 67, .35);
}

.visits-badge {
  position: absolute;
  top: .85rem;
  left: .85rem;
  background: rgba(56, 200, 232, .15);
  border: 1px solid rgba(56, 200, 232, .3);
  color: var(--cyan-hi);
  font-size: .58rem;
  font-weight: 800;
  padding: .18rem .55rem;
  border-radius: 2rem;
}

/* ═══════════════════════════════════════════
   LEADERBOARD
   ═══════════════════════════════════════════ */
.leaderboard-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: relative;
}

.leaderboard-hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1.15rem;
  padding: 1.45rem 1.5rem;
  border-radius: 1.55rem;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(13, 21, 33, .74);
}

.leaderboard-hero::after {
  content: none;
}

.leaderboard-kicker {
  font-family: 'DM Mono', monospace;
  font-size: .64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text-dimmer);
  margin-bottom: .5rem;
}

.leaderboard-hero h3 {
  font-size: 1.52rem;
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: .5rem;
  line-height: 1.1;
  text-wrap: balance;
}

.leaderboard-hero p {
  color: var(--text-dim);
  font-size: .92rem;
  line-height: 1.45;
  max-width: 46ch;
}

.leaderboard-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  min-width: 235px;
  align-self: flex-end;
}

.leaderboard-stat {
  padding: .82rem .95rem;
  border-radius: 1.05rem;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--border);
}

.leaderboard-stat span {
  display: block;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--gold-hi);
}

.leaderboard-stat small {
  color: rgba(214, 226, 242, .8);
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .58rem;
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: 'second first third';
  gap: .95rem;
  align-items: end;
}

.leaderboard-card {
  position: relative;
  padding: 1.25rem 1.1rem 1.1rem;
  border-radius: 1.35rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  text-align: center;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.leaderboard-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, .05);
}

.leaderboard-card--rank1 {
  grid-area: first;
  transform: translateY(-10px) scale(1.03);
  border-color: rgba(212, 168, 67, .45);
  background: rgba(212, 168, 67, .1);
}

.leaderboard-card--rank2 {
  grid-area: second;
  border-color: rgba(196, 210, 224, .42);
  background: rgba(196, 210, 224, .08);
}

.leaderboard-card--rank3 {
  grid-area: third;
  border-color: rgba(205, 152, 116, .44);
  background: rgba(205, 152, 116, .09);
}

.leaderboard-badge {
  width: 2.8rem;
  height: 2.8rem;
  margin: 1.35rem auto .7rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .18);
}

.leaderboard-rank {
  position: absolute;
  top: .8rem;
  left: .8rem;
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  padding: .22rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
}

.leaderboard-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--border-hi);
  margin: .5rem auto .8rem;
  display: block;
  background: rgba(255, 255, 255, .04);
}

.leaderboard-avatar--large {
  width: 78px;
  height: 78px;
  margin-top: .15rem;
}

.leaderboard-card h4 {
  font-size: 1.02rem;
  font-weight: 900;
  margin-bottom: .2rem;
}

.leaderboard-card p {
  color: rgba(235, 242, 252, .86);
  font-size: .78rem;
  margin-bottom: .9rem;
}

.leaderboard-card--rank1 p {
  color: rgba(255, 244, 199, .98);
}

.leaderboard-card--rank2 p {
  color: rgba(245, 248, 252, .96);
}

.leaderboard-card--rank3 p {
  color: rgba(255, 232, 211, .96);
}

.leaderboard-mini-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
}

.leaderboard-mini-stats span,
.leaderboard-row-right span {
  font-family: 'DM Mono', monospace;
  font-size: .61rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dimmer);
  padding: .3rem .58rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: .58rem;
}

.leaderboard-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .86rem 1rem;
  border-radius: 1.05rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.leaderboard-row:hover {
  transform: translateX(2px);
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, .05);
}

.leaderboard-row-left {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}

.leaderboard-row-rank {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--gold-hi);
  background: rgba(212, 168, 67, .1);
  border: 1px solid rgba(212, 168, 67, .28);
  flex-shrink: 0;
}

.leaderboard-row-avatar {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .45);
  flex-shrink: 0;
  background: rgba(255, 255, 255, .04);
}

.leaderboard-row-left strong {
  display: block;
  font-size: .94rem;
  letter-spacing: .01em;
}

.leaderboard-row-left span {
  display: block;
  font-size: .73rem;
  color: rgba(214, 226, 241, .82);
}

.leaderboard-row-right {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.leaderboard-row-right .lb-chip {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .11em;
  border-width: 2px;
  padding: .34rem .62rem;
}

.leaderboard-row-right .lb-chip--pts {
  color: #f6d98d;
  border-color: rgba(212, 168, 67, .55);
  background: rgba(212, 168, 67, .14);
}

.leaderboard-row-right .lb-chip--streak {
  color: #8fe6ff;
  border-color: rgba(56, 200, 232, .58);
  background: rgba(56, 200, 232, .14);
}

/* ═══════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════ */
#game-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 12, 20, .9);
  backdrop-filter: blur(24px);
  align-items: center;
  justify-content: center;
}

#game-modal.visible {
  display: flex;
}

.modal-shell {
  background: var(--glass-hi);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border-hi);
  border-radius: 2rem;
  padding: 2.5rem;
  max-width: 600px;
  width: 92%;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  position: relative;
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-shell::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 200, 232, .1), transparent 70%);
}

.mode-card {
  padding: 1.3rem;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  cursor: pointer;
  text-align: center;
  color: var(--text);
  transition: all .22s;
}

.mode-card:hover {
  background: rgba(56, 200, 232, .08);
  border-color: rgba(56, 200, 232, .3);
}

/* ═══════════════════════════════════════════
   GAME: Tris
   ═══════════════════════════════════════════ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 300px;
  height: 300px;
}

.cell {
  background: rgba(56, 200, 232, .07);
  border: 1px solid rgba(56, 200, 232, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  cursor: pointer;
  border-radius: .9rem;
  transition: all .18s;
}

.cell:hover {
  background: rgba(56, 200, 232, .16);
  border-color: rgba(56, 200, 232, .5);
}

/* ═══════════════════════════════════════════
   SHOP
   ═══════════════════════════════════════════ */
.shop-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 1.8rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all .25s;
}

.shop-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .04), transparent 50%);
  pointer-events: none;
}

.shop-card.gold-card {
  border-color: rgba(212, 168, 67, .25);
  background: linear-gradient(135deg, rgba(212, 168, 67, .06), rgba(10, 12, 16, .1));
}

.pay-btn {
  width: 100%;
  padding: .65rem 1rem;
  border-radius: .65rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  color: var(--cyan-hi);
  transition: all .2s;
  margin-bottom: .45rem;
}

.pay-btn:hover {
  background: rgba(56, 200, 232, .12);
  border-color: rgba(56, 200, 232, .35);
}

.pay-btn.gold {
  color: var(--gold-hi);
  border-color: rgba(212, 168, 67, .2);
  background: rgba(212, 168, 67, .06);
}

.pay-btn.gold:hover {
  background: rgba(212, 168, 67, .16);
}

/* ═══════════════════════════════════════════
   PROFILE
   ═══════════════════════════════════════════ */
.profile-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.profile-panel {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 1.3rem;
  padding: 1.2rem;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: .9rem;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 800;
}

.profile-sub {
  font-size: .76rem;
  color: var(--text-dim);
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.profile-chip {
  padding: .35rem .7rem;
  border-radius: 999px;
  font-size: .72rem;
  border: 1px solid var(--border-hi);
  background: rgba(56, 200, 232, .1);
  color: var(--cyan-hi);
  font-family: 'DM Mono', monospace;
}

.profile-title {
  font-size: .88rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-dim);
  margin-bottom: .9rem;
  font-family: 'DM Mono', monospace;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.profile-stat-card {
  border-radius: .9rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  padding: .65rem .7rem;
}

.profile-stat-label {
  font-size: .66rem;
  color: var(--text-dimmer);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .35rem;
}

.profile-stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--cyan-hi);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.profile-btn {
  padding: .55rem .9rem;
  border-radius: .7rem;
  border: 1px solid var(--border-hi);
  background: rgba(56, 200, 232, .08);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.profile-btn.danger {
  border-color: rgba(224, 80, 80, .45);
  background: rgba(224, 80, 80, .1);
  color: #ffd9d9;
}

.profile-note {
  font-size: .78rem;
  color: var(--text-dim);
  margin-bottom: .8rem;
}

.profile-form .chrome-input {
  margin-bottom: .65rem;
}

.profile-form .btn-chrome {
  margin-bottom: 0;
}

.profile-msg {
  min-height: 1.2em;
  margin-top: .7rem;
  font-size: .76rem;
}

.profile-msg.ok {
  color: #6fd99a;
}

.profile-msg.err {
  color: #ff9b9b;
}

/* ═══════════════════════════════════════════
   ACHIEVEMENTS
   ═══════════════════════════════════════════ */
.ach-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .95rem 1.1rem;
  border-radius: 1rem;
  background: var(--glass);
  border: 1px solid var(--border);
  margin-bottom: .55rem;
  transition: border-color .22s;
  position: relative;
  overflow: hidden;
}

.ach-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, .03), transparent);
  pointer-events: none;
}

.ach-row:hover {
  border-color: var(--border-hi);
}

.ach-row.locked {
  opacity: .38;
  filter: grayscale(.7);
}

/* ═══════════════════════════════════════════
   GAME IMPLEMENTATIONS
   ═══════════════════════════════════════════ */
.game-impl-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Memory */
.memory-grid {
  display: grid;
  gap: 8px;
}

.mem-card {
  width: 70px;
  height: 70px;
  perspective: 600px;
  cursor: pointer;
}

.mem-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .4s;
}

.mem-card.flipped .mem-inner {
  transform: rotateY(180deg);
}

.mem-front,
.mem-back {
  position: absolute;
  inset: 0;
  border-radius: .65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  backface-visibility: hidden;
}

.mem-front {
  background: linear-gradient(135deg, rgba(56, 200, 232, .15), rgba(56, 200, 232, .06));
  border: 1px solid rgba(56, 200, 232, .25);
}

.mem-back {
  background: linear-gradient(135deg, rgba(212, 168, 67, .12), rgba(212, 168, 67, .05));
  border: 1px solid rgba(212, 168, 67, .25);
  transform: rotateY(180deg);
}

/* Snake */
#snake-canvas {
  border: 1px solid rgba(56, 200, 232, .25);
  border-radius: .75rem;
}

/* Wordle */
.wordle-grid {
  display: grid;
  grid-template-columns: repeat(5, 52px);
  gap: 6px;
  margin-bottom: 1rem;
}

.wordle-tile {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(56, 200, 232, .25);
  border-radius: .4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  transition: all .3s;
}

.wordle-tile.correct {
  background: #538d4e;
  border-color: #538d4e;
  color: #fff;
}

.wordle-tile.present {
  background: #b59f3b;
  border-color: #b59f3b;
  color: #fff;
}

.wordle-tile.absent {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .15);
  color: var(--text-dim);
}

.wordle-tile.current {
  border-color: rgba(56, 200, 232, .6);
}

.wordle-kb {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

.wordle-kb-row {
  display: flex;
  gap: 4px;
}

.kb-key {
  padding: .55rem .6rem;
  min-width: 36px;
  border-radius: .4rem;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .15);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: .78rem;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
}

.kb-key:hover {
  background: rgba(56, 200, 232, .2);
}

.kb-key.correct {
  background: #538d4e;
  border-color: #538d4e;
}

.kb-key.present {
  background: #b59f3b;
  border-color: #b59f3b;
}

.kb-key.absent {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .08);
  color: var(--text-dimmer);
}

/* 2048 */
.grid-2048 {
  display: grid;
  grid-template-columns: repeat(4, 70px);
  gap: 8px;
  background: rgba(56, 200, 232, .05);
  border: 1px solid rgba(56, 200, 232, .15);
  border-radius: 1rem;
  padding: 10px;
}

.tile-2048 {
  width: 70px;
  height: 70px;
  border-radius: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.4rem;
  font-family: 'DM Mono', monospace;
  transition: background .15s, box-shadow .2s;
}

/* New tile pop-in */
.tile-2048.tile-new {
  animation: tileAppear .25s cubic-bezier(.3, 1.4, .6, 1) both;
}

/* Merged tile bounce */
.tile-2048.tile-merged {
  animation: tileMerge .3s cubic-bezier(.3, 1.5, .6, 1) both;
}

@keyframes tileAppear {
  0%   { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes tileMerge {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Score float animation */
.score-pop {
  animation: scorePop .3s ease both;
}

.score-add-float {
  display: inline-block;
  margin-left: .3rem;
  color: var(--gold-hi);
  font-size: .85rem;
  font-weight: 800;
  animation: scoreFloat .8s ease both;
  font-family: 'DM Mono', monospace;
}

@keyframes scorePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes scoreFloat {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-18px); }
}

/* 2048 win / gameover */
.win-2048 {
  animation: fadeUp .4s ease both;
}

.gameover-2048 {
  animation: shakeX .4s ease both;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* ═══════════════════════════════════════════
   CHESS
   ═══════════════════════════════════════════ */
.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 42px);
  grid-template-rows: repeat(8, 42px);
  gap: 0;
  border: 2px solid rgba(56, 200, 232, .2);
  border-radius: .6rem;
  overflow: hidden;
  margin: 0 auto;
  width: fit-content;
}

.chess-sq {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background .15s;
}

.chess-sq:hover {
  filter: brightness(1.2);
}

.chess-piece {
  font-size: 1.5rem;
  line-height: 1;
  pointer-events: none;
}

.chess-white {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

.chess-black {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
  opacity: .85;
}

.chess-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(56, 200, 232, .35);
  position: absolute;
}

.chess-capture-ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px solid rgba(224, 80, 80, .5);
  pointer-events: none;
}

.chess-valid {
  cursor: pointer;
}

/* ═══════════════════════════════════════════
   CONNECT 4
   ═══════════════════════════════════════════ */
.c4-board {
  background: rgba(56, 200, 232, .08);
  border: 2px solid rgba(56, 200, 232, .2);
  border-radius: 1rem;
  padding: 10px;
  display: inline-block;
}

.c4-cols {
  display: flex;
  gap: 6px;
}

.c4-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform .1s;
}

.c4-col:hover {
  transform: translateY(-2px);
}

.c4-cell {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 35, 55, .5);
  border: 2px solid rgba(56, 200, 232, .1);
  transition: all .2s;
}

.c4-red {
  background: #e05050 !important;
  border-color: #c03030 !important;
  box-shadow: 0 0 8px rgba(224, 80, 80, .4);
  animation: tileAppear .25s cubic-bezier(.3, 1.4, .6, 1) both;
}

.c4-yellow {
  background: #f0c860 !important;
  border-color: #d4a843 !important;
  box-shadow: 0 0 8px rgba(240, 200, 96, .4);
  animation: tileAppear .25s cubic-bezier(.3, 1.4, .6, 1) both;
}

.c4-win {
  animation: tileMerge .5s ease infinite alternate !important;
  box-shadow: 0 0 16px rgba(212, 168, 67, .6) !important;
}

/* ═══════════════════════════════════════════
   BLACKJACK CARDS
   ═══════════════════════════════════════════ */
.bj-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 72px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(56, 200, 232, .2);
  border-radius: .5rem;
  font-family: 'DM Mono', monospace;
  animation: tileAppear .25s ease both;
}

.bj-hidden {
  background: rgba(56, 200, 232, .06);
  border-color: rgba(56, 200, 232, .3);
}

/* Simon */
.simon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 220px;
}

.simon-btn {
  height: 100px;
  border-radius: 1rem;
  cursor: pointer;
  transition: all .2s;
  border: none;
  opacity: .7;
}

.simon-btn.active {
  opacity: 1;
  filter: brightness(1.5);
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */


.fade-up {
  animation: fadeUp .35s ease both;
}

.bisi-dot-on {
  animation: pulse-gold 2.2s infinite;
}

/* ═══════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  background: var(--glass-hi);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-hi);
  border-radius: 1rem;
  padding: .9rem 1.4rem;
  font-weight: 700;
  font-size: .88rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
  transform: translateY(20px);
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
}

.toast.show {
  transform: none;
  opacity: 1;
}

/* ═══════════════════════════════════════════
   LEGAL / COOKIE
   ═══════════════════════════════════════════ */
.zenubb-legal-footer a,
.zenubb-legal-footer button,
.zenubb-cookie-links a {
  font-family: 'Outfit', sans-serif;
}

.zenubb-cookie-banner strong,
.zenubb-legal-card strong {
  color: var(--text);
}

.zenubb-legal-card li + li {
  margin-top: .2rem;
}

.zenubb-legal-page .toast {
  bottom: 5.2rem;
}

.zenubb-legal-page .zenubb-legal-shell {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.zenubb-legal-page .zenubb-legal-card code,
.zenubb-legal-page .zenubb-legal-card strong {
  font-family: 'DM Mono', monospace;
}

/* ─── Legal Page Hero Section ─── */
.zenubb-legal-header {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.zenubb-legal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cyan-hi);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all .2s;
  width: fit-content;
}

.zenubb-legal-back:hover {
  color: var(--cyan);
  transform: translateX(-3px);
}

.zenubb-legal-header h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.02em;
  margin: 0;
  color: var(--text);
}

.zenubb-legal-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0;
}

/* ─── Legal Intro Section ─── */
.zenubb-legal-intro {
  background: rgba(56, 200, 232, .04);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.zenubb-legal-intro p {
  margin: 0 0 0.8rem 0;
  line-height: 1.6;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.zenubb-legal-intro p:last-child {
  margin-bottom: 0;
}

.zenubb-legal-intro strong {
  color: var(--text);
  font-weight: 800;
}

/* ─── Legal Page Hero Section (removed - simpler design) ─── */
.zenubb-legal-hero {
  display: none;
}

.zenubb-legal-quick-info {
  display: none;
}

.zenubb-legal-meta {
  display: none;
}

/* ─── Content Grid ─── */
.zenubb-legal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}

.zenubb-legal-card {
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all .3s;
  overflow: hidden;
  position: relative;
}

.zenubb-legal-card::before {
  content: none;
}

.zenubb-legal-card:hover {
  background: rgba(255, 255, 255, .04);
  border-color: var(--border-hi);
  transform: translateX(4px);
}

.zenubb-legal-card:hover::before {
  opacity: 1;
}

.zenubb-legal-card h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text);
}

.zenubb-legal-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.zenubb-legal-card p:last-of-type {
  margin-bottom: 0;
}

.zenubb-legal-card ul {
  margin: 0;
  padding-left: 1.5rem;
}

.zenubb-legal-card li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.zenubb-legal-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.zenubb-legal-card thead {
  background: rgba(56, 200, 232, .08);
}

.zenubb-legal-card th {
  padding: 0.8rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}

.zenubb-legal-card td {
  padding: 0.8rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-dim);
}

.zenubb-legal-card a {
  color: var(--cyan-hi);
  text-decoration: none;
  transition: color .2s;
}

.zenubb-legal-card a:hover {
  color: var(--cyan);
}

/* ─── Trustpilot Section ─── */
.zenubb-legal-trustpilot {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.zenubb-trustpilot-banner {
  text-align: center;
  padding: 2rem;
  background: rgba(56, 200, 232, .03);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
}

.zenubb-trustpilot-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(212, 168, 67, .08), transparent 60%);
  pointer-events: none;
}

.zenubb-trustpilot-banner > * {
  position: relative;
  z-index: 1;
}

.zenubb-trustpilot-banner strong {
  display: block;
  font-size: 0.7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold-hi);
  margin-bottom: 0.5rem;
}

.zenubb-trustpilot-banner h3 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.zenubb-trustpilot-banner > p:first-of-type {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

#zenubb-trustpilot-widget {
  margin: 1rem auto;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zenubb-trustpilot-link {
  display: inline-block;
  margin: 0.8rem 0;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, var(--cyan), var(--chrome-3));
  color: #fff;
  text-decoration: none;
  border-radius: 0.7rem;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all .3s;
  box-shadow: 0 4px 16px rgba(56, 200, 232, .25);
}

.zenubb-trustpilot-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(56, 200, 232, .35);
}

.zenubb-trustpilot-note {
  font-size: 0.8rem;
  color: var(--text-dimmer);
  margin-top: 0.8rem;
}

/* ─── CTA Section (Call To Action Buttons) ─── */
.zenubb-legal-cta {
  margin-top: 2.5rem;
  padding: 2rem;
  background: rgba(56, 200, 232, .03);
  border: 1px solid var(--border);
  border-radius: 1rem;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.zenubb-legal-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(56, 200, 232, .08), transparent 50%);
  pointer-events: none;
}

.zenubb-cta-buttons {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.zenubb-btn {
  padding: 0.95rem 2rem;
  border-radius: 0.9rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .3s;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.zenubb-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent);
  pointer-events: none;
}

.zenubb-btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--chrome-3));
  color: #fff;
  box-shadow: 0 4px 20px rgba(56, 200, 232, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.zenubb-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(56, 200, 232, .4);
}

.zenubb-btn-primary:active {
  transform: translateY(0);
}

.zenubb-btn-secondary {
  background: rgba(56, 200, 232, .08);
  color: var(--cyan-hi);
  border: 1px solid rgba(56, 200, 232, .3);
  box-shadow: none;
}

.zenubb-btn-secondary:hover {
  background: rgba(56, 200, 232, .15);
  border-color: rgba(56, 200, 232, .5);
  transform: translateY(-2px);
}

.zenubb-btn-secondary:active {
  transform: translateY(0);
}

.zenubb-cta-meta {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  color: var(--text-dimmer);
  margin: 0;
}

.zenubb-manage-consent {
  padding: 0.75rem 1.5rem;
  background: rgba(56, 200, 232, .1);
  border: 1px solid rgba(56, 200, 232, .3);
  color: var(--cyan-hi);
  border-radius: 0.8rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all .25s;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.zenubb-manage-consent:hover {
  background: rgba(56, 200, 232, .2);
  border-color: rgba(56, 200, 232, .5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 200, 232, .15);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 980px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  #app,
  #app.visible {
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  aside {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: .6rem .9rem;
    overflow-y: hidden;
    overflow-x: auto;
    flex-direction: row;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
    scrollbar-width: none;
  }

  aside::-webkit-scrollbar {
    height: 0;
    width: 0;
  }

  .sidebar-logo,
  .user-badge,
  .s-section,
  .theme-row,
  .bisi-bar {
    display: none;
  }

  .s-item {
    margin: 0;
    padding: .5rem .85rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    border-color: var(--border);
    background: rgba(255, 255, 255, .03);
    gap: .45rem;
  }

  .s-item.active::before {
    display: none;
  }

  #app.mobile-sidebar-hidden aside {
    display: none;
  }

  main {
    min-height: 0;
  }

  .top-bar {
    height: auto;
    min-height: 60px;
    padding: .7rem .9rem;
    gap: .65rem;
    flex-wrap: wrap;
  }

  .search-shell {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 1;
  }

  .top-bar h2 {
    order: 2;
    flex: 1;
    min-width: 130px;
    font-size: 1.02rem !important;
  }

  .top-bar > div:last-child {
    order: 3;
    margin-left: auto;
    gap: .45rem !important;
  }

  .leaderboard-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .leaderboard-summary {
    min-width: 0;
  }

  .leaderboard-podium {
    grid-template-columns: 1fr;
    grid-template-areas:
      'first'
      'second'
      'third';
    gap: .75rem;
  }

  .leaderboard-card--rank1 {
    transform: none;
  }

  .leaderboard-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .leaderboard-row-right {
    justify-content: flex-start;
  }

  #guest-warn,
  #pts-badge {
    display: none !important;
  }

  .cat-strip {
    padding: .55rem .9rem;
  }

  #content-area {
    padding: 1rem .9rem;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zenubb-cookie-banner {
    left: .6rem;
    right: .6rem;
    bottom: 5rem;
  }

  .zenubb-legal-footer {
    width: calc(100% - 1.2rem);
    justify-content: center;
  }

  .zenubb-legal-page .toast {
    right: .9rem;
    left: .9rem;
    bottom: 6rem;
  }
}