#lobby-design { display:none; }
#lobby.lobby-design-enabled { display:block; padding:0; overflow:auto; background:#060b11; color:#f5f7fa; font-family:Arial,sans-serif; }
#lobby.lobby-design-enabled > #lobby-card { display:none; }
#lobby.lobby-design-enabled > #lobby-design { display:flex; flex-direction:column; min-height:100dvh; background:radial-gradient(ellipse at 50% 25%,#10202c,#060b11 70%); }
#lobby-design * { box-sizing:border-box; }
#lobby-design button,#lobby-design input { font:inherit; }
#lobby-design button { cursor:pointer; }
#lobby-design button:hover { filter:brightness(1.12); }
#lobby-design svg { width:24px; height:24px; flex-shrink:0; }
#lobby-design em { color:#ffdc00; font-style:normal; }
.lp-header { height:70px; flex-shrink:0; display:flex; align-items:center; gap:24px; padding:7px 30px; border-bottom:1px solid #ffffff18; background:#071019f2; }
.lp-brand { display:flex; align-items:center; gap:10px; white-space:nowrap; }
.lp-brand img { width:50px; height:50px; object-fit:contain; }
.lp-brand strong { font-size:25px; letter-spacing:-.8px; }
.lp-header nav { display:flex; align-items:center; gap:8px; margin-right:auto; }
.lp-header nav span { padding:12px 16px; color:#c8d0dc; font-size:13px; }
.lp-header nav .active { color:#ffe020; border:1px solid #9f8220; border-radius:8px; background:#6c571e44; }
.lp-user { display:flex; align-items:center; gap:9px; }
.lp-user strong,.lp-user small { display:block; max-width:135px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lp-user small { margin-top:4px; color:#aab5c4; font-size:10px; }
.lp-avatar { width:38px; height:38px; display:grid; place-items:center; border:2px solid #a78a39; border-radius:50%; background:linear-gradient(135deg,#164e51,#192631); background-size:cover; background-position:center; }
.lp-wallet { min-width:220px; display:grid; grid-template-columns:1fr 42px; grid-template-rows:auto auto; column-gap:14px; padding:7px 7px 7px 15px; border:1px solid #806a22; border-radius:9px; background:#2b240f66; }
.lp-wallet small { grid-column:1; color:#b9b6aa; font-size:9px; }
.lp-wallet strong { grid-column:1; color:#ffdc00; font-size:19px; }
.lp-wallet button { grid-column:2; grid-row:1 / 3; border:0; border-radius:7px; background:#ffdc00; color:#161200; font-size:30px; font-weight:800; }
.lp-main { display:flex; flex:1; min-height:0; flex-direction:column; gap:10px; padding:10px 28px 14px; }
.lp-hero { position:relative; flex:0 0 190px; overflow:hidden; border:1px solid #ffffff2a; border-radius:14px; background:linear-gradient(90deg,#050a11ec 0%,#050a11b0 35%,#050a1128 70%,#050a116e),url('../images/ludo-bg.jpg') center 49% / cover; }
.lp-title { position:relative; z-index:1; padding:16px 28px; }
.lp-title > span { color:#ffdc00; font-weight:800; letter-spacing:2px; }
.lp-title h1 { margin:5px 0 4px; font-size:34px; line-height:1; }
.lp-title p { margin:0; color:#d1d8e2; font-size:15px; }
.lp-hero-logo { position:absolute; z-index:1; right:30px; top:0; width:170px; height:125px; object-fit:contain; filter:drop-shadow(0 8px 18px #000c); }
.lp-summary { position:absolute; z-index:2; left:28px; right:28px; bottom:10px; display:flex; align-items:stretch; gap:12px; }
.lp-summary > div { display:flex; align-items:center; gap:12px; min-height:62px; padding:7px 14px; border:1px solid #547080; border-radius:10px; background:#08121ce8; backdrop-filter:blur(8px); }
.lp-summary > .lp-access { flex:1.9; display:grid; grid-template-columns:.8fr 1.35fr; gap:0; padding:5px 10px; }
.lp-code,.lp-link { min-width:0; display:grid; grid-template-columns:88px minmax(80px,1fr) 34px; align-items:center; gap:7px; min-height:48px; cursor:pointer; border-radius:5px; }
.lp-code:hover,.lp-link:hover,.lp-code:focus-visible,.lp-link:focus-visible { background:#ffffff08; outline:none; }
.lp-code { border-right:1px solid #ffffff18; padding-right:9px; }
.lp-link { padding-left:10px; }
.lp-code > small,.lp-link > small { color:#cbd3dd; font-weight:700; }
.lp-code > small span,.lp-link > small span { display:block; margin-top:2px; color:#7f92a5; font-size:8px; font-weight:500; letter-spacing:.2px; }
.lp-code > strong { color:#ffdc00; font-size:22px; letter-spacing:3px; }
.lp-link > strong { overflow:hidden; color:#c9d6e3; font-size:11px; font-weight:500; text-overflow:ellipsis; white-space:nowrap; }
.lp-code button,.lp-link button { width:34px; height:34px; display:grid; place-items:center; padding:0; border:1px solid #647180; border-radius:6px; background:#13202d; color:white; }
.lp-code svg,.lp-link svg { width:17px; height:17px; }
.lp-status { flex:.85; border-color:#008a58 !important; }
.lp-status > i,.lp-chat header i { width:13px; height:13px; border-radius:50%; background:#00dd83; box-shadow:0 0 12px #00dd8388; }
.lp-status strong { color:#26ed9d; font-size:19px; }
.lp-status small,.lp-count small,.lp-stake small { display:block; margin-top:5px; color:#d1d7df; }
.lp-count { flex:.45; }
.lp-stake { flex:.62; }
.lp-count strong,.lp-stake strong { font-size:20px; white-space:nowrap; }
.lp-columns { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(350px,.95fr); align-items:start; gap:12px; flex:0 0 auto; min-height:0; }
.lp-left,.lp-right { display:flex; flex-direction:column; gap:12px; min-width:0; min-height:0; }
.lp-panel { border:1px solid #ffffff1b; border-radius:13px; padding:16px; background:linear-gradient(135deg,#0e1821e8,#08111ae8); }
.lp-panel h2 { display:flex; align-items:center; gap:10px; margin:0; font-size:20px; }
.lp-panel h2 span { color:#c4cbd5; font-weight:400; }
.lp-panel header p { margin:6px 0 0 34px; color:#b6c0cc; font-size:13px; }
.lp-players { flex:0 0 auto; min-height:0; padding:11px 14px; }
.lp-player-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:9px; }
.lp-player { position:relative; display:grid; grid-template-columns:45px 1fr auto 42px; align-items:center; gap:8px; min-height:67px; padding:7px 9px; border:1px solid #526271; border-radius:9px; background:#07121be6; }
.lp-player.filled:first-child { border:2px solid #ffdc00; }
.lp-seat { position:absolute; top:9px; left:10px; width:27px; height:27px; display:grid; place-items:center; border-radius:50%; background:#1b2c39; color:#dbe2eb; font-weight:700; }
.lp-player-avatar { width:42px; height:42px; display:grid; place-items:center; border:2px solid #a88f50; border-radius:50%; background:#142431; color:#fff; font-size:18px; }
.lp-player-avatar svg { width:24px; height:24px; color:#aab6c4; }
.lp-player > div strong { font-size:16px; }
.lp-player > div small { display:flex; align-items:center; gap:6px; margin-top:4px; color:#21e69b; font-size:11px; }
.lp-player > div small i { width:11px; height:11px; border-radius:50%; background:#16e393; }
.lp-player > b { padding:7px 12px; border-radius:6px; background:#ffdc00; color:#171300; text-transform:capitalize; }
.lp-piece { display:grid; place-items:center; height:43px; border-left:1px solid #ffffff12; color:var(--player-color); font-size:0; text-shadow:0 3px 7px #000; }
.lp-piece::before { content:""; width:20px; height:31px; border:2px solid #ffffff88; border-radius:50% 50% 42% 42%; background:var(--player-color); box-shadow:0 0 0 4px color-mix(in srgb,var(--player-color) 35%,transparent),0 5px 8px #0009; }
.lp-player.empty { border-style:dashed; opacity:.72; }
.lp-player.empty .lp-player-avatar { border-color:#637181; }
.lp-player.empty > div small { color:#adb6c1; line-height:1.35; }
.lp-start { display:flex; align-items:center; justify-content:center; gap:14px; min-height:50px; border:0; border-radius:9px; background:linear-gradient(#ffe328,#ffc900); color:#171300; font-size:19px; font-weight:800; box-shadow:0 8px 24px #ffd50028; }
.lp-start:disabled { background:#766c34; color:#c8c19a; box-shadow:none; cursor:not-allowed; }
.lp-start-note { margin:0; color:#c5ccd5; text-align:center; }
.lp-leave { align-self:center; display:flex; align-items:center; gap:7px; border:0; background:none; color:#aeb8c4; }
.lp-leave svg { width:18px; height:18px; }
.lp-settings h2,.lp-chat h2 { font-size:18px; }
.lp-setting { display:grid; grid-template-columns:1fr 1.4fr; align-items:center; gap:12px; margin-top:12px; }
.lp-setting span { color:#c5cdd8; }
.lp-setting strong { padding:11px 13px; border:1px solid #485765; border-radius:8px; background:#101c27; }
.lp-chat { flex:0 0 300px; min-height:230px; display:flex; flex-direction:column; }
.lp-chat header { display:flex; align-items:center; justify-content:space-between; }
.lp-chat header > span { display:flex; align-items:center; gap:7px; color:#c5cdd8; }
.lp-chat-note { margin:8px 0; padding:5px 8px; border-radius:5px; background:#ffffff05; color:#8e9cac; font-size:10px; }
.lp-messages { flex:1; min-height:80px; overflow:auto; scroll-behavior:smooth; }
.lp-messages > div { display:grid; grid-template-columns:auto 1fr; align-items:start; gap:8px; margin:8px 0; }
.lp-messages b { color:#aab7c5; font-size:11px; }
.lp-messages p { margin:0; padding:7px 10px; border-radius:8px; background:#1a2936; color:#edf1f5; }
.lp-chat form { display:flex; gap:8px; }
.lp-chat input { flex:1; min-width:0; min-height:42px; padding:9px 12px; border:1px solid #485765; border-radius:8px; background:#101c27; color:white; }
.lp-chat form button { min-width:86px; border:0; border-radius:8px; background:#ffdc00; color:#171300; font-weight:800; }
.lp-messages,.lp-chat { scrollbar-width:thin; scrollbar-color:#b89b38 #101720; }
.lp-messages::-webkit-scrollbar,#lobby.lobby-design-enabled::-webkit-scrollbar { width:8px; }
.lp-messages::-webkit-scrollbar-track,#lobby.lobby-design-enabled::-webkit-scrollbar-track { background:#101720; }
.lp-messages::-webkit-scrollbar-thumb,#lobby.lobby-design-enabled::-webkit-scrollbar-thumb { background:#b89b38; border-radius:8px; }

@media (max-width:1150px) {
  .lp-header { gap:12px; padding-inline:18px; }
  .lp-header nav span { padding-inline:8px; }
  .lp-user > div { display:none; }
  .lp-wallet { min-width:180px; }
  .lp-main { padding-inline:18px; }
  .lp-summary > div { padding-inline:11px; }
  .lp-code button,.lp-link button { padding-inline:8px; }
  .lp-player { grid-template-columns:55px 1fr auto; }
  .lp-player-avatar { width:54px; height:54px; }
  .lp-piece { display:none; }
}

@media (max-width:800px) {
  #lobby.lobby-design-enabled { scroll-behavior:smooth; }
  .lp-header { position:sticky; top:0; z-index:20; min-height:64px; height:auto; padding:7px 10px; }
  .lp-brand { margin-right:auto; gap:4px; }
  .lp-brand img { width:40px; height:40px; }
  .lp-brand strong { font-size:18px; }
  .lp-header nav,.lp-user { display:none; }
  .lp-wallet { min-width:0; padding-left:9px; }
  .lp-wallet small { display:none; }
  .lp-wallet strong { align-self:center; font-size:15px; }
  .lp-main { padding:9px; }
  .lp-hero { flex-basis:auto; min-height:385px; }
  .lp-title { padding:16px; }
  .lp-title h1 { font-size:31px; }
  .lp-title p { font-size:13px; }
  .lp-hero-logo { width:130px; height:110px; right:6px; top:55px; opacity:.8; }
  .lp-summary { left:12px; right:12px; bottom:12px; display:grid; grid-template-columns:1fr 1fr; gap:7px; }
  .lp-summary > div { min-height:65px; padding:8px 10px; }
  .lp-summary > .lp-access { grid-column:1 / -1; display:grid; grid-template-columns:1fr 1.25fr; }
  .lp-code,.lp-link { grid-template-columns:78px minmax(70px,1fr) 34px; }
  .lp-code > strong { font-size:21px; }
  .lp-status strong { font-size:15px; }
  .lp-count strong,.lp-stake strong { font-size:16px; }
  .lp-columns { display:flex; flex-direction:column; }
  .lp-player-grid { grid-template-columns:1fr; }
  .lp-player { min-height:90px; }
  .lp-players { min-height:0; }
  .lp-start { min-height:54px; font-size:18px; }
  .lp-settings,.lp-chat { min-height:0; }
}

@media (max-width:480px) {
  .lp-brand strong { max-width:80px; white-space:normal; line-height:1.05; font-size:15px; }
  .lp-wallet button { width:38px; height:38px; }
  .lp-hero { min-height:340px; }
  .lp-title h1 { font-size:27px; }
  .lp-hero-logo { display:none; }
  .lp-summary { grid-template-columns:1fr; }
  .lp-summary > .lp-access { grid-column:1; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); }
  .lp-code,.lp-link { grid-template-columns:1fr 32px; min-height:54px; padding-block:3px; }
  .lp-code { border-right:1px solid #ffffff18; border-bottom:0; padding-right:6px; }
  .lp-link { padding-left:6px; }
  .lp-code > small,.lp-link > small { grid-column:1; grid-row:1; }
  .lp-code > strong,.lp-link > strong { grid-column:1; grid-row:2; }
  .lp-code button,.lp-link button { grid-row:1 / 3; width:30px; height:30px; padding:0; }
  .lp-code button,.lp-link button { grid-column:2; }
  .lp-status,.lp-count,.lp-stake { min-height:55px !important; }
  .lp-count,.lp-stake { display:none !important; }
  .lp-panel { padding:10px; }
  .lp-panel h2 { font-size:17px; }
  .lp-panel header p { margin-left:0; line-height:1.4; }
  .lp-player-grid { margin-top:9px; gap:7px; }
  .lp-player { grid-template-columns:42px 1fr auto; min-height:68px; padding:7px; gap:7px; }
  .lp-player-avatar { width:40px; height:40px; font-size:17px; }
  .lp-player > div strong { font-size:14px; }
  .lp-player > div small { font-size:11px; }
  .lp-player > b { padding:5px 7px; font-size:10px; }
  .lp-setting { grid-template-columns:1fr; gap:5px; }
  .lp-invite-actions { grid-template-columns:1fr; }
  .lp-chat { flex-basis:245px; }
  .lp-messages { max-height:125px; }
  .lp-chat form button { min-width:70px; }
}

/* Desktop private rooms use the same focused, scale-aware popup language as matchmaking. */
@media (min-width:844px) {
  #lobby.lobby-design-enabled { display:flex; align-items:center; justify-content:center; min-height:100dvh; padding:0; overflow:hidden; }
  #lobby.lobby-design-enabled > #lobby-design {
    position:absolute;
    inset:0;
    min-height:0;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    background:linear-gradient(rgba(0,5,10,.8),rgba(0,5,10,.88)),url('../images/ludo-bg.jpg') center/cover;
  }
  .lp-header { display:none; }
  .lp-main {
    width:520px;
    height:570px;
    flex:none;
    display:flex;
    flex-direction:column;
    gap:8px;
    padding:14px;
    overflow:hidden;
    border:1px solid #d9b600;
    border-radius:18px;
    background:linear-gradient(145deg,rgba(8,22,32,.99),rgba(3,13,21,.99));
    box-shadow:0 28px 90px #000,0 0 38px rgba(255,212,0,.08);
    transform:scale(var(--lobby-ui-scale,1));
    transform-origin:center;
  }
  .lp-hero { flex:0 0 auto; overflow:visible; border:0; border-radius:0; background:none; }
  .lp-title { display:grid; grid-template-columns:48px 1fr 34px; align-items:center; gap:10px; padding:0 0 9px; border-bottom:1px solid #22303b; }
  .lp-title>img { width:48px; height:48px; object-fit:contain; }
  .lp-title>div>span { color:#ffdc00; font-size:10px; font-weight:800; letter-spacing:1.5px; }
  .lp-title h1 { margin:1px 0 2px; font-size:24px; }
  .lp-title p { font-size:11px; }
  .lp-title>button { width:34px; height:34px; padding:0; border:2px solid #d9b600; border-radius:50%; background:transparent; color:#fff; font-size:25px; line-height:1; }
  .lp-hero-logo { display:none; }
  .lp-summary { position:static; display:grid; grid-template-columns:1.3fr .7fr .8fr; gap:6px; margin-top:8px; }
  .lp-summary>div { min-height:48px; gap:7px; padding:6px 8px; border-radius:8px; }
  .lp-summary>.lp-access { grid-column:1/-1; display:grid; grid-template-columns:.8fr 1.2fr; min-height:54px; padding:3px 7px; }
  .lp-code,.lp-link { grid-template-columns:68px minmax(60px,1fr) 28px; min-height:44px; gap:5px; }
  .lp-code { padding-right:6px; }
  .lp-link { padding-left:7px; }
  .lp-code>small,.lp-link>small { font-size:9px; }
  .lp-code>small span,.lp-link>small span { font-size:7px; }
  .lp-code>strong { font-size:17px; letter-spacing:2px; }
  .lp-link>strong { font-size:9px; }
  .lp-code button,.lp-link button { width:28px; height:28px; }
  .lp-code svg,.lp-link svg { width:14px; height:14px; }
  .lp-status strong { font-size:13px; }
  .lp-status small,.lp-count small,.lp-stake small { margin-top:2px; font-size:9px; }
  .lp-count strong,.lp-stake strong { font-size:14px; }
  .lp-summary svg { width:18px; height:18px; }
  .lp-columns { flex:1; min-height:0; display:grid; grid-template-columns:1.45fr .9fr; gap:8px; }
  .lp-left,.lp-right { gap:7px; min-height:0; }
  .lp-panel { padding:8px; border-radius:9px; }
  .lp-panel h2 { gap:6px; font-size:14px; }
  .lp-panel h2 svg { width:17px; height:17px; }
  .lp-panel header p { margin:2px 0 0 23px; font-size:8px; }
  .lp-players { flex:1; min-height:0; }
  .lp-player-grid { grid-template-columns:1fr; gap:4px; margin-top:6px; }
  .lp-player { grid-template-columns:35px 1fr auto 28px; min-height:46px; gap:5px; padding:4px 6px; border-radius:7px; }
  .lp-seat { top:6px; left:7px; width:20px; height:20px; font-size:10px; }
  .lp-player-avatar { width:32px; height:32px; font-size:13px; }
  .lp-player-avatar svg { width:17px; height:17px; }
  .lp-player>div strong { font-size:11px; }
  .lp-player>div small { gap:3px; margin-top:1px; font-size:8px; }
  .lp-player>div small i { width:7px; height:7px; }
  .lp-player>b { padding:4px 6px; font-size:8px; }
  .lp-piece { height:30px; }
  .lp-piece::before { width:14px; height:21px; }
  .lp-start { min-height:35px; gap:7px; border-radius:7px; font-size:12px; }
  .lp-start svg { width:16px; height:16px; }
  .lp-start-note { font-size:9px; }
  .lp-leave { gap:4px; font-size:10px; }
  .lp-chat { flex:1; min-height:0; padding:8px; }
  .lp-settings h2,.lp-chat h2 { font-size:14px; }
  .lp-chat header>span { gap:4px; font-size:9px; }
  .lp-chat header i { width:8px; height:8px; }
  .lp-chat-note { margin:5px 0; padding:4px 5px; font-size:7px; }
  .lp-messages { min-height:0; font-size:8px; }
  .lp-messages>div { grid-template-columns:1fr; gap:2px; margin:4px 0; }
  .lp-messages b { font-size:8px; }
  .lp-messages p { padding:5px 6px; font-size:9px; }
  .lp-chat form { gap:4px; }
  .lp-chat input { min-height:32px; padding:6px 7px; font-size:9px; }
  .lp-chat form button { min-width:48px; font-size:9px; }
}

/* Private-room reference layout: compact summary, seats and primary actions only. */
@media (min-width:844px) {
  .lp-main { width:560px; height:auto; max-height:570px; padding:14px 16px; }
  .lp-title { grid-template-columns:58px 1fr 38px; }
  .lp-title>img { width:56px; height:56px; }
  .lp-title h1 { font-size:26px; }
  .lp-title>button { width:38px; height:38px; }
  .lp-summary { grid-template-columns:145px minmax(0,1fr) 118px; }
  .lp-summary>.lp-access { display:contents; }
  .lp-summary .lp-code { grid-column:1; grid-row:1; }
  .lp-summary .lp-link { grid-column:2; grid-row:1; }
  .lp-summary .lp-code,.lp-summary .lp-link { min-height:58px;padding:6px 7px;border:1px solid #547080;border-radius:8px;background:#08121ce8; }
  .lp-summary .lp-code { grid-template-columns:minmax(0,1fr) 28px;border-right:1px solid #547080; }
  .lp-summary .lp-link { grid-template-columns:minmax(0,1fr) 28px; }
  .lp-summary .lp-code>small,.lp-summary .lp-link>small { grid-column:1;grid-row:1; }
  .lp-summary .lp-code>strong,.lp-summary .lp-link>strong { grid-column:1;grid-row:2; }
  .lp-summary .lp-code>button,.lp-summary .lp-link>button { grid-column:2;grid-row:1/3; }
  .lp-summary>.lp-stake { grid-column:3; grid-row:1; }
  .lp-summary>.lp-status { grid-column:1/-1; grid-row:2; min-height:42px; }
  .lp-status strong { font-size:15px; }
  .lp-columns { display:block; flex:none; }
  .lp-right { display:none; }
  .lp-left { gap:7px; }
  .lp-players { flex:none; }
  .lp-panel header p { display:none; }
  .lp-player-grid { grid-template-columns:1fr; }
  .lp-player-grid[data-seats="3"],.lp-player-grid[data-seats="4"] { grid-template-columns:1fr 1fr; }
  .lp-player { min-height:52px; }
  .lp-start { min-height:42px; font-size:14px; }
  .lp-start-note { display:none; }
  .lp-leave { min-height:27px; font-size:12px; }
}
