/* Desktop reference composition. The working lobby remains available via the
   explicit live-lobby switch; small-screen presentation is untouched. */
#desktop-design, .desktop-preview-restore { display: none; }
@media (min-width: 0px) {
    #dashboard.desktop-preview-enabled { display: block; width: 100%; height: 100dvh; max-height: none; padding: 0; margin: 0; overflow: auto; background: #060b11; }
    #dashboard.desktop-preview-enabled > :not(#desktop-design) { display: none !important; }
    #dashboard.desktop-preview-enabled > #desktop-design { display: flex; }
    #dashboard:not(.desktop-preview-enabled) > .desktop-preview-restore { display: block; position: fixed; right: 20px; bottom: 12px; z-index: 90; border: 1px solid #b29829; border-radius: 8px; padding: 9px 14px; background: #181a1f; color: #ffe02b; cursor: pointer; }
    #desktop-design { --dp-line: #ffffff19; --dp-muted: #aeb6c4; --dp-gold: #ffdc00; flex-direction: column; min-height: 100dvh; color: #f4f6fa; font-family: Arial,sans-serif; font-size: 12px; background: radial-gradient(ellipse at 50% 30%,#131c26 0%,#080d13 70%); }
    #desktop-design * { box-sizing: border-box; }
    #desktop-design button, #desktop-design select, #desktop-design input { font: inherit; }
    #desktop-design button, #desktop-design a { -webkit-tap-highlight-color: transparent; }
    #desktop-design button { cursor: pointer; }
    #desktop-design button:hover { filter: brightness(1.17); }
    #desktop-design :focus-visible { outline: 2px solid #ffe14b; outline-offset: 3px; }
    #desktop-design a { color: inherit; text-decoration: none; }
    #desktop-design h2, #desktop-design h3, #desktop-design p { margin: 0; }
    #desktop-design em { color: var(--dp-gold); font-style: normal; }
    #desktop-design .dp-icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
    #desktop-design .dp-header { position: sticky; z-index: 200; top: 0; width:calc(100% - 32px); height:58px; min-height:58px; flex:0 0 58px; align-self:center; display:flex; align-items:center; gap:clamp(9px,1vw,16px); margin-inline:auto; padding:4px 12px; border:1px solid #1f647b; border-radius:9px; background:linear-gradient(110deg,#07131df8,#030a11fc); box-shadow:0 5px 18px #0005; backdrop-filter:blur(14px); }
    #desktop-design .dp-brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
    #desktop-design .dp-brand img { width: 48px; height: 48px; object-fit: contain; }
    #desktop-design .dp-header .dp-brand strong { font-size:clamp(20px,1.75vw,25px); letter-spacing:-.8px; }
    #desktop-design .dp-nav { display: flex; gap: 8px; margin-right: auto; align-items: center; }
    #desktop-design .dp-nav a, #desktop-design .dp-nav button { display:flex; align-items:center; gap:9px; min-height:42px; padding:8px 14px; color:#c9d0dc; white-space:nowrap; border:0; border-radius:7px; background:transparent; font-size:13px; }
    #desktop-design .dp-nav .selected { color: #ffe127; background: #57460365; }
    #desktop-design .dp-nav .dp-icon { width: 17px; height: 17px; }
    #desktop-design .dp-nav .lucide { width:18px; height:18px; flex:none; display:block; }
    #desktop-design .dp-notification { position:relative; flex:0 0 36px; width:36px; height:42px; border:0; color:#bcc6d4; background:none; padding:6px; }
    #desktop-design .dp-notification b { position: absolute; right: 0; top: -4px; background: #ed343f; border-radius: 50%; min-width: 18px; height: 18px; font-size: 10px; display: grid; place-items: center; color: white; }
    #desktop-design .dp-notification .lucide { width:22px; height:22px; display:block; }
    #desktop-design .dp-profile { display:flex; align-items:center; gap:8px; min-width:0; white-space:nowrap; }
    #desktop-design .dp-profile strong { display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
    #desktop-design .dp-profile small { display: block; color: var(--dp-muted); margin-top: 3px; }
    #desktop-design .dp-profile button { background: none; border: 0; color: white; font-size: 20px; }
    #desktop-design .dp-avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 2px solid #ad8c39; border-radius: 50%; background: linear-gradient(135deg,#233c53,#192429); background-size: cover; background-position: center; color: #e8d7a9; font-size: 10px; flex-shrink: 0; }
    #desktop-design .avatar-1 { border-color: #5485b2; background-color: #142d47; }
    #desktop-design .avatar-2 { border-color: #a38871; background-color: #452b25; }
    #desktop-design .dp-wallet { display:flex; align-items:center; justify-content:space-between; gap:10px; height:48px; border:1px solid #385069; border-radius:7px; min-width:174px; padding:4px 5px 4px 10px; background:linear-gradient(120deg,#102131a8,#07111acc); }
    #desktop-design .dp-wallet small { color: #c3bfb0; font-size: 9px; }
    #desktop-design .dp-wallet strong { display: block; color: var(--dp-gold); font-size: 18px; margin-top: 3px; white-space: nowrap; }
    #desktop-design .dp-wallet button { width:36px; height:36px; border:0; border-radius:6px; background:var(--dp-gold); font-size:28px; line-height:1; color:#191500; font-weight:800; }
    #desktop-design .dp-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 12px 26px; min-height: 0; }
    #desktop-design .dp-hero { position: relative; flex: 0 0 clamp(210px,25vh,260px); overflow: hidden; border: 1px solid #ffffff30; border-radius: 13px; background: linear-gradient(90deg,#04080eed 0%,#04080e9c 28%,#04080e15 58%,#04080e75 100%),url('../images/ludo-bg.jpg') center 48% / cover; }
    #desktop-design .dp-hero-copy { position: relative; z-index: 1; padding: 12px 22px; height: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
    #desktop-design .dp-eyebrow { color: var(--dp-gold); font-weight: 800; letter-spacing: 1.5px; font-size: 12px; }
    #desktop-design h1 { margin: 5px 0 10px; font-size: clamp(30px,3vw,44px); line-height: 1.04; letter-spacing: -.8px; }
    #desktop-design .dp-hero p { font-size: 12px; color: #d1d6dd; }
    #desktop-design .dp-connection-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0; }
    #desktop-design .dp-online, #desktop-design .dp-server-status { display: flex; align-items: center; gap: 7px; color: #4aefa1; font-weight: 700; }
    #desktop-design .dp-online i, #desktop-design .dp-server-status i, #desktop-design .dp-waiting::before { content: ''; width: 9px; height: 9px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: #12d779; }
    #desktop-design .dp-server-status { padding-left: 16px; border-left: 1px solid #ffffff2b; }
    #desktop-design .dp-server-status[data-status="checking"], #desktop-design .dp-server-status[data-status="signed_out"] { color: #b7c1cb; }
    #desktop-design .dp-server-status[data-status="checking"] i, #desktop-design .dp-server-status[data-status="signed_out"] i { background: #8d9aa7; box-shadow: none; }
    #desktop-design .dp-server-status[data-status="offline"] { color: #ff765f; }
    #desktop-design .dp-server-status[data-status="offline"] i { background: #ff4c3e; box-shadow: 0 0 10px #ff4c3e88; }
    #desktop-design .dp-server-status[data-status="disabled"] { color: #ffd534; }
    #desktop-design .dp-server-status[data-status="disabled"] i { background: #e7b900; }
    #desktop-design .dp-sample { font-size: 8px; text-transform: uppercase; letter-spacing: .6px; font-weight: 400; color: #aeb89e; border: 1px solid #aeb89e35; border-radius: 4px; padding: 2px 4px; }
    #desktop-design .dp-hero-buttons { display: flex; gap: 16px; }
    #desktop-design .dp-yellow { border: 1px solid #ecc600; border-radius: 7px; background: linear-gradient(#ffe228,#ffd000); color: #131004; font-weight: 700; padding: 10px 20px; display: inline-flex; justify-content: center; align-items: center; gap: 12px; }
    #desktop-design .dp-outline { border: 1px solid #7d8490; border-radius: 8px; background: #0a101bbd; color: #fff; padding: 10px 20px; display: inline-flex; justify-content: center; align-items: center; gap: 12px; }
    #desktop-design .dp-hero-buttons button { min-width: 218px; min-height: 52px; }
    #desktop-design .dp-hero-buttons .dp-icon { width: 28px; height: 28px; }
    #desktop-design .dp-hero-buttons strong { display: block; font-size: 14px; }
    #desktop-design .dp-hero-buttons small { display: block; font-size: 10px; margin-top: 4px; }
    #desktop-design .dp-hero-join{width:270px;display:flex;flex-direction:column;justify-content:center;gap:5px;padding:6px 7px 7px;border:1px solid #7d8490;border-radius:8px;background:#07101bd9}
    #desktop-design .dp-hero-join label{padding-left:3px;color:#dce5ed;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.7px}
    #desktop-design .dp-hero-join>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
    #desktop-design .dp-hero-join input{min-width:0;height:33px;padding:0 10px;border:1px solid #405463;border-radius:5px;background:#101c26;color:white;font-weight:800;letter-spacing:2px;text-transform:uppercase}
    #desktop-design .dp-hero-join input::placeholder{color:#82909c;font-weight:500;letter-spacing:1px}
    #desktop-design .dp-hero-join .dp-yellow{min-width:66px;min-height:33px;padding:5px 11px}
    #desktop-design .dp-hero-logo { position: absolute; height: 95%; width: 24%; right: 20px; top: 2%; object-fit: contain; filter: drop-shadow(0 10px 20px #000a); }
    #desktop-design .dp-columns { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 12px; flex: 1; min-height: 0; }
    #desktop-design .dp-left, #desktop-design .dp-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
    #desktop-design .dp-panel { border: 1px solid var(--dp-line); border-radius: 12px; padding: 12px; background: linear-gradient(135deg,#111820cf,#0a1017e6); min-width: 0; }
    #desktop-design h2 { display: flex; align-items: center; gap: 9px; font-size: 12px; letter-spacing: .5px; }
    #desktop-design h2 > span:not(.dp-sample) { font-weight: 400; letter-spacing: 0; }
    #desktop-design h2 > small { font-size: 8px; font-weight: 400; letter-spacing: 0; color: #b7bfcb; }
    #desktop-design .dp-active { display: flex; align-items: center; gap: 15px; min-height: 96px; padding: 14px 16px; border-color: #0baf66; background: linear-gradient(105deg,#00321fbb,#081a18b0); }
    #desktop-design .dp-active[hidden] { display:none !important; }
    #desktop-design .dp-active h2 { font-size: 16px; letter-spacing: 0; }
    #desktop-design .dp-active p { margin: 6px 0; font-size: 11px; }
    #desktop-design .dp-active > .dp-yellow { margin-left: auto; white-space: nowrap; }
    #desktop-design .dp-game-symbol { border: 1px solid #03ad5833; border-radius: 12px; padding: 13px 9px; color: #00e478; background: #003d2444; }
    #desktop-design .dp-game-symbol .dp-icon { width: 32px; height: 32px; }
    #desktop-design .dp-game-meta { border-left: 1px solid #ffffff18; padding-left: 20px; margin-left: 8px; min-width: 116px; }
    #desktop-design .dp-game-meta strong { font-size: 11px; font-weight: 400; }
    #desktop-design .dp-game-meta small { display: flex; gap: 5px; align-items: center; margin: 7px 0 5px; color: #bec8ce; }
    #desktop-design .dp-game-meta .dp-icon { width: 12px; height: 12px; }
    #desktop-design .dp-dots { display: inline-flex; align-items: center; gap: 5px; margin-left: 7px; }
    #desktop-design .dp-dots i { width: 12px; height: 12px; border-radius: 50%; background: #087df8; box-shadow: inset 0 1px 2px #ffffff66; }
    #desktop-design .dp-dots i:nth-child(2) { background:#ff323a; }
    #desktop-design .dp-dots i:nth-child(3) { background:#ffda26; }
    #desktop-design .dp-dots i:nth-child(4) { background:#0bbb66; }
    #desktop-design .dp-matches { flex: 1; display: flex; flex-direction: column; min-height: 260px; }
    #desktop-design .dp-section-head { display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--dp-line); padding: 0 0 8px; }
    #desktop-design .dp-tabs { display: flex; gap: 6px; margin-left: auto; }
    #desktop-design .dp-tabs button { font-size: 10px; white-space: nowrap; padding: 7px 8px; color: #c4cddd; background: none; border: 0; border-bottom: 2px solid transparent; }
    #desktop-design .dp-tabs .selected { color: #ffdc00; border-bottom-color: #ffdc00; }
    #desktop-design .dp-match-count { font-size: 9px; color: #aeb8c5; white-space: nowrap; }
    #desktop-design .dp-filters { display: flex; align-items: center; gap: 10px; padding: 10px 3px; }
    #desktop-design select, #desktop-design input { border: 1px solid #414d59; border-radius: 7px; min-width: 0; min-height: 34px; padding: 6px 10px; color: #eef1f6; background: linear-gradient(#1b242c,#10171e); color-scheme: dark; }
    #desktop-design .dp-filters select { width: 122px; font-size: 10px; }
    #desktop-design .dp-table-scroll { overflow: auto; min-height: 0; scrollbar-width: thin; }
    #desktop-design table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; white-space: nowrap; }
    #desktop-design th { height: 30px; padding: 7px 9px; font-size: 9px; font-weight: 400; color: #d1d9e4; background: #ffffff05; }
    #desktop-design td { padding: 6px 9px; height: 38px; border-top: 1px solid #ffffff08; }
    #desktop-design tbody tr:nth-child(even) { background: #ffffff02; }
    #desktop-design td .dp-yellow { width: 100%; min-width: 64px; padding: 5px 13px; border-radius: 5px; font-size: 10px; }
    #desktop-design .dp-host { display: inline-flex; align-items: center; gap: 8px; }
    #desktop-design .dp-host .dp-avatar { width: 24px; height: 24px; font-size: 8px; border-width: 1px; }
    #desktop-design .dp-waiting { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; }
    #desktop-design .dp-waiting::before { width: 8px; height: 8px; }
    #desktop-design .dp-matches.show-mine .dp-filters, #desktop-design .dp-matches.show-private .dp-filters { display:none; }
    #desktop-design .dp-matches.show-mine th:nth-child(5), #desktop-design .dp-matches.show-mine td:nth-child(5) { display:none; }
    #desktop-design .dp-match-type { display:inline-flex; align-items:center; gap:7px; font-weight:700; }
    #desktop-design .dp-match-type.classic { color:#f5f7fa; }
    #desktop-design .dp-match-type.classic::first-letter { color:#ffda00; }
    #desktop-design .dp-match-type.speed { color:#f5f7fa; }
    #desktop-design .dp-match-type.team { color:#f5f7fa; }
    #desktop-design .dp-match-status { display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius:20px; font-size:10px; font-weight:700; }
    #desktop-design .dp-match-status::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; }
    #desktop-design .dp-match-status.in-progress { background:#07517b66; color:#18aee9; }
    #desktop-design .dp-match-status.waiting { background:#006b465c; color:#15d889; }
    #desktop-design .dp-match-status.finished { background:#53606d55; color:#aeb8c4; }
    #desktop-design .dp-mine-row td:last-child button { min-width:88px; }
    #desktop-design .dp-private-row td:last-child button { min-width:88px; }
    #desktop-design .dp-room-code { color:#ffdc00; letter-spacing:.8px; }
    #desktop-design .dp-room-role { display:inline-flex; padding:4px 9px; border:1px solid #4d5d6c; border-radius:15px; color:#c6d0db; font-size:9px; font-weight:700; }
    #desktop-design .dp-room-role.host { border-color:#8f741b; background:#8f741b22; color:#ffdc00; }
    #desktop-design .dp-leaders { min-height: 115px; }
    #desktop-design .dp-leaders h2 > .dp-icon { color: #ffd400; }
    #desktop-design .dp-leader-row { display: flex; align-items: center; gap: 12px; padding-top: 12px; }
    #desktop-design .dp-leader { display: flex; align-items: center; gap: 7px; flex: 1; }
    #desktop-design .dp-leader strong { font-size: 10px; }
    #desktop-design .dp-leader small { display: block; color: #e5c026; margin-top: 5px; font-size: 10px; }
    #desktop-design .dp-rank { background: linear-gradient(#ddb337,#6b500b); width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
    #desktop-design .rank-1 { background: linear-gradient(#bdc8d5,#56636e); }
    #desktop-design .rank-2 { background: linear-gradient(#b98459,#5c3421); }
    #desktop-design .dp-your-rank { display: flex; flex-direction: column; gap: 3px; padding: 8px 14px; border-radius: 9px; background: #ffffff03; }
    #desktop-design .dp-your-rank small { color: #9ed4cd; font-size: 9px; }
    #desktop-design .dp-your-rank strong { font-size: 22px; color: #ffdc00; }
    #desktop-design .dp-your-rank span { font-size: 9px; color: #b7bec9; }
    #desktop-design .dp-leader-row > button { font-size: 10px; padding: 12px; border-color: #ad8d27; }
    #desktop-design .dp-statistics { min-height: 115px; }
    #desktop-design .dp-stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin-top: 12px; }
    #desktop-design .dp-stat { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px; border: 1px solid #ffffff07; border-radius: 8px; background: linear-gradient(125deg,#ffffff05,#ffffff02); }
    #desktop-design .dp-stat .dp-icon { color: #00d878; width: 25px; height: 25px; }
    #desktop-design .dp-stat:nth-child(2) .dp-icon { color: #ffdc00; }
    #desktop-design .dp-stat:nth-child(4) .dp-icon { color: #fa5a17; }
    #desktop-design .dp-stat small { color: #b8c1ce; font-size: 10px; white-space: nowrap; }
    #desktop-design .dp-stat strong { display: block; margin-top: 7px; font-size: 16px; }
    #desktop-design .dp-private-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
    #desktop-design .dp-private-grid.single{grid-template-columns:1fr}
    #desktop-design .dp-inset { display: flex; flex-direction: column; gap: 10px; padding: 11px; border: 1px solid #ffffff0c; border-radius: 9px; background: #ffffff04; }
    #desktop-design h3 { display: flex; align-items: center; gap: 8px; font-size: 11px; }
    #desktop-design .dp-private-fields { display: flex; gap: 7px; }
    #desktop-design .dp-private-fields select { width: 50%; font-size: 10px; padding: 6px; }
    #desktop-design .dp-inset input { width: 100%; font-size: 10px; }
    #desktop-design .dp-inset > button { width: 100%; font-size: 11px; min-height: 34px; padding: 7px; }
    #desktop-design .dp-history { flex: 1; min-height: 225px; display: flex; flex-direction: column; }
    #desktop-design .dp-history h2 { margin-bottom: 10px; }
    #desktop-design .dp-history h2 button { margin-left: auto; background: none; border: 0; color: white; font-size: 10px; }
    #desktop-design .dp-history td { font-size: 10px; padding: 6px; }
    #desktop-design .dp-history th { font-size: 8px; padding: 6px; }
    #desktop-design .dp-win { color: #00dd80; }
    #desktop-design .dp-loss { color: #ff414b; }
    #desktop-design .dp-view { background: transparent; color: #e5e9ef; border: 1px solid #68727d; border-radius: 6px; padding: 3px 14px; font-size: 9px; }
    #desktop-design .dp-footer { min-height: 58px; display: flex; align-items: center; gap: 18px; padding: 8px 26px; border-top: 1px solid var(--dp-line); }
    #desktop-design .dp-footer .dp-brand img { width: 34px; height: 34px; }
    #desktop-design .dp-footer .dp-brand strong { font-size: 17px; letter-spacing: -.5px; }
    #desktop-design .dp-footer button { background: none; border: 0; color: #b6bfcc; padding: 5px; font-size: 10px; }
    #desktop-design .dp-preview-label { margin-left: auto; color: #9bafc1; font-size: 9px; }
    #desktop-design .dp-footer .dp-live-switch { color: #ffdc00; border: 1px solid #ffdc0044; border-radius: 6px; padding: 8px; }
    #desktop-design .dp-footer > small { color: #919dad; font-size: 9px; }
    #desktop-design .dp-empty { text-align: center; padding: 30px; color: #a9b5c5; }
    #desktop-design .dp-dialog { max-width: 430px; width: 90%; border: 1px solid #48505a; border-radius: 15px; padding: 25px; background: #121b25; color: white; }
    #desktop-design .dp-dialog::backdrop { background: #000a; backdrop-filter: blur(4px); }
    #desktop-design .dp-dialog h2 { font-size: 20px; margin-bottom: 14px; }
    #desktop-design .dp-dialog p { color: #c5cedb; line-height: 1.6; margin-bottom: 20px; }
}

