/* Compact English lobby and settings. The arena canvas remains independent. */
body { font-family: "Segoe UI", Arial, sans-serif; }
button, input, select { font-family: inherit; }
#menu { background: radial-gradient(ellipse at 50% 35%, #55375b30, transparent 65%), #090c14e8; backdrop-filter: blur(8px); }
#menu .menu-shell { width: min(1100px, calc(100vw - 40px)); }
#menu .brand { margin-bottom: 28px; display: flex; align-items: center; justify-content: center; gap: 22px; }
#menu .brand h1 { font-size: 64px; letter-spacing: -3.5px; text-shadow: none; }
#menu .brand h1 span { color: #e8a1cb; }
#menu .brand p { margin: 7px 0 0; direction: ltr; background: #ffffff06; border-color: #ffffff17; color: #cbc3d5; font: 600 11px "Segoe UI", sans-serif; padding: 7px 12px; }
.brand-wordmark { gap: 12px; }
.split-mark { transform: scale(.82); }
#menu .menu-columns { grid-template-columns: .9fr 1.25fr 1fr; gap: 18px; align-items: stretch; }
#menu .panel { direction: ltr; text-align: left; padding: 24px; border: 1px solid #ffffff12; border-radius: 18px; background: #151923f5; box-shadow: 0 20px 60px #0004; }
#menu .panel h2 { color: #eae9f2; font-size: 14px; font-weight: 650; letter-spacing: .2px; margin: 0 0 22px; }
#menu .keys-panel { padding: 24px 22px; }
#menu .key-row { min-height: 36px; padding: 9px 0; color: #a7acbe; font-size: 12px; border-color: #ffffff07; }
#menu .key-row:last-of-type { border: 0; }
#menu kbd { min-width: 34px; border-color: #33394b; background: #1c212e; color: #ddddeb; font: 11px "Segoe UI", sans-serif; border-radius: 5px; }
#menu .play-panel { padding: 24px; background: linear-gradient(155deg,#222032,#151923 65%); border-color: #ce8ab631; }
#menu .play-panel::before { left: 30%; right: 30%; background: #e3a0cd; box-shadow: none; }
#menu .player-heading { margin-bottom: 18px; }
#menu .player-heading h2 { margin: 0; font-size: 14px; color: #eae9f2; }
#menu .player-heading>span { display: none; }
#menu .skin-previews { gap: 24px; padding: 4px 0; }
#menu .skin-previews .cell-preview { width: 78px; height: 78px; margin-bottom: 16px; border-width: 3px; box-shadow: 0 0 0 5px #ffffff04,0 8px 20px #0003; }
#menu .skin-previews #cellPreview2 span { font-size: 11px; }
#menu .play-panel label { text-align: left; font-size: 11px; font-weight: 500; color: #b8bacb; }
#menu #nickname { font-size: 15px; text-align: left; border-color: #3c3d50; background: #10141f; padding: 12px 14px; border-radius: 9px; }
#menu #nickname::placeholder { color: #5e6479; }
#menu .skin-editor { text-align: left; margin: 14px 0 18px; background: #10141d; border-color: #2a2d3e; border-radius: 10px; padding: 12px; }
#menu .skin-editor label { font-size: 11px; }
#menu .skin-editor label>span { display: none; }
#menu .skin-editor input:not([type=checkbox]) { font: 11px "Segoe UI", sans-serif !important; background: #161b27 !important; border-color: #33384b !important; padding: 9px 10px !important; }
#menu .skin-editor input::placeholder { color: #6c7288; }
#menu .skin-same { margin: 11px 0; gap: 8px; font-weight: 400; }
#menu .skin-actions { gap: 7px; }
#menu .skin-actions #skinApply { border-color: #67516b; background: #352b40; color: #edcbe3; }
#menu .skin-actions #skinRemove { background: #232837; color: #a5aabe; }
#menu #skinStatus { font-size: 10px; min-height: 0; line-height: 1.5; color: #9ba7ba; margin: 8px 0 0; }
#menu #skinStatus:empty { display: none; }
#menu .primary { padding: 13px; font-size: 17px; font-weight: 750; color: #291b29; background: #e7a3ce; border-color: #efb6db; border-radius: 9px; box-shadow: 0 3px 0 #915b7e; }
#menu .primary::after { content: "→"; left: auto; right: 17px; top: 10px; font-size: 23px; color: #5d3e56; }
#menu .secondary { margin-top: 12px; padding: 10px; background: #202938; border-color: #3a4255; color: #c5d4e7; font-size: 12px; }
#menu .menu-tools { grid-template-columns: 1fr 1fr; gap: 8px; }
#menu .menu-tools .text-button { padding: 10px; background: #1c202c; border-color: #34364a; color: #bab7cb; font-size: 12px; }
#menu .server-panel { display: flex; flex-direction: column; }
#menu .server-list { gap: 9px; }
#menu .server-choice { padding: 17px 16px; min-height: 57px; border-color: #303548; background: #1d2230; text-align: left; border-radius: 10px; }
#menu .server-choice strong { font-size: 15px; font-weight: 650; letter-spacing: .1px; }
#menu .server-choice::after { width: 10px; height: 10px; background: #10141e; border-color: #51586d; }
#menu .server-choice[aria-pressed=true] { color: #f5d8eb; background: #35283d; border-color: #a66a91; box-shadow: inset 3px 0 #e7a3ce; }
#menu .server-choice[aria-pressed=true]::after { background: #e7a3ce; border-width: 2px; border-color: #35283d; box-shadow: 0 0 0 1px #b57da0; }
#menu .server-info { border-color: #ffffff0b; padding: 17px 0; font-size: 11px; color: #7e879c; }
#menu .server-info strong { font-size: 11px; font-weight: 500; color: #aeb7c9; }
#menu .session-best { padding: 17px 0 0; border: 0; color: #838c9f; font-size: 11px; }
#menu .session-best b { font-size: 22px; color: #e7a3ce; }
#menu .discord-link { width: 84px; height: 76px; padding: 17px; margin: auto auto 0; border: 1px solid #827bf0; border-radius: 17px; background: #5865f2; color: #fff; box-shadow: 0 8px 26px #5865f224; }
#menu .discord-link svg { width: 44px; height: 44px; color: #fff; }
#menu .discord-link:hover { background: #6b77ff; border-color: #a8aeff; transform: translateY(-2px); }
#menu .discord-link:focus-visible { outline-color: #b7bdff; }

