:root:lang(ja) {
  font-family: system-ui, "Hiragino Sans", "Yu Gothic", "Noto Sans CJK JP", sans-serif;
  line-break: strict;
}
:root:lang(ar) {
  font-family: "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  line-height: 1.55;
}
:root:is(:lang(ja), :lang(ar)) h1 {
  font-family: inherit;
  font-size: clamp(28px, 7vw, 45px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: normal;
}
.bar { flex-wrap: wrap; }
.modes { min-inline-size: 0; }
.bar button {
  min-block-size: 44px;
  padding-block: 3px;
  overflow-wrap: anywhere;
}
.hud {
  align-items: flex-start;
  line-height: 1.4;
}
.hud #tally {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  column-gap: 5px;
}
.hud #score-ratio {
  display: inline-flex;
  gap: .27em;
  align-items: baseline;
  white-space: nowrap;
}
.hud #score-ratio span { padding: 0; background: none; }
#primary, #tie-ribbon {
  padding-inline: 8px;
  overflow-wrap: anywhere;
}
#tie-ribbon[hidden] { display: none; }
@media (max-width: 350px) {
  .bar button { padding-inline: 7px; }
}
@media (max-height: 740px) {
  #game { padding-block: 8px 10px; }
  header { margin-block-end: 8px; }
  .field { max-width: min(100%, max(170px, calc((100dvh - 272px) * 9 / 11))); }
}
@media (min-height: 500px) and (max-height: 740px) {
  #game {
    display: grid;
    grid-template-rows: auto auto minmax(180px, 1fr) minmax(98px, auto) auto;
    block-size: 100dvh;
  }
  .field {
    aspect-ratio: 9 / 11;
    inline-size: auto;
    block-size: 100%;
    max-width: 100%;
  }
  #scene { block-size: 100%; object-fit: contain; }
  .feedback { align-self: start; }
}
