/* Play tools in the header (index.html #play-tools): records, daily challenge, word language and
   play with friends, then the daily board and stats buttons. Every tool is the header's square
   icon button; wide screens add a short label beside the icon. The records HUD host is
   see-through so its two chips (records, challenge) are tools too; `order` sets the reading order
   (the same as the DOM order). In a friends' room the same tools stay where they are and the
   room's chat and Leave follow them; the word language is then the room's. Only the Play tab
   shows them (a room's chat button stays on the Tournament tab too). */
.play-tools{display:flex;align-items:center;gap:inherit;min-width:0}
.play-tools [data-records-hud]{display:contents}
.play-tools #records{order:1}
.play-tools .challenge-launch{order:2}
.play-tools>#word-language{order:3;display:flex;align-items:center;gap:6px}
.play-tools>[data-friend-invite]{order:4;display:flex}
.play-tools>[data-room-chat],.play-tools>[data-room-leave]{display:contents}
.play-tools #room-chat-toggle{order:5}
.play-tools .word-language-leave{order:6}
html[data-game-page=tournament] .play-tools>:not([data-room-chat]),html[data-game-page=tournament] .play-tools+.header-divider{display:none}
.play-tools #records,.play-tools .challenge-launch,.play-tools #word-language .language-picker,.play-tools .invite-friend,.play-tools #room-chat-toggle,.play-tools .word-language-leave{position:relative;flex:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;
  width:auto;min-width:35px;height:35px;min-height:0;margin:0;padding:0 8px;border:1px solid #e9e1f4;border-radius:12px;background:#ffffffa8;box-shadow:none;transform:none;
  color:#5a4672;font:800 12px/1 Manrope,'Segoe UI',sans-serif;letter-spacing:0;text-decoration:none;white-space:nowrap;cursor:pointer;transition:background .2s,transform .2s}
