img.flag { width:1.35em; height:auto; aspect-ratio:4/3; vertical-align:-0.15em; margin-right:.45em; border-radius:2px; box-shadow:0 0 0 1px #ffffff40; object-fit:cover; flex:none; }
img.flag.big { width:30px; }
.hiscore .name img.flag { width:1.2em; }

#flag-dialog[open] { display:flex; flex-direction:column; gap:10px; }
#flag-dialog h2, #flag-dialog p { margin:0; }
#flag-search { width:100%; font:inherit; background:#0b1420; color:#dceafa; border:1px solid #3c546d; border-radius:4px; padding:10px; }

.flag-suggest { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.flag-list { list-style:none; margin:0; padding:0; overflow:auto; max-height:min(46vh,360px); border:1px solid #2a3d50; border-radius:6px; }
.flag-list button { display:flex; align-items:center; width:100%; margin:0; border:0; border-radius:0; background:none; color:#dceafa; text-align:left; font-weight:400; padding:9px 12px; min-height:40px; }
.flag-list button:hover, .flag-list button.on { background:#213548; }
.flag-list button.on { color:#71e8ca; font-weight:700; }
.flag-list li[hidden] { display:none; }

body.touch .flag-list button { min-height:48px; font-size:16px; }
body.touch #flag-search { font-size:16px; }

#current-flag-name { color:#ffd84a; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

@media (max-width:650px) {
  #flag-dialog { padding:16px; }
  .flag-list { max-height:40vh; }
}
#flag-dialog h2:focus { outline:none; }
