/* ============================================================
   Agora Live Arena — Lobby redesign (ADDITIVE OVERRIDE)
   Load AFTER games/live-arena/game.css.
   Restyles ONLY the host lobby; all other screens untouched.
   Reuses existing --la-* tokens; adds --la-cream.
   ============================================================ */
#la-overlay { --la-cream: #f4ecd8; }

/* ── Theme adoption — lobby only ────────────────────────── */
/* Override --la-* accent vars inside the lobby so the waiting
   room adopts the site theme; game screens stay unchanged.   */
#la-host-lobby {
  --la-gold:     var(--sym-accent,   #c9a44a);
  --la-gold-dim: color-mix(in srgb, var(--sym-accent, #c9a44a) 38%, transparent);
  --la-border:   var(--sym-hairline, rgba(201,164,74,0.18));
  --la-olive:    var(--sym-sage,     #3a5c25);
  --la-olive-dk: color-mix(in srgb, var(--sym-sage, #3a5c25) 45%, #000000 55%);
  --la-text:     var(--sym-bg-light, #e8dfc8);
  --la-muted:    var(--sym-stone,    #8a7a60);
}

/* ---- Lobby shell ---- */
/* NOTE: display is intentionally omitted — .la-screen / .la-screen.la-active
   in game.css own the display toggle. Adding display:flex here (ID specificity)
   would override display:none and break screen switching. */
#la-host-lobby {
  flex-direction: column;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(201,164,74,0.07), transparent 60%),
    radial-gradient(ellipse 60% 40% at 12% 110%, rgba(58,92,37,0.10), transparent 55%),
    var(--la-base);
  align-items: stretch; padding: 0;
}

/* ---- Top brand bar ---- */
#la-host-lobby .la-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 16px 26px; border-bottom: 1px solid var(--la-border); flex-shrink: 0;
}
#la-host-lobby .la-brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
#la-host-lobby .la-brand-logo { width: 36px; height: 36px; color: var(--la-gold); flex-shrink: 0; }
#la-host-lobby .la-brand-name {
  font-family: 'Cinzel','Raleway',serif; font-size: 16px; font-weight: 600;
  letter-spacing: .5px; color: var(--la-text); line-height: 1;
}
#la-host-lobby .la-brand-name span { color: var(--la-gold); }
#la-host-lobby .la-brand-sub {
  font-family: 'Raleway',sans-serif; font-size: 9.5px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--la-muted); white-space: nowrap; margin-top: 3px;
}
#la-host-lobby .la-topbar-mid {
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; min-width: 0;
}
#la-host-lobby .la-topbar-game {
  font-family: 'Cormorant Garamond',serif; font-size: 22px; font-weight: 400; color: var(--la-text);
  line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw;
}
#la-host-lobby .la-topbar-meta {
  font-family: 'Raleway',sans-serif; font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--la-muted);
}
#la-host-lobby .la-icon-btn {
  background: transparent; border: 1px solid var(--la-border); color: var(--la-muted);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: color .2s, border-color .2s, background .2s;
}
#la-host-lobby .la-icon-btn:hover { color: var(--la-text); border-color: var(--la-gold-dim); background: rgba(201,164,74,0.06); }

/* ---- Main split grid ---- */
#la-host-lobby .la-lobby-grid {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: minmax(430px, 0.92fr) 1.08fr; position: relative;
}
#la-host-lobby .la-lobby-grid::before {
  content: ''; position: absolute; top: 8%; bottom: 8%; left: min(430px, 47%); width: 1px;
  background: linear-gradient(180deg, transparent, var(--la-border) 30%, var(--la-border) 70%, transparent);
  pointer-events: none;
}

/* ---- Left: join panel ---- */
#la-host-lobby .la-join-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 28px 40px; min-width: 0; overflow-y: auto;
}
#la-host-lobby .la-join-instruct { text-align: center; }
#la-host-lobby .la-join-il {
  font-family: 'Raleway',sans-serif; font-size: 10px; letter-spacing: 3px;
  text-transform: uppercase; color: var(--la-muted); margin-bottom: 6px;
}
#la-host-lobby .la-join-iu {
  font-family: 'Cormorant Garamond',serif; font-size: clamp(20px,2.4vw,26px);
  font-weight: 600; color: var(--la-gold);
}

#la-host-lobby .la-code-row {
  display: flex; align-items: stretch; gap: 26px; flex-wrap: wrap; justify-content: center;
}
#la-host-lobby .la-qr-card {
  background: var(--la-cream); width: 178px; padding: 14px; border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(201,164,74,.25); position: relative; flex-shrink: 0;
}
#la-host-lobby #la-qr-box {
  width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
#la-host-lobby #la-qr-box img,
#la-host-lobby #la-qr-box canvas { display: block; width: 150px !important; height: 150px !important; }
#la-host-lobby .la-qr-hint {
  font-family: 'Raleway',sans-serif; font-size: 8.5px; letter-spacing: 2px; text-transform: uppercase;
  color: #6b5a36; text-align: center; margin-top: 8px;
}