.play-tools #records:hover,.play-tools .challenge-launch:hover,.play-tools #word-language .language-picker:hover:not(:disabled),.play-tools .invite-friend:hover,.play-tools .word-language-leave:hover{background:#eee6ff;transform:translateY(-1px);box-shadow:none}
.play-tools #records:focus-visible,.play-tools .challenge-launch:focus-visible,.play-tools #word-language .language-picker:focus-visible,.play-tools .invite-friend:focus-visible,.play-tools #room-chat-toggle:focus-visible,.play-tools .word-language-leave:focus-visible{outline:3px solid #bca3ff;outline-offset:2px}
/* Records: the trophy, then "rank · points" (or "Рекорд" before there is a score). */
.play-tools #records::after,.play-tools #records .record-arrow,.play-tools #records small{display:none}
.play-tools #records .record-medal{width:22px;height:22px;flex:none}
.play-tools #records .record-medal svg{width:20px;height:20px}
.play-tools #records .record-metric{display:block}
.play-tools #records .record-metric strong{font-size:12px;color:#5a4672}
.play-tools #records .record-points{padding-left:6px;border-left:1px solid #e3d9f2}
.record-dock-label{display:none}
.play-tools #records:not([data-has-score=true]) .record-metric{display:none}
.play-tools #records:not([data-has-score=true]) .record-dock-label{display:block;font-size:12px;color:#5a4672}
/* Challenge: the target and today's progress. */
.play-tools .challenge-launch-icon{font-size:17px;line-height:1}
.play-tools .challenge-launch-label{display:none}
.play-tools .challenge-launch-count{font-size:12px;color:#5a4672}
/* Word language: the active language's flag and its name (phones: the flag alone). */
.play-tools #word-language .language-mark{width:22px;height:22px}
.play-tools #word-language .language-picker-copy small,.play-tools #word-language .language-picker-chevron{display:none}
.play-tools #word-language .language-picker-copy strong{font-size:12px;color:#5a4672}
/* Play with friends. */
.play-tools .invite-friend svg{width:18px;height:18px;flex:none}
/* A room's chat: the purple one, with its unread count on the corner. Leave: the exit arrow. */
.play-tools #room-chat-toggle{background:#7850ed;border-color:#6a43dc;color:#fff}
.play-tools #room-chat-toggle:hover{background:#6a43dc}
.play-tools #room-chat-toggle svg,.play-tools .word-language-leave svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.play-tools .word-language-leave{color:#5d3abd}
.play-tools #room-chat-toggle:focus-visible{background:#6a43dc;color:#fff;box-shadow:none}
/* Every header button answers a tap 5 px above and below its square (about 40 px tall; the header is taller). */
@media(min-height:501px){
  .header .icon-button{position:relative}
  .play-tools .challenge-launch::before,.play-tools #word-language .language-picker::after,.play-tools .invite-friend::after,
  .play-tools #room-chat-toggle::after,.play-tools .word-language-leave::after,.header .icon-button::after{content:'';position:absolute;inset:-6px 0}
  .play-tools #records::after{display:block;content:'';position:absolute;inset:-6px 0;z-index:0;background:none;animation:none;border-radius:0;pointer-events:auto}
}
/* Phones: icons only; the counts that matter ride on the icon as small badges, names stay in
   each button's label (and the language list says the names in full). Rotated phones wider than
   760 px get the same icon-only tools: their labels would spill out of the short header's squares. */
@media(max-width:760px),(orientation:landscape) and (max-height:500px){
  .play-tools #records,.play-tools .challenge-launch,.play-tools #word-language .language-picker,.play-tools .invite-friend,.play-tools #room-chat-toggle,.play-tools .word-language-leave{width:31px;min-width:31px;height:31px;padding:0;border-radius:10px}
  .play-tools #records .record-metric,.play-tools #records .record-dock-label,.play-tools #word-language .language-picker-copy,.play-tools .invite-friend>span,
  .play-tools #room-chat-toggle .room-chat-label,.play-tools .word-language-leave>span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .play-tools #records:not([data-has-score=true]) .record-dock-label{display:block}
  .play-tools #records .record-medal{width:20px;height:20px}.play-tools #records .record-medal svg{width:18px;height:18px}
  .play-tools .challenge-launch-icon{font-size:15px}
  .play-tools .challenge-launch-count{position:absolute;right:-5px;bottom:-6px;padding:1px 4px;border-radius:7px;background:#ece4ff;color:#4f2fae;font-size:9px;line-height:12px}
  .play-tools #word-language .language-mark{width:24px;height:24px}
  .play-tools .invite-friend svg,.play-tools #room-chat-toggle svg,.play-tools .word-language-leave svg{width:17px;height:17px}
}
/* The narrowest phones keep the brand's mark and drop its word so every tool still fits. */
@media(max-width:380px){
  .header .brand>span:not(.brand-mark){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .play-tools+.header-divider{display:none}
}
/* Rotated phones: same small square tools in the short header. */
@media(orientation:landscape) and (max-height:500px){
  .play-tools #records,.play-tools .challenge-launch,.play-tools #word-language .language-picker,.play-tools .invite-friend,.play-tools #room-chat-toggle,.play-tools .word-language-leave{width:29px;min-width:29px;height:29px}
}
/* In a room the header gains chat and Leave, so phones keep only the brand's mark. */
@media(max-width:760px){
  .race-active .header .brand>span:not(.brand-mark){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}
/* Narrow desktop windows in a room: Invite, chat and Leave become icon squares (their names stay
   in their labels) so the six labelled tools never push the header sideways. */
@media(min-width:761px) and (max-width:1000px){
  .race-active .play-tools .invite-friend,.race-active .play-tools #room-chat-toggle,.race-active .play-tools .word-language-leave{width:35px;min-width:35px;padding:0}
  .race-active .play-tools .invite-friend>span,.race-active .play-tools #room-chat-toggle .room-chat-label,.race-active .play-tools .word-language-leave>span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}
