/* Locale/platform font mapping. Keep all inherited size, weight, line-height and spacing declarations intact. */
@font-face {
  font-family: RoyaleJapanese;
  src: url("assets/royale/JP_regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 400;
  font-display: swap;
}
@font-face {
  font-family: RoyaleJapanese;
  src: url("assets/royale/JP_medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 401 500;
  font-display: swap;
}
@font-face {
  font-family: RoyaleJapanese;
  src: url("assets/royale/JP_semibold.woff2") format("woff2");
  font-style: normal;
  font-weight: 501 600;
  font-display: swap;
}
@font-face {
  font-family: RoyaleJapanese;
  src: url("assets/royale/JP_bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 601 1000;
  font-display: swap;
}
@font-face {
  font-family: RoyaleTraditionalChinese;
  src: url("assets/royale/TCRegular.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 400;
  font-display: swap;
}
@font-face {
  font-family: RoyaleTraditionalChinese;
  src: url("assets/royale/TCMedium.woff2") format("woff2");
  font-style: normal;
  font-weight: 401 500;
  font-display: swap;
}
@font-face {
  font-family: RoyaleTraditionalChinese;
  src: url("assets/royale/TCSemibold.woff2") format("woff2");
  font-style: normal;
  font-weight: 501 1000;
  font-display: swap;
}
:root {
  --sf-font-stack: RoyaleDisplay, system-ui, sans-serif;
  font-synthesis: none;
}
html[lang="ja"][data-font-platform="apple"] {
  --sf-font-stack: RoyaleDisplay, "Hiragino Sans", "Hiragino Kaku Gothic ProN", -apple-system, BlinkMacSystemFont, sans-serif;
}
html[lang="zh-Hant"][data-font-platform="apple"] {
  --sf-font-stack: RoyaleDisplay, "PingFang TC", "Heiti TC", -apple-system, BlinkMacSystemFont, sans-serif;
}
html[lang="ja"][data-font-platform="other"] {
  --sf-font-stack: RoyaleDisplay, RoyaleJapanese, system-ui, sans-serif;
}
html[lang="zh-Hant"][data-font-platform="other"] {
  --sf-font-stack: RoyaleDisplay, RoyaleTraditionalChinese, system-ui, sans-serif;
}
html[lang="en"] {
  --sf-font-stack: RoyaleDisplay, system-ui, sans-serif;
}
body,
button,
input,
select,
textarea {
  font-family: var(--sf-font-stack);
}
.search-debug {
  font-family: var(--sf-font-stack);
}
.footer-time {
  font-family: var(--sf-font-stack);
}
.upgrade-field input {
  font-family: var(--sf-font-stack);
}
.upgrade-result-progress strong,
.upgrade-result-gold strong {
  font-family: var(--sf-font-stack);
}
@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats .stat { min-width: 0; padding-inline: 4px; }
  .rarity-group {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Character-scoped metrics: keep Latin/numeric sizing, font files and stacks intact. */
sf-cjk {
  display: inline;
  font-size: calc(1em + 2px);
  font-weight: var(--sf-cjk-weight);
  line-height: inherit;
}
input[data-sf-cjk-placeholder]::placeholder,
textarea[data-sf-cjk-placeholder]::placeholder {
  font-size: calc(1em + 2px);
  font-weight: var(--sf-cjk-placeholder-weight);
}