@media (min-width:600px) and (max-width:1100px){
    #desktop-design .dp-hero{min-height:285px}
    #desktop-design .dp-hero-buttons{width:min(680px,80%);flex-wrap:wrap;gap:8px}
    #desktop-design .dp-hero-buttons>button{flex:1 1 210px}
    #desktop-design .dp-hero-join{width:100%;flex:1 0 100%}
}
@media (min-width: 844px) and (max-width: 1270px) {
    #desktop-design .dp-header { width:100%; height:58px; min-height:58px; flex:0 0 58px; gap:8px; padding:4px 10px; }
    #desktop-design .dp-header .dp-brand { flex:0 0 205px; gap:8px; min-width:0; }
    #desktop-design .dp-header .dp-brand img { width:46px; height:48px; }
    #desktop-design .dp-header .dp-brand strong { font-size:20px; letter-spacing:-.7px; }
    #desktop-design .dp-nav { flex:0 1 auto; gap:3px; margin-right:auto; }
    #desktop-design .dp-nav a, #desktop-design .dp-nav button { gap:6px; min-height:42px; padding:8px 9px; font-size:12px; }
    #desktop-design .dp-nav .lucide { width:20px; height:20px; }
    #desktop-design .dp-notification { flex:0 0 34px; width:34px; height:40px; padding:5px; }
    #desktop-design .dp-notification .lucide { width:22px; height:22px; }
    #desktop-design .dp-notification b { right:-1px; top:-2px; min-width:18px; height:18px; font-size:9px; }
    #desktop-design .dp-profile { flex:0 1 178px; min-width:138px; gap:7px; overflow:hidden; }
    #desktop-design .dp-profile > div { display:block; min-width:0; overflow:hidden; }
    #desktop-design .dp-profile strong { max-width:116px; font-size:11px; }
    #desktop-design .dp-profile small { margin-top:2px; font-size:9px; }
    #desktop-design .dp-profile .dp-avatar { width:36px; height:36px; }
    #desktop-design .dp-profile button { flex:0 0 18px; padding:0; font-size:16px; }
    #desktop-design .dp-wallet { flex:0 0 154px; min-width:154px; gap:7px; padding:4px 4px 4px 9px; }
    #desktop-design .dp-wallet small { font-size:8px; }
    #desktop-design .dp-wallet strong { margin-top:2px; font-size:14px; }
    #desktop-design .dp-wallet button { flex:0 0 36px; width:36px; height:36px; font-size:27px; }
    #desktop-design .dp-body { padding-inline: 18px; }
    #desktop-design .dp-section-head { flex-wrap: wrap; gap: 4px; }
    #desktop-design .dp-match-count { display: none; }
    #desktop-design .dp-game-meta { display: none; }
    #desktop-design .dp-stat { gap: 5px; padding: 8px 5px; }
    #desktop-design .dp-stat .dp-icon { width: 18px; }
    #desktop-design .dp-stat small { font-size: 8px; }
    #desktop-design .dp-leader-row { gap: 6px; flex-wrap: wrap; }
    #desktop-design .dp-footer { gap: 10px; }
    #desktop-design .dp-footer > small { display: none; }
}
@media (min-width: 844px) and (min-height: 850px) {
    #desktop-design { height: 100dvh; }
    #desktop-design .dp-matches, #desktop-design .dp-history { min-height: 0; }
    #desktop-design .dp-table-scroll { flex: 1; }
}
@media (min-width: 844px) and (min-height: 650px) and (max-height: 849px) {
    #desktop-design { height: 100dvh; }
    #desktop-design .dp-header { height:58px; min-height:58px; flex-basis:58px; }
    #desktop-design .dp-body { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
    #desktop-design .dp-hero { flex-basis: 190px; }
    #desktop-design h1 { font-size: 32px; margin-bottom: 6px; }
    #desktop-design .dp-hero-copy { padding-block: 8px; }
    #desktop-design .dp-connection-row { margin: 8px 0; }
    #desktop-design .dp-hero-buttons button { min-height: 42px; padding-block: 6px; }
    #desktop-design .dp-left, #desktop-design .dp-right { gap: 8px; }
    #desktop-design .dp-active { min-height: 76px; padding: 8px 12px; gap: 10px; }
    #desktop-design .dp-active h2 { font-size: 14px; }
    #desktop-design .dp-active p { font-size: 10px; }
    #desktop-design .dp-game-symbol { padding: 8px; }
    #desktop-design .dp-panel { padding: 9px; }
    #desktop-design .dp-matches, #desktop-design .dp-history { min-height: 0; }
    #desktop-design .dp-table-scroll { flex: 1; }
    #desktop-design .dp-statistics { min-height: 88px; }
    #desktop-design .dp-stat-grid { margin-top: 7px; }
    #desktop-design .dp-stat { min-height: 49px; padding-block: 6px; }
    #desktop-design .dp-stat strong { margin-top: 4px; }
    #desktop-design .dp-private-grid { margin-top: 7px; }
    #desktop-design .dp-inset { padding: 8px; gap: 7px; }
    #desktop-design .dp-leaders { min-height: 92px; }
    #desktop-design .dp-leader-row { padding-top: 6px; }
    #desktop-design .dp-your-rank { padding-block: 4px; }
    #desktop-design .dp-footer { min-height: 45px; padding-block: 5px; }
}

