/* Language entry: same 52px slot and red line-art weight as the other quick actions. */
.m-act-ic--lang{color:var(--brand)}
.m-act-ic--lang .lang-ico{width:29px;height:29px;display:block;fill:currentColor}

/* The mobile search submit label is CSS-generated, so it needs its own overrides. */
@media (max-width:767.98px){
  html[lang="zh-TW"] body:not(.is-game) .header-big .super-search-fm button::after{content:'搜尋'}
  html[lang="en"] body:not(.is-game) .header-big .super-search-fm button::after{content:'Search'}
  html[lang="ko"] body:not(.is-game) .header-big .super-search-fm button::after{content:'검색'}
  html[lang="ja"] body:not(.is-game) .header-big .super-search-fm button::after{content:'検索'}
}

/* Language sheet */
.lang-sheet{max-width:430px}
/* PC 侧栏的「翻译」入口：手机上是从底部升起，电脑上改成居中卡片。 */
@media (min-width:768px){
  #lang-mask.m-mask{position:fixed;inset:0;background:rgba(20,22,28,.42);backdrop-filter:blur(3px);z-index:80;opacity:0;pointer-events:none;transition:opacity .18s}
  #lang-mask.m-mask.on{opacity:1;pointer-events:auto}
  #lang-sheet.m-sheet{position:fixed;left:50%;top:50%;transform:translate(-50%,-46%);width:min(430px,calc(100vw - 48px));max-height:76vh;overflow:auto;padding:20px 20px 18px;border-radius:16px;background:#fff;z-index:81;box-shadow:0 18px 48px rgba(16,18,24,.22);opacity:0;pointer-events:none;transition:opacity .18s ease,transform .18s ease}
  #lang-sheet.m-sheet.on{opacity:1;pointer-events:auto;transform:translate(-50%,-50%)}
  #lang-sheet .m-sheet__hd{display:flex;align-items:center;gap:8px;margin-bottom:10px}
  #lang-sheet .m-sheet__hd b{font-size:1rem;font-weight:700;color:var(--ink)}
  #lang-sheet .m-sheet__x{margin-left:auto;width:28px;height:28px;border:0;border-radius:50%;background:#f2f4f7;color:#6b7177;font-size:13px;cursor:pointer}
  #lang-sheet .m-sheet__s{font-size:12.5px;line-height:1.6;color:var(--ink-3,#8d939b);margin-bottom:14px}
}
.lang-list{margin:2px 0 14px;border:1px solid #eceef2;border-radius:12px;overflow:hidden;background:#fff}
.lang-row{display:flex;align-items:center;width:100%;min-height:50px;padding:0 14px;border:0;border-bottom:1px solid #f0f2f5;background:#fff;font:inherit;font-size:15px;color:var(--ink);text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}
.lang-row:last-child{border-bottom:0}
.lang-row__n{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lang-row__ck{flex:0 0 22px;text-align:center;font-size:15px;font-weight:700;color:var(--brand);visibility:hidden}
.lang-row.is-on .lang-row__ck{visibility:visible}
.lang-row.is-on .lang-row__n{font-weight:600}
.lang-row:focus{outline:none}
.lang-row:focus-visible{outline:2px solid rgba(224,27,40,.55);outline-offset:-2px}
.lang-note{display:flex;align-items:flex-start;gap:7px;margin:0;font-size:11.5px;line-height:1.55;color:var(--ink-3,#8d939b)}
.lang-note svg{width:15px;height:15px;flex:0 0 auto;margin-top:1px}

/* Longer translations must remain readable without widening mobile cards. */
html:is([lang="en"],[lang="ko"],[lang="ja"]) .member-identity h2{white-space:normal}
html:is([lang="en"],[lang="ko"],[lang="ja"]) .member-shortcut-copy{min-width:0}
html:is([lang="en"],[lang="ko"],[lang="ja"]) .member-shortcut-copy :is(b,small){white-space:normal;overflow-wrap:anywhere}
html:is([lang="en"],[lang="ko"],[lang="ja"]) .member-section-head{flex-wrap:wrap;row-gap:8px}
html:is([lang="en"],[lang="ko"],[lang="ja"]) .member-page :is(.member-primary,.member-button){white-space:normal}
@media(max-width:768px){
 html:is([lang="en"],[lang="ko"],[lang="ja"]) .member-shortcuts a{min-width:0}
 html:is([lang="en"],[lang="ko"],[lang="ja"]) .member-status{white-space:normal;max-width:40%;text-align:center}
}

/* Octopath: keep classifications legible while preserving the card artwork. */
body.ot-compact-badges :is(.ptile,.psel,.ctile,.mtile) .ot-badge{
  font-size:10px;line-height:1.08;letter-spacing:0;font-weight:500;
  padding:2px 1px;min-width:0;max-width:14px;max-height:36px;
  writing-mode:vertical-rl;text-orientation:upright;box-sizing:border-box;
  top:0;right:0;left:auto;bottom:auto;border-radius:0 3px 0 3px;
  color:#fff;cursor:help;
}
html[lang="en"] body.ot-compact-badges :is(.ptile,.psel,.ctile,.mtile) .ot-badge,
body.ot-compact-badges :is(.ptile,.psel,.ctile,.mtile) .ot-badge.ot-badge--ex{
  writing-mode:horizontal-tb;text-orientation:mixed;
  max-width:42px;max-height:16px;padding:2px 3px;font-size:9px;line-height:1.1;
}
body.ot-compact-badges .psel .ot-badge{font-size:8px;max-width:11px;padding:1px;max-height:28px}
body.ot-compact-badges .ot-badge:focus-visible{outline:2px solid #31384b;outline-offset:2px}
.ot-badge-tip{
  position:fixed;z-index:2147483000;max-width:min(260px,calc(100vw - 16px));
  padding:7px 10px;border-radius:6px;background:#29303d;color:#fff;
  font-size:12px;line-height:1.45;white-space:normal;overflow-wrap:anywhere;
  box-shadow:0 3px 10px #0002;pointer-events:none;
}
@media(max-width:767.98px){
  body.ot-compact-badges :is(.ptile,.psel,.ctile,.mtile) .ot-badge{
    font-size:9px;max-width:12px;max-height:31px;padding:1px;
  }
  html[lang="en"] body.ot-compact-badges :is(.ptile,.psel,.ctile,.mtile) .ot-badge,
  body.ot-compact-badges :is(.ptile,.psel,.ctile,.mtile) .ot-badge.ot-badge--ex{
    font-size:8px;max-width:36px;max-height:13px;padding:1px 2px;
  }
}
