/* ===== Translated pages only (css/i18n.css) =====
   Room for words longer than the English: the nav links and the 3.0 page's
   style names may wrap instead of overflowing. (The home hero's buttons
   make their own room, in every language, in the page's styles.) */
.wn-nav .nav-back,
.top-nav .nav-store-link {
  min-width: 0;
  text-align: center;
}

.wn-nav .nav-back { text-align: right; }

/* Home, phones: the stacked title's line ("Fressen. Wachsen. Überleben.")
   is a little smaller than the English, so it stays on one line in every
   language but German (two lines) and Italian under 340 px */
@media (max-width: 520px) {
  .hero-section h1 { font-size: clamp(1.5rem, 7.2vw, 2rem); }
}

/* Style names: a word too long for its card breaks with a hyphen. Plain
   wrapping, not balanced, so names that fit are never hyphenated. A break
   leaves at least four letters on each side, so a later word that fits on
   its own line isn't split to fill the line before (SIN COSTU-RAS, CRISTAL
   TIN-TADO; Safari reads the -webkit- limits) */
.pack-btn { text-wrap: wrap; }

.pack-btn span {
  max-width: 100%;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: auto 4 4;
  -webkit-hyphenate-limit-before: 4;
  -webkit-hyphenate-limit-after: 4;
}

/* Russian: from 641 to 739 px, and at 359 px and under, the cards are
   narrower than some words (БЕСШОВНЫЙ, КАРМАННЫЙ): there a break may leave
   three letters (БЕСШОВ-НЫЙ), so that such a word is hyphenated, not cut.
   Russian only: elsewhere it would bring back SIN COSTU-RAS */
@media (min-width: 641px) and (max-width: 739px), (max-width: 359px) {
  .pack-btn span:lang(ru) {
    hyphenate-limit-chars: auto 3 3;
    -webkit-hyphenate-limit-before: 3;
    -webkit-hyphenate-limit-after: 3;
  }
}

/* Japanese style names break only where the translation marks a word
   boundary (a zero-width space: ゴールデン|アワー), never before a lone kana */
.pack-btn span:lang(ja) { word-break: keep-all; }

/* Japanese: no line may start with ー or a small kana (パワ|ーアップ) */
html:lang(ja) { line-break: strict; }

/* Japanese headings break between phrases (after 。 or a space), never
   inside a word (生き残|る。) */
html:lang(ja) :is(h1, h2, h3) {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Chinese and Japanese: a paragraph or list line never ends with one
   character alone on its last line (…击败的世|界) */
html:lang(zh-Hans) :is(p, li),
html:lang(zh-Hant) :is(p, li),
html:lang(ja) :is(p, li) { text-wrap: pretty; }

/* Korean: lines break between words, not inside one (저장하|세요); a word
   too long for its box still breaks */
html:lang(ko) {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Hall of Fame: longer award titles tighten and may wrap to two lines, and
   values like "13 giorni" get a little more room, instead of being cut by
   the card's edge */
.award-card .award-title {
  white-space: normal;
  letter-spacing: 0.3px;
  line-height: 1.25;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  max-width: 100%;
}

/* A title that wraps makes its card taller than the rest of its row: the
   other cards' content then sits at the bottom, so every row's names,
   snakes and values still line up */
.award-card .award-title { margin-top: auto; }

.award-card .award-value {
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  letter-spacing: -0.2px;
}

/* Phones: five Masters cards share one row, so their values are smaller */
@media (max-width: 768px) {
  .award-card .award-value {
    font-size: 0.5rem;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
    letter-spacing: -0.3px;
  }
}

/* Home, the global stats on phones: the labels lose their letter-spacing,
   so they can be larger; the longest words (POTENCIADORES, GÜÇLENDİRİCİLER)
   carry a soft hyphen in their translation */
@media (max-width: 768px) {
  .stat-card .stat-label {
    letter-spacing: 0;
  }
}

/* Home: the language's short big numbers ("421,2 тыс.", "421,2 mil",
   "8,6 Mio.") are wider than English "421.2K". In World Stats the row's
   numbers shrink together until the widest fits (fitStatValues() in the
   page); in the Masters cards their pill has a little more room */
@media (max-width: 768px) {
  .hall-section-masters .award-card .award-value {
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }

  .hall-section-masters .award-card .award-value:lang(ru) { letter-spacing: -0.5px; }
}

/* Play, the phone toolbar: the four buttons share the row equally, but the
   Customise button is never narrower than its word (Personnaliser,
   Оформление, カスタマイズ); the mode buttons share what is left */
@media (max-width: 768px) {
  .game-mode-buttons .customise-btn {
    min-width: max-content;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }
}

/* Footers: a link wraps to the next line whole (サポート（英語）), not
   mid-word */
footer > a { display: inline-block; }

/* Footers on phones and small tablets, where the three links would wrap:
   each link takes a line of its own and the "|" text between them is not
   shown (font-size 0), so no separator ever ends or starts a line. Wider,
   they share one line, as in English. */
@media (max-width: 768px) {
  footer { font-size: 0; }

  footer > a {
    display: block;
    width: fit-content;
    margin: 0.45rem auto;
    font-size: 0.9rem;
  }
}
