/* ============================================================
   Dark-glass DOM LOBBY layer (main menu)
   Replaces the raw Cocos lobby visuals (scattered tiles + stacked
   Level / PLAY NOW / LEVELS buttons) with a designed menu.
   Native logic and button callbacks keep running underneath.
   ============================================================ */

#mj-lobby {
  position: fixed;
  inset: 0;
  z-index: 2147481000; /* below popups (2147482000) and ad (2147483000) */
  display: none;
  flex-direction: column;
  box-sizing: border-box;
  padding: max(18px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 120% 80% at 50% 18%, rgba(10, 46, 32, .74) 0%, rgba(3, 18, 12, .9) 62%, rgba(1, 10, 7, .96) 100%),
    linear-gradient(155deg, rgba(5, 30, 20, .9), rgba(2, 12, 8, .96));
  backdrop-filter: blur(5px) saturate(1.08);
  -webkit-backdrop-filter: blur(5px) saturate(1.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #eaf3ee;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#mj-lobby.open { display: flex; animation: mjl-fade .34s ease both; }

/* top bar --------------------------------------------------------------- */
.mjl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.mjl-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  border-radius: 10px;
  padding: 4px 8px 4px 4px;
  margin-left: -4px;
  transition: background .18s ease, opacity .18s ease;
}
.mjl-brand:hover { background: rgba(232, 197, 99, .12); }
.mjl-brand:hover .mjl-mark,
.mjl-brand:hover .mjl-wordmark { color: #f7d98a; }
.mjl-brand:focus-visible { outline: 2px solid #e8c563; outline-offset: 2px; }
.mjl-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: #e8c563;
}
.mjl-mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mjl-wordmark {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .2em;
  color: #f0dfae;
  white-space: nowrap;
}
.mjl-wordmark small {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
  color: rgba(234, 243, 238, .5);
  margin-top: 2px;
}

.mjl-set {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  border: 1px solid rgba(232, 197, 99, .42);
  background: linear-gradient(158deg, rgba(19, 62, 45, .7), rgba(6, 28, 20, .85));
  color: #f0dfae;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .16s ease, transform .12s ease, border-color .16s ease;
}
.mjl-set:hover { border-color: rgba(232, 197, 99, .7); background: rgba(232, 197, 99, .14); }
.mjl-set:active { transform: scale(.94); }
.mjl-set svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* centre ---------------------------------------------------------------- */
.mjl-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 16px 0;
}

.mjl-hero { text-align: center; max-width: 560px; }
.mjl-eyebrow {
  margin: 0 0 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(232, 197, 99, .72);
}
.mjl-title {
  margin: 0;
  font-size: clamp(34px, 7.5vw, 66px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.01em;
  background: linear-gradient(180deg, #f9ecc0 0%, #e6c879 48%, #c9a44e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .45));
}
.mjl-sub {
  margin: 14px auto 0;
  max-width: 360px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(234, 243, 238, .72);
}

/* progress / continue card --------------------------------------------- */
.mjl-continue {
  display: none;
  width: min(360px, 100%);
  box-sizing: border-box;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(232, 197, 99, .38);
  background: linear-gradient(158deg, rgba(19, 62, 45, .74), rgba(6, 28, 20, .88));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .08);
  cursor: pointer;
  transition: transform .14s ease, border-color .16s ease, background .16s ease;
}
.mjl-continue.show { display: flex; }
.mjl-continue:hover { transform: translateY(-2px); border-color: rgba(232, 197, 99, .62); }
.mjl-continue:active { transform: translateY(0) scale(.99); }
.mjl-continue .mjl-playico {
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #f2d98f, #d4ad52);
  color: #10301f;
}
.mjl-continue .mjl-playico svg { width: 20px; height: 20px; fill: currentColor; }
.mjl-cinfo { flex: 1 1 auto; min-width: 0; text-align: left; }
.mjl-cinfo .mjl-clabel { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: rgba(232, 197, 99, .7); }
.mjl-cinfo .mjl-clevel { font-size: 17px; font-weight: 800; color: #f4ead0; margin: 2px 0 6px; }
.mjl-cmeta { display: flex; gap: 16px; }
.mjl-cmeta span { font-size: 12px; color: rgba(234, 243, 238, .68); font-variant-numeric: tabular-nums; }
.mjl-cmeta b { color: #f0dfae; font-weight: 700; }
.mjl-continue .mjl-arrow { width: 18px; height: 18px; flex: 0 0 auto; color: rgba(232, 197, 99, .8); }
.mjl-continue .mjl-arrow svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* actions --------------------------------------------------------------- */
.mjl-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(360px, 100%);
}
.mjl-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 15px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease, background .16s ease;
}
.mjl-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mjl-btn:active { transform: translateY(1px) scale(.99); }
.mjl-btn:hover { filter: brightness(1.07); }
.mjl-btn.primary {
  border: 1px solid rgba(255, 242, 198, .6);
  background: linear-gradient(180deg, #f2d98f 0%, #d4ad52 100%);
  color: #10301f;
  box-shadow: 0 10px 26px rgba(212, 173, 82, .3), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.mjl-btn.ghost {
  border: 1px solid rgba(232, 197, 99, .46);
  background: rgba(255, 255, 255, .05);
  color: #f2e6bd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}
.mjl-btn.ghost:hover { background: rgba(232, 197, 99, .12); }

.mjl-foot {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(234, 243, 238, .4);
  text-align: center;
}

@keyframes mjl-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 480px) {
  #mj-lobby { padding: max(14px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); }
  .mjl-main { gap: 20px; }
  .mjl-title { font-size: clamp(30px, 10vw, 44px); }
  .mjl-sub { font-size: 13px; }
  .mjl-btn { min-height: 50px; font-size: 14px; }
}

@media (max-height: 560px) {
  .mjl-main { gap: 14px; }
  .mjl-title { font-size: clamp(28px, 6vw, 44px); }
  .mjl-hero .mjl-sub { display: none; }
  .mjl-btn { min-height: 44px; }
}