/* Readable desktop type and guaranteed space for a header plus five rows.
   Short/zoomed windows may scroll the page instead of crushing the tables. */
@media (min-width: 0px) {
    #dashboard.desktop-preview-enabled { scroll-behavior: smooth; }
    #desktop-design { height: auto; min-height: 100dvh; font-size: 14px; }
    #desktop-design .dp-body { flex: 1 0 auto; }
    #desktop-design .dp-columns { flex: 1 0 auto; }
    #desktop-design .dp-matches, #desktop-design .dp-history { flex: 1 0 auto; }
    #desktop-design .dp-table-scroll { flex: 1 0 264px; min-height: 264px; max-height: 352px; scroll-behavior: smooth; overscroll-behavior: contain; scrollbar-gutter: stable; }
    #desktop-design table { font-size: 13px; }
    #desktop-design th, #desktop-design .dp-history th { position: sticky; top: 0; z-index: 2; height: 34px; font-size: 11px; padding: 8px; background: #19212b; }
    #desktop-design td, #desktop-design .dp-history td { height: 44px; font-size: 13px; padding: 8px; }
    #desktop-design .dp-history table { white-space: normal; }
    #desktop-design .dp-history td { white-space: nowrap; }
    #desktop-design td .dp-yellow, #desktop-design .dp-view { font-size: 12px; min-height: 28px; }
    #desktop-design h2 { font-size: 14px; }
    #desktop-design h3 { font-size: 13px; }
    #desktop-design .dp-tabs button, #desktop-design .dp-match-count { font-size: 12px; }
    #desktop-design .dp-section-head { flex-wrap: wrap; }
    #desktop-design .dp-filters select { font-size: 13px; width: 140px; }
    #desktop-design .dp-waiting { font-size: 12px; }
    #desktop-design .dp-stat small { font-size: 12px; white-space: normal; }
    #desktop-design .dp-stat strong { font-size: 19px; }
    #desktop-design .dp-private-fields select, #desktop-design .dp-inset input { font-size: 12px; }
    #desktop-design .dp-inset > button { font-size: 13px; }
    #desktop-design .dp-leader strong, #desktop-design .dp-leader small { font-size: 12px; }
    #desktop-design .dp-leader-row { flex-wrap: wrap; }
    #desktop-design .dp-active p, #desktop-design .dp-hero p { font-size: 13px; }
    #desktop-design .dp-sample { font-size: 10px; }
    #desktop-design .dp-footer { flex-wrap: wrap; }
    #desktop-design .dp-footer button, #desktop-design .dp-preview-label, #desktop-design .dp-footer > small { font-size: 11px; }
    #desktop-design .dp-table-scroll, #dashboard.desktop-preview-enabled {
        scrollbar-width: thin;
        scrollbar-color: #b89b38 #101720;
    }
    #desktop-design .dp-table-scroll::-webkit-scrollbar,
    #dashboard.desktop-preview-enabled::-webkit-scrollbar { width: 9px; height: 9px; }
    #desktop-design .dp-table-scroll::-webkit-scrollbar-track,
    #dashboard.desktop-preview-enabled::-webkit-scrollbar-track { background: #101720; border-radius: 9px; }
    #desktop-design .dp-table-scroll::-webkit-scrollbar-thumb,
    #dashboard.desktop-preview-enabled::-webkit-scrollbar-thumb { background: #b89b38; border: 2px solid #101720; border-radius: 9px; }
    #desktop-design .dp-table-scroll::-webkit-scrollbar-thumb:hover,
    #dashboard.desktop-preview-enabled::-webkit-scrollbar-thumb:hover { background: #ffdc00; }
    #desktop-design .dp-table-scroll::-webkit-scrollbar-corner { background: #101720; }
}
@media (prefers-reduced-motion: reduce) {
    #dashboard.desktop-preview-enabled, #desktop-design .dp-table-scroll { scroll-behavior: auto; }
}