#la-host-lobby .la-pin-cluster {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
#la-host-lobby .la-pin-label {
  font-family: 'Raleway',sans-serif; font-size: 9.5px; letter-spacing: 4px;
  text-transform: uppercase; color: var(--la-muted); margin: 0 0 6px;
}
#la-host-lobby .la-pin-display {
  font-family: 'Cinzel','Raleway',serif; font-weight: 600;
  font-size: clamp(46px,6.2vw,72px); line-height: 1; color: var(--la-gold);
  letter-spacing: 8px; text-shadow: 0 0 44px rgba(201,164,74,.4); margin: 0;
}
#la-host-lobby .la-pin-share { display: flex; gap: 10px; margin-top: 14px; }
#la-host-lobby .la-share-btn {
  font-family: 'Raleway',sans-serif; font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px;
  text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  color: var(--la-text); background: rgba(255,255,255,0.03); border: 1px solid var(--la-border);
  padding: 10px 15px; transition: background .2s, border-color .2s, color .2s;
}
#la-host-lobby .la-share-btn svg { width: 15px; height: 15px; }
#la-host-lobby .la-share-btn:hover { background: rgba(201,164,74,0.08); border-color: var(--la-gold-dim); }

/* Banner (uploadable class banner) */
#la-host-lobby .la-lobby-banner {
  position: relative; width: 100%; max-width: 420px; height: 52px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--la-border); cursor: pointer; background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
}
#la-host-lobby .la-lobby-banner:not(.la-has-img) {
  background-image: repeating-linear-gradient(135deg, rgba(201,164,74,0.06) 0 10px, transparent 10px 20px);
  background-color: var(--la-panel-2);
}
#la-host-lobby .la-banner-hint {
  display: inline-flex; align-items: center; gap: 8px; font-family: 'Raleway',sans-serif;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--la-muted); transition: color .2s;
}
#la-host-lobby .la-banner-hint svg { width: 15px; height: 15px; color: var(--la-gold); }
#la-host-lobby .la-lobby-banner:hover .la-banner-hint { color: var(--la-text); }
#la-host-lobby .la-lobby-banner.la-has-img .la-banner-hint {
  background: rgba(13,11,8,.55); padding: 5px 12px; border-radius: 999px; opacity: 0;
}
#la-host-lobby .la-lobby-banner.la-has-img:hover .la-banner-hint { opacity: 1; }

/* Host identity */
#la-host-lobby .la-host-id {
  display: flex; align-items: center; gap: 14px; padding: 11px 15px; width: 100%; max-width: 420px;
  background: var(--la-panel); border: 1px solid var(--la-border); border-radius: 6px;
}
#la-host-lobby .la-host-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  background: var(--la-olive-dk); border: 1px solid var(--la-gold-dim); overflow: hidden;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; transition: border-color .2s;
}
#la-host-lobby .la-host-avatar:hover { border-color: var(--la-gold); }
#la-host-lobby .la-host-avatar.la-has-img .la-av-initials { display: none; }
#la-host-lobby .la-av-initials { font-family: 'Cormorant Garamond',serif; font-size: 22px; font-weight: 600; color: var(--la-gold); }
#la-host-lobby .la-host-id-name { font-family: 'Cormorant Garamond',serif; font-size: 19px; font-weight: 600; color: var(--la-text); line-height: 1.1; }
#la-host-lobby .la-host-id-role {
  font-family: 'Raleway',sans-serif; font-size: 9.5px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--la-gold); opacity: .65; margin-top: 3px;
}

/* ---- Right: players ---- */
#la-host-lobby .la-players-col { display: flex; flex-direction: column; min-width: 0; padding: 28px 38px 22px; }
#la-host-lobby .la-players-header {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-bottom: 16px;
  font-family: 'Raleway',sans-serif; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--la-muted);
}
#la-host-lobby .la-player-badge {
  background: var(--la-olive-dk); border: 1px solid rgba(142,186,114,.35); color: #8eba72;
  font-size: 13px; font-weight: 700; padding: 2px 13px; border-radius: 999px; min-width: 30px; text-align: center;
}
#la-host-lobby .la-player-grid {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 9px; align-content: flex-start; padding-right: 4px;
}
#la-host-lobby .la-player-chip {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--la-border);
  font-family: 'Raleway',sans-serif; font-size: 13px; font-weight: 500; color: var(--la-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Footer ---- */
#la-host-lobby .la-lobby-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 16px 38px; border-top: 1px solid var(--la-border); flex-shrink: 0; margin: 0;
}
#la-host-lobby .la-settings { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#la-host-lobby .la-pill {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: 'Raleway',sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .4px; color: var(--la-text);
  background: rgba(255,255,255,0.03); border: 1px solid var(--la-border); border-radius: 999px; padding: 8px 14px;
  transition: background .18s, border-color .18s, color .18s;
}
#la-host-lobby .la-pill svg { width: 15px; height: 15px; color: var(--la-gold); }
#la-host-lobby .la-pill .la-pill-val { color: var(--la-gold); }
#la-host-lobby .la-pill:hover { background: rgba(201,164,74,0.07); border-color: var(--la-gold-dim); }
#la-host-lobby .la-pill.la-pill-on { background: rgba(201,164,74,0.12); border-color: var(--la-gold-dim); }

/* Start button keeps original .la-start-btn look but reset margin for footer */
#la-host-lobby .la-lobby-footer .la-start-btn { margin: 0; padding: 15px 44px; }

/* ---- Responsive ---- */
@media (max-width: 880px) {
  #la-host-lobby .la-lobby-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  #la-host-lobby .la-lobby-grid::before { display: none; }
  #la-host-lobby .la-join-panel { border-bottom: 1px solid var(--la-border); }
  #la-host-lobby .la-players-col { min-height: 260px; }
  #la-host-lobby .la-topbar-mid { display: none; }
}
@media (max-width: 560px) {
  #la-host-lobby .la-lobby-footer { flex-direction: column; align-items: stretch; }
  #la-host-lobby .la-lobby-footer .la-start-btn { width: 100%; }
}