#settings { width: min(940px,calc(100vw - 36px)); height: min(740px,calc(100dvh - 36px)); background: #141824; border-color: #3b3a50; border-radius: 18px; --s-bg:#141824; --s-card:#1b2030; --s-line:#30364a; --s-muted:#98a2b7; --s-accent:#e7a3ce; }
.settings-modal, .clips-header, .clips-toolbar, .clip-viewer-title, .clip-list, .stats { direction: ltr; }
.settings-header { padding: 24px 28px 22px; align-items: center; background: #171b28; }
.settings-header h2 { font-size: 27px; font-weight: 650; margin: 0; }
.settings-kicker { font-size: 9px; letter-spacing: 2px; margin-bottom: 9px; }
.settings-layout { grid-template-columns: 178px minmax(0,1fr); }
.settings-nav { padding: 18px 12px; gap: 7px; border-left: 0; border-right: 1px solid #2c3042; background: #111520; }
.tab-btn { text-align: left; padding: 13px 11px; gap: 12px; border-radius: 9px; }
.tab-btn strong { font-size: 12px; font-weight: 550; }
.nav-icon { font-size: 21px; width: 23px; }
.tab-btn.active { background: #352a40; border-color: #80557677; color: #edbddd; }
.settings-content { padding: 24px 28px; }
.section-heading { margin-bottom: 20px; }
.section-heading h3 { font-size: 20px; font-weight: 600; margin: 0; }
.binding-feedback { min-height: 0; margin: 9px 0 14px; }
.binding-feedback:empty { display: none; }
.binding-group h4,.setting-group h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #a99cb9; }
.keybind-row { padding: 10px 13px; min-height: 51px; }
.binding-copy strong { font-size: 12px; }
.keybind-btn { font-family: "Segoe UI",sans-serif; min-width: 80px; padding: 7px 9px; }
.setting { padding: 14px 0; font-size: 12px; }
.setting-select { font: 12px "Segoe UI",sans-serif; padding: 11px; }
.mouse-action-card { gap: 13px; }
.mouse-card-top strong { font-size: 12px; }
.mouse-presets { gap: 9px; margin-bottom: 18px; }
.settings-tip { border: 0; background: transparent; padding: 8px 0; }
.settings-footer { padding: 15px 24px; background: #171b28; }
.settings-done { color: #281d29; background: #e7a3ce; min-width: 100px; padding: 11px 22px; box-shadow: none; }
.test-sfx-btn { text-align: left; padding: 16px; }
.theme-preview { padding: 32px 18px 20px; }
.theme-preview strong { font-size: 13px; }
.theme-cells { margin-bottom: 12px; }
.active-piece-badge { text-align: left; }
#clipsDialog { direction: ltr; }
.clip-copy { text-align: left; }
.clips-header p,.clips-toolbar small { display: none; }
.clip-toast { direction: ltr; }

@media(max-width:800px) and (min-width:651px) {
 #menu .menu-shell { width: calc(100vw - 24px); }
 #menu .menu-columns { grid-template-columns: .84fr 1.24fr 1fr; gap: 10px; }
 #menu .panel { padding: 17px; }
 #menu .key-row { font-size: 10px; }
 #menu .skin-previews { gap: 12px; }
 #menu .skin-previews .cell-preview { width: 65px; height: 65px; }
}
@media(max-width:650px) {
 #menu .menu-shell { width: calc(100vw - 24px); }
 #menu .brand { margin-bottom: 16px; gap: 10px; }
 #menu .brand h1 { font-size: 43px; letter-spacing: -2.5px; }
 #menu .brand p { font-size: 10px; padding: 5px 8px; }
 #menu .split-mark { width: 35px; margin-right: 0; transform: scale(.66); transform-origin: left center; }
 #menu .menu-columns { display: grid; grid-template-columns: 1fr; max-width: 380px; gap: 12px; }
 #menu .keys-panel { display: none; }
 #menu .play-panel { order: 0; padding: 18px; }
 #menu .server-panel { order: 1; display: grid; grid-template-columns: 1fr 60px; align-items: center; gap: 12px; padding: 12px; }
 #menu .server-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
 #menu .server-choice { padding: 10px; min-height: 40px; }
 #menu .server-choice strong { font-size: 12px; }
 #menu .server-panel h2,#menu .server-info,#menu .session-best { display: none; }
 #menu .discord-link { margin: 0; width: 60px; height: 65px; padding: 12px; border-radius: 13px; }
 #menu .discord-link svg { width: 32px; height: 32px; }
 #menu .skin-previews .cell-preview { width: 60px; height: 60px; margin-bottom: 12px; }
 #menu .skin-editor { margin: 12px 0 14px; }
 #settings { width: calc(100vw - 20px); height: calc(100dvh - 24px); max-height: none; }
 .settings-header { padding: 19px 20px; }
 .settings-layout { display: flex; flex-direction: column; }
 .settings-nav { display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 10px; gap: 6px; border: 0; border-bottom: 1px solid #2c3042; flex-shrink: 0; }
 .tab-btn { min-width: auto; gap: 7px; padding: 10px; }
 .tab-btn strong { font-size: 11px; white-space: nowrap; }
 .nav-icon { display: none; }
 .settings-content { padding: 20px 16px; }
 .settings-footer { padding: 13px 16px; }
 .range-control input { width: 95px; }
 .setting { gap: 10px; }
}
@media(prefers-reduced-motion:reduce) { .discord-link,.tab-btn,.keybind-btn { transition:none; animation:none; } }

/* Appearance controls keep the English settings compact. */
.background-url-row { padding: 14px; margin-top: 12px; background: #101520; border: 1px solid #30364a; border-radius: 10px; }
.background-url-row>label { display: block; color: #aeb5c8; font-size: 11px; margin-bottom: 9px; }
#backgroundUrl { width: 100%; min-width: 0; background: #191e2d; border: 1px solid #3d4057; border-radius: 7px; color: #e5dfed; padding: 11px; font-size: 12px; direction: ltr; }
.background-actions { display: flex; gap: 8px; margin-top: 10px; }
#backgroundApply { background: #382b43; border-color: #73536e; color: #efc9e5; flex: 1; }
#backgroundStatus { font-size: 11px; line-height: 1.5; margin: 10px 0 0; color: #aeb5c8; overflow-wrap: anywhere; }
#backgroundStatus:empty,#backgroundPreview[hidden],#backgroundTileSetting[hidden] { display: none; }
#backgroundPreview { width: 100%; height: 104px; margin-top: 12px; background: #0b1019; border-radius: 6px; object-fit: contain; }
.background-fit { width: 170px; flex-shrink: 0; }
.map-color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.map-color-setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #30364a; background: #1b2030; border-radius: 8px; font-size: 12px; }
.map-color-setting input { width: 40px; height: 30px; border: 1px solid #535469; border-radius: 6px; background: transparent; cursor: pointer; padding: 2px; }
.reset-display { margin-top: 14px; }
.scoreboard li { color: #999999; }
.scoreboard li.self { color: #ffffff; }
@media(max-width:420px) { .background-fit { width: 140px; }.map-color-setting { padding: 8px; font-size: 11px; } }

/* Compact play HUD and cursor appearance controls. */
#menuButton,#saveClipButton,#multiBadge { display: none !important; }
.stats { flex-wrap: wrap; }
.performance-stats { display: inline-flex; align-items: center; gap: 12px; direction: ltr; white-space: nowrap; font-variant-numeric: tabular-nums; }
.performance-stats #connection { color: #aebac7; }
#cursorPreview { display: block; width: 260px; max-width: 100%; height: 90px; margin: 12px auto; border: 1px solid #38384e; border-radius: 8px; background: #111720; }
.cursor-settings input[type=color] { width: 44px; height: 32px; background: transparent; border: 1px solid #535469; border-radius: 6px; }
.cursor-settings .setting-select { width: 190px; max-width: 55%; }

/* Arena information belongs with the map; each owned piece has its own count. */
.scoreboard { top: 12px; }
.map-heading { position: absolute; bottom: calc(100% + 7px); left: -1px; right: -1px; display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 7px 5px; background: #111419dd; border: 1px solid #52566070; border-radius: 5px; font: 11px Arial,sans-serif; pointer-events: none; }
.mapwrap .map-heading span { position: static; color: #aeb7c6; font: inherit; }
.mapwrap .map-heading #roundTimer { color: #edf0f7; font-variant-numeric: tabular-nums; }
.mapwrap .map-heading #roundTimer.round-soon { color: #ff788b; font-weight: bold; }
.mapwrap .map-heading #roundTimer[hidden] { display: none; }
.cell-counts { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cell-count { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; background: #202630; border: 1px solid #4e5763; border-radius: 5px; white-space: nowrap; }
.cell-count .cell-label { color: #aeb7c6; font: 600 10px Arial,sans-serif; }
.stats .cell-count b { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.cell-count.is-active { border-color: #b267ff; background: #b267ff24; }
.cell-count.is-active .cell-label { color: #d7b8ff; }
.cell-count[hidden],.cell-label[hidden] { display: none; }
@media(max-width:650px) { .stats { gap: 8px; }.cell-count { padding: 3px 5px; }.stats .cell-count b { font-size: 12px; }.map-heading { font-size: 10px; } }

/* Passive HUD panels must never interrupt mouse aiming. */
.scoreboard,.stats,.mapwrap { pointer-events: none; }
.scoreboard ol { list-style: none; padding-left: 0; }
.arena-chat { position: fixed; bottom: 116px; left: 18px; width: min(310px,calc(100vw - 36px)); z-index: 3; font: 13px Arial,sans-serif; color: #e9edf6; pointer-events: none; }
.arena-chat[hidden],#chatBody[hidden] { display: none; }
.arena-chat button,.arena-chat input,#chatBody { pointer-events: auto; }
#chatToggle { color: #ddbef7; background: #211b2bea; border: 1px solid #785596; border-radius: 7px; padding: 8px 12px; font-size: 12px; }
#chatBody { margin-top: 7px; background: #141820f2; border: 1px solid #535069; border-radius: 10px; box-shadow: 0 8px 28px #0005; overflow: hidden; }
#chatBody header { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid #ffffff12; }
#chatRoom { font-size: 12px; color: #dcc4f5; }
#chatClose { color: #c8bfd7; font-size: 20px; background: transparent; padding: 0 3px; }
#chatMessages { min-height: 65px; max-height: min(180px,25vh); overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px; user-select: text; }
.chat-message { line-height: 1.5; margin-bottom: 5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-message strong { color: #ddbef7; }
#chatForm { display: flex; gap: 6px; padding: 8px; }
#chatInput { min-width: 0; flex: 1; color: #fff; background: #232a36; border: 1px solid #4a5060; border-radius: 5px; padding: 9px; font: inherit; }
#chatSend { background: #8e4ba9; color: #fff; border-radius: 5px; padding: 8px 10px; font: inherit; }
#chatStatus { min-height: 0; margin: 0; padding: 0 10px 8px; color: #e6b3d0; font-size: 11px; }
#chatStatus:empty { padding: 0; }
@media(max-width:650px) { .arena-chat { left: 10px; width: min(270px,calc(100vw - 125px)); } .stats { flex-wrap: wrap; } }

/* Messages stay visible; only the composer enters and leaves typing mode. */
#chatBody { margin-top: 0; }
#chatToggle { padding: 3px 6px; border: 0; background: transparent; font-size: 11px; color: #a9a0ba; }
#chatInput[readonly] { cursor: text; }
.arena-chat:not(.is-typing) #chatBody { background: #141820c9; }
.arena-chat.is-typing #chatBody { border-color: #9d6cba; }
.arena-chat:not(.is-typing) #chatBody,.arena-chat:not(.is-typing) #chatMessages { pointer-events: none; }

/* Match the chat panel in Firefox and Chromium. */
#chatMessages { scrollbar-width: thin; scrollbar-color: #785596 #191520; }
#chatMessages::-webkit-scrollbar { width: 6px; }
#chatMessages::-webkit-scrollbar-track { background: #191520; border-radius: 8px; }
#chatMessages::-webkit-scrollbar-thumb { background: #785596; border: 1px solid #191520; border-radius: 8px; }
#chatMessages::-webkit-scrollbar-thumb:hover { background: #a879c7; }
#chatMessages::-webkit-scrollbar-corner { background: transparent; }

#serverDual,#serverFfa,#serverMega,#serverMacro{display:flex;align-items:center;justify-content:space-between;gap:12px;direction:ltr}
.room-count{font-size:12px;font-variant-numeric:tabular-nums;color:#d9c7e4;white-space:nowrap}
.server-meta{display:none!important}
#serverMode,#playerCount{display:none!important}
.arena-population{position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:5;padding:7px 14px;border:1px solid #78559666;border-radius:8px;background:#191520d9;color:#ded1e9;font-size:12px;white-space:nowrap;pointer-events:none;font-variant-numeric:tabular-nums}