#desktop-design .dp-mobile-nav { display: none; }
#desktop-design .dp-mobile-view-all { display: none; }
#desktop-design .dp-tab-select { display:none; }
@media (max-width: 843px) {
    #desktop-design { height: auto; min-height: 100dvh; }
    #desktop-design .dp-header { width:100%; height:auto; min-height:68px; margin:0; padding:8px 14px; gap:12px; border-width:0 0 1px; border-radius:0; }
    #desktop-design .dp-header .dp-brand { margin-right: auto; gap: 5px; }
    #desktop-design .dp-brand strong { font-size: 20px; letter-spacing: -.5px; }
    #desktop-design .dp-brand img { width: 40px; height: 40px; }
    #desktop-design .dp-nav, #desktop-design .dp-notification { display: none; }
    #desktop-design .dp-profile > div, #desktop-design .dp-profile > button { display: none; }
    #desktop-design .dp-profile { order: 3; }
    #desktop-design .dp-wallet { min-width: 0; gap: 10px; padding: 5px 5px 5px 9px; }
    #desktop-design .dp-wallet small { font-size: 9px; }
    #desktop-design .dp-wallet strong { font-size: 16px; }
    #desktop-design .dp-wallet button { width: 44px; height: 44px; }
    #desktop-design .dp-body { padding: 10px 12px calc(78px + env(safe-area-inset-bottom)); gap: 12px; }
    #dashboard.desktop-preview-enabled { scroll-padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
    #desktop-design .dp-hero { flex: 0 0 auto; min-height: 245px; }
    #desktop-design .dp-hero-copy { padding: 18px; }
    #desktop-design h1 { font-size: 34px; }
    #desktop-design .dp-hero-logo { width: 27%; right: 8px; opacity: .8; }
    #desktop-design .dp-hero-buttons button { min-width: 0; padding: 10px 16px; min-height: 48px; }
    #desktop-design .dp-columns { display: flex; flex-direction: column; gap: 12px; }
    #desktop-design .dp-left, #desktop-design .dp-right { display: contents; }
    #desktop-design .dp-statistics { order: 0; }
    #desktop-design .dp-active { order: 1; }
    #desktop-design .dp-matches { order: 2; }
    #desktop-design .dp-private { order: 3; }
    #desktop-design .dp-history { order: 4; }
    #desktop-design .dp-leaders { order: 5; }
    #desktop-design .dp-table-scroll { flex-basis: 354px; min-height: 354px; max-height: 420px; }
    #desktop-design .dp-section-head { flex-wrap: nowrap; gap: 8px; }
    #desktop-design .dp-section-head h2 { min-width: 0; flex: 1 1 auto; }
    #desktop-design .dp-tabs { display:none; }
    #desktop-design .dp-tab-select { display:block; flex:0 1 168px; width:168px; min-height:34px; padding:5px 28px 5px 9px; border:1px solid #405465; border-radius:7px; background:#111d28; color:#eef5fb; font:inherit; font-size:12px; }
    #desktop-design .dp-match-count { display:none; }
    #desktop-design .dp-tabs button, #desktop-design select, #desktop-design input, #desktop-design .dp-view, #desktop-design td .dp-yellow { min-height: 44px; }
    #desktop-design .dp-table-scroll { overscroll-behavior: auto; }
    #desktop-design .dp-private-fields select, #desktop-design .dp-inset input { font-size: 16px; }
    #desktop-design .dp-inset > button { min-height: 44px; }
    #desktop-design .dp-footer { padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); gap: 12px; }
    #desktop-design .dp-preview-label { margin-left: 0; }
    #desktop-design .dp-mobile-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); position: fixed; z-index: 90; bottom: 0; left: 0; right: 0; padding: 6px max(8px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); background: #09111af5; border-top: 1px solid #ffffff20; backdrop-filter: blur(14px); }
    #desktop-design .dp-mobile-nav a, #desktop-design .dp-mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 48px; border: 0; background: none; color: #d0d9e4; font-size: 12px; }
    #desktop-design .dp-mobile-nav button { color: #d0d9e4; }
    #desktop-design .dp-mobile-nav .selected { color: #ffdc00; }
    #desktop-design .dp-mobile-view-all { display: block; margin-left: auto; border: 0; background: none; color: #eaf0f8; font-size: 12px; }
    #desktop-design section { scroll-margin-top: 12px; }
    #dashboard:not(.desktop-preview-enabled) > .desktop-preview-restore { bottom: calc(76px + env(safe-area-inset-bottom)); }

    #desktop-design.mobile-view-home .dp-private,
    #desktop-design.mobile-view-home .dp-history,
    #desktop-design.mobile-view-home .dp-leaders,
    #desktop-design.mobile-view-home .dp-footer,
    #desktop-design.mobile-view-matches .dp-hero,
    #desktop-design.mobile-view-matches .dp-active,
    #desktop-design.mobile-view-matches .dp-statistics,
    #desktop-design.mobile-view-matches .dp-private,
    #desktop-design.mobile-view-matches .dp-history,
    #desktop-design.mobile-view-matches .dp-leaders,
    #desktop-design.mobile-view-matches .dp-footer,
    #desktop-design.mobile-view-leaders .dp-hero,
    #desktop-design.mobile-view-leaders .dp-active,
    #desktop-design.mobile-view-leaders .dp-statistics,
    #desktop-design.mobile-view-leaders .dp-matches,
    #desktop-design.mobile-view-leaders .dp-private,
    #desktop-design.mobile-view-leaders .dp-history,
    #desktop-design.mobile-view-leaders .dp-footer,
    #desktop-design.mobile-view-more .dp-hero,
    #desktop-design.mobile-view-more .dp-active,
    #desktop-design.mobile-view-more .dp-statistics,
    #desktop-design.mobile-view-more .dp-matches,
    #desktop-design.mobile-view-more .dp-leaders { display: none; }

    #desktop-design.mobile-view-home .dp-matches .dp-filters,
    #desktop-design.mobile-view-home .dp-matches .dp-tabs { display: none; }
    #desktop-design.mobile-view-home .dp-matches .dp-section-head { min-height: 36px; }
    #desktop-design.mobile-view-home .dp-matches .dp-match-count { margin-left: auto; }
    #desktop-design.mobile-view-matches .dp-mobile-view-all { display: none; }
}

@media (max-width: 599px) {
    #desktop-design .dp-header { gap: 7px; padding: 8px; min-height: 64px; }
    #desktop-design .dp-header .dp-brand strong { font-size: 15px; max-width: 82px; white-space: normal; line-height: 1.12; }
    #desktop-design .dp-header .dp-brand img { width: 34px; height: 38px; }
    #desktop-design .dp-profile { display: none; }
    #desktop-design .dp-wallet small { display: none; }
    #desktop-design .dp-wallet strong { margin: 0; font-size: 14px; }
    #desktop-design .dp-wallet { gap: 6px; }
    #desktop-design .dp-body { padding: 8px 8px calc(78px + env(safe-area-inset-bottom)); gap: 10px; }
    #desktop-design .dp-hero { min-height: 0; background-position: 56% center; }
    #desktop-design .dp-hero-copy { padding: 16px 12px; background: linear-gradient(90deg,#060b12c9,#060b1240); }
    #desktop-design .dp-eyebrow { font-size: 10px; letter-spacing: 1px; }
    #desktop-design h1 { font-size: 30px; margin: 10px 0; }
    #desktop-design .dp-hero p { max-width: 290px; line-height: 1.5; }
    #desktop-design .dp-hero-logo { display: none; }
    #desktop-design .dp-connection-row { margin: 12px 0; }
    #desktop-design .dp-online, #desktop-design .dp-server-status { font-size: 12px; }
    #desktop-design .dp-hero-buttons { width: 100%; gap: 7px; }
    #desktop-design .dp-hero-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
    #desktop-design .dp-hero-join{grid-column:1/-1;width:100%;padding:7px}
    #desktop-design .dp-hero-join>div{grid-template-columns:minmax(0,1fr) 78px}
    #desktop-design .dp-hero-join input{height:42px;font-size:16px}
    #desktop-design .dp-hero-join .dp-yellow{min-height:42px}
    #desktop-design .dp-hero-buttons button { flex: 1; padding: 10px 6px; gap: 5px; }
    #desktop-design .dp-hero-buttons .dp-icon { width: 20px; height: 20px; }
    #desktop-design .dp-hero-buttons strong { font-size: 12px; }
    #desktop-design .dp-hero-buttons small { font-size: 10px; }
    #desktop-design .dp-panel { padding: 10px; }
    #desktop-design h2 { font-size: 13px; flex-wrap: wrap; }
    #desktop-design .dp-stat-grid { gap: 5px; }
    #desktop-design .dp-stat { flex-direction: column; gap: 7px; text-align: center; padding: 9px 3px; }
    #desktop-design .dp-stat small { font-size: 11px; }
    #desktop-design .dp-stat strong { font-size: 17px; }
    #desktop-design .dp-stat .dp-icon { width: 22px; height: 22px; }
    #desktop-design .dp-active { gap: 8px; flex-wrap: wrap; }
    #desktop-design .dp-game-symbol { display: none; }
    #desktop-design .dp-active > div:not(.dp-game-meta) { flex: 1 1 150px; }
    #desktop-design .dp-active h2 { font-size: 15px; }
    #desktop-design .dp-active p { font-size: 12px; line-height: 1.4; }
    #desktop-design .dp-active > .dp-yellow { padding: 12px; font-size: 12px; margin: 0; }
    #desktop-design .dp-game-meta { display: none; }
    #desktop-design .dp-section-head { gap: 7px; }
    #desktop-design .dp-tab-select { flex:0 1 145px;width:145px;min-height:36px;padding:5px 26px 5px 8px;font-size:12px; }
    #desktop-design .dp-tabs button { padding-inline: 6px; }
    #desktop-design .dp-match-count { font-size: 10px; }
    #desktop-design .dp-filters { gap: 6px; flex-wrap: wrap; }
    #desktop-design .dp-filters select { flex: 1; width: 100px; font-size: 16px; }
    #desktop-design .dp-table-scroll { flex: 0 0 auto; max-height: none; min-height: 0; overflow: visible; }
    #desktop-design table, #desktop-design tbody { display: block; width: 100%; white-space: normal; }
    #desktop-design thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    #desktop-design tbody tr { display: grid; grid-template-columns: minmax(72px,1.1fr) minmax(76px,.9fr) minmax(82px,1fr) 60px; grid-template-rows: auto auto; align-items: center; gap: 2px 8px; min-height: 62px; margin-bottom: 6px; padding: 8px; border: 1px solid #ffffff12; border-radius: 9px; background: #ffffff03; }
    #desktop-design td, #desktop-design .dp-history td { display: block; height: auto; min-width: 0; padding: 2px 0; border: 0; white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
    #desktop-design td::before { display: none; }
    #desktop-design .dp-match-table td:nth-child(1), #desktop-design .dp-match-table td:nth-child(6) { display: none; }
    #desktop-design .dp-match-table td:nth-child(2) { grid-column: 1; grid-row: 1; font-weight: 700; }
    #desktop-design .dp-match-table td:nth-child(3) { grid-column: 1; grid-row: 2; color: #cbd4df; }
    #desktop-design .dp-match-table td:nth-child(4) { grid-column: 2; grid-row: 1 / span 2; font-weight: 700; }
    #desktop-design .dp-match-table td:nth-child(5) { grid-column: 3; grid-row: 1 / span 2; }
    #desktop-design .dp-match-table td:last-child { grid-column: 4; grid-row: 1 / span 2; }
    #desktop-design .dp-match-table td:last-child button { min-width: 0; padding-inline: 8px; }
    #desktop-design .dp-match-table td.dp-empty { grid-column: 1 / -1; }
    #desktop-design .dp-dots { gap: 3px; margin-left: 4px; }
    #desktop-design .dp-dots i { width: 10px; height: 10px; }
    #desktop-design .dp-private-grid { grid-template-columns: 1fr; }
    #desktop-design .dp-private h2 small { font-size: 11px; line-height: 1.4; }
    #desktop-design .dp-history tbody tr { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto; }
    #desktop-design .dp-history td:nth-child(1) { grid-column: 1; grid-row: 1; }
    #desktop-design .dp-history td:nth-child(2) { grid-column: 2; grid-row: 1; }
    #desktop-design .dp-history td:nth-child(3) { grid-column: 1; grid-row: 2; }
    #desktop-design .dp-history td:nth-child(4) { grid-column: 2; grid-row: 2; }
    #desktop-design .dp-history td:nth-child(5) { grid-column: 1; grid-row: 3; }
    #desktop-design .dp-history td:nth-child(6) { grid-column: 2; grid-row: 3; }
    #desktop-design .dp-view { width: 100%; }
    #desktop-design .dp-leader-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
    #desktop-design .dp-leader { gap: 12px; }
    #desktop-design .dp-your-rank { flex-direction: row; align-items: center; gap: 10px; }
    #desktop-design .dp-footer { gap: 10px 14px; }
    #desktop-design .dp-footer .dp-brand { width: 100%; }
    #desktop-design .dp-preview-label { width: 100%; }
    #desktop-design .dp-dialog { padding: 18px; max-height: calc(100dvh - 32px); overflow: auto; }

    #desktop-design.mobile-view-home .dp-match-table tbody tr:nth-child(n+4) { display: none; }
}

@media (max-width: 340px) {
    #desktop-design .dp-match-table tbody tr { grid-template-columns: minmax(54px,1fr) minmax(62px,.9fr) minmax(58px,1fr) 50px; gap: 2px 4px; padding: 6px; }
    #desktop-design .dp-match-table td { font-size: 12px; }
    #desktop-design .dp-match-table .dp-host { gap: 4px; }
    #desktop-design .dp-match-table .dp-host .dp-avatar { display: none; }
    #desktop-design .dp-match-table td:last-child button { padding-inline: 3px; font-size: 11px; }
}
