/* Shogi Gym English version: style fixes for English text only (built by build_en.py from tools/en.css) */
/* buttons under the board: same height as the Japanese page (44px), always one line */
html[lang="en"] #controls button{min-height:44px;white-space:nowrap}
/* theme name + "Move N": keep room for the progress bar. A long theme name is cut with "…"; the move number is never cut */
html[lang="en"] #meta{display:flex;align-items:baseline;gap:6px}
html[lang="en"] #meta .thm{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[lang="en"] #meta .mvno{flex:none}
@media (max-width:480px){html[lang="en"] #meta{flex:0 0 auto;width:min(190px,52%);min-width:0;font-size:12px}}
@media (max-width:359px){html[lang="en"] #meta{font-size:11px}html[lang="en"]:has(link[rel="canonical"][href="https://shogi-gym.com/en/"]) #tesu button{font-size:12px}html[lang="en"] #controls button{font-size:12px;padding-left:2px;padding-right:2px}}
/* ===== hansoku family: the illegal-move pages (/en/hansoku/ and the five pages under it) =====
   Fixes for longer English only. The rules for the boards are limited to these six pages by their canonical URL,
   because other page families use the same class names (.hanim, .ha-badge, .hmini ...) with their own texts. */
/* badge on the 9x9 board: the English words are longer than the Japanese (2-11 letters), so the letters are smaller; one line as in Japanese.
   --enk is set by the script only when a badge is still wider than the board (enBadgeFit in the *-anim.js of these pages) */
html[lang="en"]:has(link[rel="canonical"][href*="/en/hansoku/"]) .ha-badge{padding:calc(var(--pdc) * .18) calc(var(--pdc) * .3);white-space:nowrap}
html[lang="en"]:has(link[rel="canonical"][href*="/en/hansoku/"]) .ha-badge b{font-size:calc(var(--pdc) * .46 * var(--enk, 1));letter-spacing:0}
html[lang="en"]:has(link[rel="canonical"][href*="/en/hansoku/"]) .ha-badge span{font-size:calc(max(12px, var(--pdc) * .34) * var(--enk, 1));letter-spacing:0}
/* "○ Correct!" / "Wrong…" / "Illegal" over a quiz or a board: one line, and inside the screen also at the largest size of the pop (x1.15) on a 320px phone */
html[lang="en"]:has(link[rel="canonical"][href*="/en/hansoku/"]) .rq .splash{font-size:min(40px, 9.6vw);white-space:nowrap}
html[lang="en"]:has(link[rel="canonical"][href*="/en/hansoku/"]) .hanim .splash{font-size:min(40px, calc(var(--pdc) * 1.05));white-space:nowrap}
/* the same on the 5x5 cards (a card is about 137px wide on a 320px phone) */
html[lang="en"]:has(link[rel="canonical"][href*="/en/hansoku/"]) .hmv .splash{font-size:calc(var(--hmc) * .92);letter-spacing:1px;left:0;right:0;white-space:nowrap}
/* "4th time" on the 5x5 card of perpetual check: narrower, so that it does not reach the pieces on file 2 (4回目 has 3 letters) */
html[lang="en"]:has(link[rel="canonical"][href*="/en/hansoku/"]) .hmcnt{padding:2px 5px;letter-spacing:0;font-size:max(11px, calc(var(--hmc) * .4))}
/* the small game clock: "Opponent" has 8 letters (相手 has 2); the window of one side is about 35px wide on a 320px phone and 44.5px at 1280px.
   At most 8.3px: "Opponent" still fits with 2px to spare in a wide font (DejaVu Sans, close to Meiryo on Windows: 43px at 9px; the window is 43px inside) */
html[lang="en"]:has(link[rel="canonical"][href*="/en/hansoku/"]) .hmclk.sm .hmcl{font-size:clamp(6.5px, calc(var(--hmc) * .27), 8.3px);letter-spacing:-.01em}
/* the cards "See the illegal moves in detail" (_inc/hansoku-list.php; also shown on other pages, so not limited to these six): the same "4th time" */
html[lang="en"] .sghl-n{padding:2px 5px;letter-spacing:0;font-size:max(11px, calc(var(--sghlc) * .4))}
/* the table of 13 cards on /en/hansoku/: the English names of the second group need up to 3 lines (Japanese: up to 2),
   so the name area of that group is 3 lines high: the boards of one row stay at the same height, as on the Japanese page */
html[lang="en"]:has(link[rel="canonical"][href*="/en/hansoku/"]) #hyo .hcards ~ .hcards .hcard > .hname{min-height:4.2em}
@media (max-width:359px){html[lang="en"]:has(link[rel="canonical"][href*="/en/hansoku/"]) #hyo .hcard > .hname{font-size:13px}}
/* ===== introA family: /en/koma.html, /en/shogi-rule.html, /en/glossary.html and the practice boards of shogi-exp.js =====
   Layout fixes for English text only. Page-specific rules are limited to the page by its canonical URL. */
/* Buttons whose height comes from one line of text (line-height: normal): a Latin font gives a lower line than a Japanese font
   (40px instead of 44px, 33px instead of 37px). Keep the height of the Japanese page. */
html[lang="en"] .mini .pctl button,html[lang="en"] .expbox .pctl button,html[lang="en"] #dEnd .pctl button{min-height:44px}
html[lang="en"]:has(link[rel="canonical"][href$="/en/koma.html"]) .gctl button,
html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) .gctl button{min-height:37px}
html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) .quiz button{min-height:40px}
/* koma.html, Piece Collector: the task line under the board has a fixed height so that nothing below moves when the question changes.
   The longest English tasks need three lines on a phone, so the fixed height is three lines there (Japanese: two lines). */
@media (max-width:479px){html[lang="en"]:has(link[rel="canonical"][href$="/en/koma.html"]) .dtask{min-height:79px}}
/* tables: the Japanese page forbids line breaks in headers and in short name cells (2-4 characters). English names are longer
   and break only between words, so breaks are allowed; otherwise the table is wider than a phone screen and the whole page shrinks. */
html[lang="en"]:has(link[rel="canonical"][href$="/en/koma.html"]) th,
html[lang="en"]:has(link[rel="canonical"][href$="/en/koma.html"]) .tnari td:nth-child(-n+3),
html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) th,
html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) .hansoku-tb td:first-child{white-space:normal}
/* splash texts ("○ Correct!", "Wrong…", "Promoted!", "You win!!" …) are wider than the Japanese ones (3-4 characters):
   one line, inside the board. The 5x5 boards are narrow, so the text is sized from the board width there. */
html[lang="en"] .qstage .splash{font-size:calc(((min(100vw,430px) - 22px)/9*5 + 6px)*.155);letter-spacing:1px;white-space:nowrap}
html[lang="en"] .expstage .splash{letter-spacing:2px;white-space:nowrap}
html[lang="en"]:has(link[rel="canonical"][href$="/en/koma.html"]) .quiz .splash,
html[lang="en"]:has(link[rel="canonical"][href$="/en/koma.html"]) #drillWrap .splash{letter-spacing:2px;white-space:nowrap}
html[lang="en"]:has(link[rel="canonical"][href$="/en/koma.html"]) .gsplash,
html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) .gsplash{letter-spacing:2px;white-space:nowrap}
html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) #nariSplash{letter-spacing:1px}
/* shogi-rule.html, practice board: the line above the board ("Promoted knight selected. …") stays on one line on small phones too,
   so the board does not move when another piece is chosen */
@media (max-width:359px){html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) #thint{font-size:11px;line-height:25px}}
/* koma.html, end screen of Piece Collector: the "Close and read the article" button keeps the height of the Japanese page (37px) */
html[lang="en"] #dEnd #dClose{min-height:37px}
/* ===== koma family (/en/koma/<piece>/): layout fixes for English text only =====
   Every rule is limited to the eight piece pages: either by .ktsj (the tesuji block that only these pages have) or by the page's canonical link
   (html:has(link[rel="canonical"][href*="/en/koma/"])), because .ha-badge / .kgo are also used on other pages (tsume hub, rules, koma.html …). */
/* buttons to the eight piece pages: an English name can take two lines (Gold general / Silver general); keep every button 48px high like the Japanese page */
html[lang="en"]:has(link[rel="canonical"][href*="/en/koma/"]) .kgo a,html[lang="en"]:has(link[rel="canonical"][href*="/en/koma/"]) .kgo .off,html[lang="en"]:has(link[rel="canonical"][href*="/en/koma/"]) .kgo .cur{line-height:1.25}
/* tesuji boards on the piece pages: the Restart / Back / Next row is 44px high on the Japanese page (the Japanese font gives a 20px line; Latin text gives a lower one) */
html[lang="en"] .ktsj .pctl button{line-height:20px}
/* tesuji boards on the piece pages: the label on the board ("If they capture" …) is about twice as wide in English as in Japanese (取ると).
   It may take two lines and is never wider than three squares, so it stays on the square it is put on and the two squares beside it, like the Japanese label */
html[lang="en"] .ktsj .uchilab{white-space:normal;width:max-content;max-width:calc((min(100vw,430px) - 22px) / 9 * 2.95);text-align:center;font-size:clamp(11px,3.4vw,13px);line-height:1.2;padding:3px 5px}
/* tesuji boards: the success mark (○ Success) on one line inside its box (half of the board), as the Japanese 〇成功 is */
html[lang="en"] .ktsj .sbwrap>.splash.ok{font-size:min(7vw,30px);letter-spacing:2px;white-space:nowrap}
/* badge on the moving boards (title + one line): English is about 1.7 times as wide as the Japanese (16 squares / 4 diagonals <-> 16マス / 斜め4方向).
   Smaller type and less padding keep the badge on the same squares as the Japanese badge (checked for every scene at 320 / 390 / 430 / 1280: reports/koma.md).
   white-space:pre = a line break written in the English text is kept (one badge: "+1 vertically / and horizontally") */
html[lang="en"]:has(link[rel="canonical"][href*="/en/koma/"]) .ha-badge{padding:calc(var(--pdc) * .14) calc(var(--pdc) * .25)}
html[lang="en"]:has(link[rel="canonical"][href*="/en/koma/"]) .ha-badge b{font-size:calc(var(--pdc) * .46)}
html[lang="en"]:has(link[rel="canonical"][href*="/en/koma/"]) .ha-badge span{font-size:max(11px, calc(var(--pdc) * .3));line-height:1.25;white-space:pre}
/* table of names (Piece / Formal name / Reading / Short name …): English words may break at spaces so that the table stays inside a 320px screen (the Japanese rule "no break inside a word" is kept: breaks only at spaces) */
html[lang="en"]:has(link[rel="canonical"][href*="/en/koma/"]) .ktbl th,html[lang="en"]:has(link[rel="canonical"][href*="/en/koma/"]) .ktbl td{white-space:normal}
/* ===== play family (/en/play/ = Play the AI, /en/shuban/ = Endgame): fixes for longer English only =====
   Every rule is limited to these two pages by their canonical URL. */
/* After the game the row under the board holds ◀ ▶ + "Analyze" + "Improvements (N)" + "Eval on". The English labels are about 60px longer than
   検討する / 改善点(N) / 評価値 オン and pushed ◀ off the left edge (up to 23px at 390px). Only in that row (game over), ◀ ▶ are 50px wide instead of 64px
   (in Japanese they also move at the end of the game: the row is filled from the right) */
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/play/"],[href$="/en/shuban/"])) .evalrow.over .mnav{width:50px}
/* Result / check text over the board (44px, 4px letter spacing): the longest English texts ("Win secured!", "Repetition", "Perpetual check")
   are wider than a phone board. Smaller letters on narrow screens only, so they stay on the board on one line (Japanese size from 383px up) */
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/play/"],[href$="/en/shuban/"])) .psplash{font-size:min(44px,11.5vw);letter-spacing:2px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/play/"],[href$="/en/shuban/"])) .psplash.two{font-size:min(30px,8.4vw);letter-spacing:1px}
/* Header during a game: "CPU 10-kyu Sente" (.hk, never cut) is wider than 強さ10級 先手 and squeezed the progress band next to it
   (at 390px the percentage disappeared; at 320px the band). One or two pixels smaller letters give the band its room back */
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/play/"],[href$="/en/shuban/"])) header .hmid.ing #hinfo .hk{font-size:12px}
@media (max-width:374.98px){html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/play/"],[href$="/en/shuban/"])) header .hmid.ing #hinfo .hk{font-size:11px}}
/* Buttons under the board (four in a row, 44px high, one line with "…" in Japanese): longer English labels ("Play from start", "Make a puzzle",
   "Play from here") may take two lines instead of being cut. Less padding above/below so two lines still fit in the same 44px (the row does not grow) */
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/play/"],[href$="/en/shuban/"])) .ops button{white-space:normal;line-height:1.15;padding-top:4px;padding-bottom:4px}
/* in a game on phones under 360px: the header text is smaller so that the progress band keeps its % (the band hides the number under 72px; JA band 93px) (2026-11-21 verify r3) */
@media (max-width:359.98px){html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/play/"],[href$="/en/shuban/"])) header .hmid.ing #hinfo, html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/play/"],[href$="/en/shuban/"])) header .hmid.ing #hinfo .hk{font-size:10px;letter-spacing:-.03em} html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/play/"],[href$="/en/shuban/"])) header .hmid.ing #htitle{font-size:12px;letter-spacing:-.02em}}
/* ===== rules family: /en/taikyoku/ /en/kakugen/ /en/sennichite/ /en/uchifuzume/ /en/nyugyoku/ /en/dan/ /en/tsumeshogi/rule/ =====
   Fixes for longer English only. Every rule is limited to these seven pages by the class that the build puts on <body>
   (conf.d/rules.json: <body class="sgr">), because other page families use the same class names (.hanim, .ha-badge, .hmini ...). */
/* badge on the 9x9 board: English is longer than the Japanese, so the title is smaller. One line as in Japanese (white-space:nowrap of the page);
   a badge that would still be wider than the board gets smaller letters (--enk, set by enBadgeFit in the *-anim.js of these pages), so it never wraps and never leaves the board */
html[lang="en"] body.sgr .ha-badge{padding:calc(var(--pdc) * .18) calc(var(--pdc) * .26)}
html[lang="en"] body.sgr .ha-badge b{font-size:calc(var(--pdc) * .44 * var(--enk, 1));letter-spacing:0}
html[lang="en"] body.sgr .ha-badge span{font-size:calc(max(12px, var(--pdc) * .34) * var(--enk, 1));letter-spacing:0}
/* tsume shogi rules page (rule-anim.js, no --enk): as before, a badge wider than the board wraps (its script also wraps it on purpose, level .sm + 4 squares) */
html[lang="en"] body.sgr-rule .ha-badge{width:max-content;max-width:calc(var(--pdc) * 9 - 8px);white-space:normal;text-wrap:balance}
/* "Illegal move" / "○ Correct!" over the board: one line, inside the board also at the largest size of the pop (x1.15).
   Not the near-mate splash ("Mate in 3!" / "So close…", .near): it keeps the two lines and the size of the Japanese one (white-space:pre-line, 34px) */
html[lang="en"] body.sgr .hanim .splash:not(.near){font-size:calc(var(--pdc) * .92);letter-spacing:1px;white-space:nowrap}
html[lang="en"] body.sgr .rq .splash{white-space:nowrap}
/* the same on the 5x5 cards */
html[lang="en"] body.sgr .hmv .splash{font-size:calc(var(--hmc) * .6);letter-spacing:0;left:0;right:0;white-space:nowrap}
/* tag at the bottom left of a picture card ("Seat of honor is sente"): may take two lines on the small cards; smaller on the wide picture on narrow screens */
html[lang="en"] body.sgr .tkfuri .tktag{max-width:92%;box-sizing:border-box;white-space:normal;text-wrap:balance;text-align:left;font-size:11px;line-height:1.35;padding:2px 8px}
html[lang="en"] body.sgr .hmini.big .tktag{font-size:12px;font-size:clamp(11px,4.2cqw,15px);line-height:1.5;padding:2px 10px}
/* game clock pictures (taikyoku page): "50 sec" / "1 min" are wider than 「50秒」「1分」, so the figures are a little smaller and stay on one line inside the clock face;
   the label over the figures ("Opponent", "Byoyomi") likewise. The clock itself keeps its size */
html[lang="en"] body.sgr .tkclk .hmct{font-size:calc(var(--hmc) * .5);letter-spacing:-.04em;white-space:nowrap}
html[lang="en"] body.sgr .tkclk .hmcl{font-size:clamp(8.5px, calc(var(--hmc) * .36), 10.5px)}
/* greeting pictures (taikyoku page): "Onegaishimasu" is 13 letters in a speech bubble made for 6 Japanese characters; a little smaller so it stays inside with wide fonts too */
html[lang="en"] body.sgr .tkais .tkbub text{font-size:8px}
/* rank ladders (dan page): English rank names and notes are longer, so the note gets a little more room and a smaller size (no clipping) */
html[lang="en"] body.sgr .dlr{gap:3px;padding-right:2px}
html[lang="en"] body.sgr .dln{padding:0 3px}
html[lang="en"] body.sgr .dlt{font-size:8.5px;font-size:clamp(8px,6.8cqw,10.5px)}
html[lang="en"] body.sgr .dl-s .dlt{font-size:8px;font-size:clamp(8px,6.6cqw,10px)}
/* buttons whose height comes from the line height of the font ("Restart / Back / Next" on the tsume shogi rules page, "Retry / Show answer" under its 1-move puzzles):
   where the Latin letters come from another font than the Japanese ones (Android: Roboto and Noto Sans CJK), English buttons were lower than the Japanese ones.
   An empty zero-width strut in the Japanese font (U+3000, invisible) gives the line the height of the Japanese line; where one font has both (iPhone, Windows) nothing changes */
html[lang="en"] body.sgr-rule .hanim .pctl button::after,
html[lang="en"] body.sgr .pdemo .pdctl button::after{content:"\3000";display:inline-block;width:0;overflow:hidden;vertical-align:top}
/* tsume shogi rules page (9x5 boards): its script moves the badge to the place that covers the fewest pieces and, when needed, makes it small (.sm) or wraps it.
   The English title is between the Japanese size (26px) and the 9x9 pages; the small form is smaller again */
html[lang="en"] body.sgr-rule .ha-badge{padding:6px 12px}
html[lang="en"] body.sgr-rule .ha-badge b{font-size:20px}
html[lang="en"] body.sgr-rule .ha-badge span{font-size:13px}
html[lang="en"] body.sgr-rule .ha-badge.sm{padding:4px 9px}
html[lang="en"] body.sgr-rule .ha-badge.sm b{font-size:16px}
html[lang="en"] body.sgr-rule .ha-badge.sm span{font-size:12px}
/* tsume shogi rules page, section "#tesu" (how to count moves): en.css has "@media (max-width:359px){html[lang="en"] #tesu button{font-size:12px}}" for the move-count buttons
   of the top page (same id). On this page it made the board buttons and the row button smaller than the Japanese ones; back to the Japanese sizes (shogi-ui.css .pctl button 14px, page .hrow 15px) */
@media (max-width:359px){html[lang="en"] body.sgr-rule #tesu .pctl button{font-size:14px}html[lang="en"] body.sgr-rule #tesu .hrow{font-size:15px}}
/* ===== study family (castles /en/kakoi/…, openings /en/senpo/…, tesuji /en/tesuji/…): fixes for longer English only =====
   Every rule is limited to these pages by their canonical URL (other page families use some of the same class names). */
/* "Restart / ◀ Back / Next ▶" under the tesuji boards: the Japanese buttons are 44px high (the height came from the Japanese letters); keep 44px */
html[lang="en"]:has(link[rel="canonical"]:is([href*="/en/kakoi/"],[href*="/en/senpo/"],[href*="/en/tesuji/"])) .pctl button.uchi{min-height:44px}
/* notes under the form buttons ("When to use it / Pros / Cons"): the Japanese rows are 48px high (name on the left, two lines of Japanese on the right).
   English needs more room: the name goes above its text and the row grows with the text. The script (enNote in the English study-ui.js) keeps every row
   as high as the longest note of that board, so the board does not move when another form is chosen */
html[lang="en"] :is(.study-page,.anaguma-page) .study-type-notes p{display:block;height:auto;padding:3px 0!important}
html[lang="en"] :is(.study-page,.anaguma-page) .study-type-notes b{display:block}
/* "Show answer" in the row of four buttons under a "What's the next move?" board: 答えを見る is 5 letters; on phones narrower than 375px the English reaches the edges of the button. Smaller letters there, still one line, button unchanged (44px) */
@media (max-width:374px){
html[lang="en"]:has(link[rel="canonical"]:is([href*="/en/kakoi/"],[href*="/en/senpo/"],[href*="/en/tesuji/"])) .kplayer .kp-ctl .kp-qshow,
html[lang="en"]:has(link[rel="canonical"]:is([href*="/en/kakoi/"],[href*="/en/senpo/"],[href*="/en/tesuji/"])) .pctl.tq-ctl.tq-think button.tq-qshow{font-size:10px!important;letter-spacing:-.2px}
}
/* CPU board inside an article (kakoi-cpu.js; no page has this board today): the row of four opening buttons (おまかせ / 急戦 / 持久戦 / 振り飛車) stays on one line as in Japanese */
html[lang="en"] .kcpu .gctl.kcpu-jo{gap:6px}
html[lang="en"] .kcpu .gctl.kcpu-jo button{padding-left:8px;padding-right:8px}
/* /en/senpo/ (list of openings): the three names after each heading are kept on one line in Japanese (.lnks{white-space:nowrap}); the English names are longer and
   pushed the page 129px wider than a 320px phone. They may wrap in English */
html[lang="en"]:has(link[rel="canonical"][href*="/en/senpo/"]) .lnks{white-space:normal}
/* bullets and the "(coming soon)" mark that the pages write with CSS (the build does not read <style>): ・ -> •, （準備中） -> (coming soon) */
html[lang="en"]:has(link[rel="canonical"]:is([href*="/en/kakoi/"],[href*="/en/senpo/"],[href*="/en/tesuji/"])) .tk2 .ti::before{content:"•"}
html[lang="en"]:has(link[rel="canonical"][href*="/en/kakoi/"]) .cross.dis::after{content:" (coming soon)"}
/* move-order buttons above the moving boards (.kp-rt, names of the move sequences): one line of Japanese = 44px (min-height). A longer English name takes two lines:
   with the Japanese line height and padding that is 45-48px; 17px lines and 4px top/bottom padding keep a two-line button at the Japanese 44px */
html[lang="en"]:has(link[rel="canonical"]:is([href*="/en/kakoi/"],[href*="/en/senpo/"],[href*="/en/tesuji/"])) .kplayer .kp-rt{line-height:17px;padding-top:4px;padding-bottom:4px}
/* "Pros / Cons" lists of the overview (#yurai): the Japanese keeps each bold label on one line (b{white-space:nowrap}, labels of 8-12 letters).
   Two English labels ("Steers away from the opponent's joseki:", "Easy to coordinate the attacking pieces:") are wider than a 320px phone and pushed the page 8-17px wider:
   in English a label may wrap when it does not fit */
html[lang="en"] .study-page #yurai .castle-overview b{white-space:normal}
/* same buttons on phones narrower than 375px: 7 of the 2,374 English names (e.g. "If the king moves over one more square, take the silver with the bishop and promote")
   needed three lines (61px) where the Japanese has one (44px). Slightly smaller letters there keep every button at two lines = 44px */
@media (max-width:374px){
html[lang="en"]:has(link[rel="canonical"]:is([href*="/en/kakoi/"],[href*="/en/senpo/"],[href*="/en/tesuji/"])) .kplayer .kp-rt{font-size:11.5px;letter-spacing:-.15px}
}
/* ===== tools family: /en/kifu-quiz/ (Game analysis), /en/history.html, /en/about.html, /en/contact.html, /en/privacy.html, /en/sitemap.html, /en/updates.html =====
   English text only. kifu-quiz is found by its own textarea (#kifInput), the other pages by their canonical URL. */
/* The Japanese page shows Latin letters and digits in its Japanese font too. With lang="en" the generic family gives a Latin font with
   a lower line (line-height: normal), so buttons, inputs and tabs were 2–6px lower than on the Japanese page. Name the Japanese
   fonts of the page, and Noto Sans CJK JP (the Japanese font of Linux and Android), before the generic family.
   :where() = no added specificity: fonts the page sets itself (the game record textarea: monospace) stay as they are. */
:where(html[lang="en"]:has(#kifInput, link[rel="canonical"][href$="/en/history.html"], link[rel="canonical"][href$="/en/about.html"], link[rel="canonical"][href$="/en/contact.html"], link[rel="canonical"][href$="/en/privacy.html"], link[rel="canonical"][href$="/en/sitemap.html"], link[rel="canonical"][href$="/en/updates.html"])) :is(body, button, input, select){font-family:"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,"Noto Sans JP","Noto Sans CJK JP",sans-serif}
/* Game analysis, viewer: "◀Bad move" / "Bad move▶" stay on one line like the Japanese buttons (on 2 lines the board became smaller at 320px) */
html[lang="en"]:has(#kifInput) #viewerCard .nav>button{white-space:nowrap;font-size:min(13px,calc((100vw - 58px) / 23));line-height:19px}
/* panel after "Analyze": "Your move / Analyzed move / Other move" fit their buttons (the Japanese labels are 3–4 characters) */
html[lang="en"]:has(#kifInput) .pvsel button{font-size:min(15px,calc((100vw - 48px) / 22.5))}
/* puzzle cards: 4 buttons in a row (n4) and the second row (Analysis page / ▶ Play from here / Notes) on narrow screens: one line, inside the button.
   The line height stays the one of the Japanese text size (Japanese font), so the rows keep the height of the Japanese page */
html[lang="en"]:has(#kifInput) .pb-btns.n4 button{font-size:min(15px,calc((100vw - 40px) / 22));line-height:21px}
@media (max-width:359.98px){html[lang="en"]:has(#kifInput) .pb-btns.n4 button{line-height:20px}}
html[lang="en"]:has(#kifInput) .pb-row2.n3 .b-play{font-size:min(15px,calc((100vw - 40px) / 26));line-height:21px}
html[lang="en"]:has(#kifInput) .pb-row2.n3>button{white-space:nowrap;font-size:min(15px,calc((100vw - 40px) / 21));line-height:21px}
/* About us: "Send feedback or a bug report" on one line like the Japanese button */
html[lang="en"]:has(link[rel="canonical"][href$="/en/about.html"]) a.btn{white-space:nowrap;font-size:min(16px,calc((100vw - 108px) / 15.2));line-height:24px}
/* ===== tsume1 family (1-move page, Daido page, tsume hub pages): layout fixes for longer English ===== */
/* Daido page, level boxes (made by daido-index.js): name + range, "Solved n / N" and "Next 1 puzzle" share one row like the Japanese
   (入門〜13手 / 解けた 0 / 38問 / つぎの1問). The English words are wider, so the gaps and the type are a little tighter. */
html[lang="en"] body[data-page="daido"] .dlvhead{column-gap:6px}
html[lang="en"] body[data-page="daido"] .dlvhead h2{font-size:15px}
html[lang="en"] body[data-page="daido"] .dlvrange{margin-left:5px;font-size:11.5px}
html[lang="en"] body[data-page="daido"] .dlvnum,html[lang="en"] body[data-page="daido"] .dlvclear{font-size:12px}
html[lang="en"] body[data-page="daido"] .dlvnext{padding-left:10px;padding-right:10px}
html[lang="en"] body[data-page="daido"] .dlvnext{min-height:44px}
/* Header (shared /_inc/top.php): "Shogi Gym", "Contents" and the page name ("|1-move mates|") are wider than 将棋ジム / 目次 / ｜1手詰め｜,
   so the page name was cut at 390-430px where the Japanese page shows it whole. Same fix as the 3/5/7/9-move pages (css.d/tsumeN.css): narrower
   "Contents" button, slightly smaller page name and gaps, phones only. */
@media (max-width:479.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"],[href$="/en/tsumeshogi/daido/"])) header{gap:5px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"],[href$="/en/tsumeshogi/daido/"])) #tocBtn{padding:0 5px;font-size:11.5px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"],[href$="/en/tsumeshogi/daido/"],[href$="/en/tsumeshogi/ranking/"],[href$="/en/tsumeshogi/kuzushi/"],[href$="/en/tsumeshogi/beginner/"])) header .hmid{font-size:12px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"],[href$="/en/tsumeshogi/daido/"])) header .hmid .sep{margin:0 3px}
}
@media (max-width:389.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"],[href$="/en/tsumeshogi/daido/"])) header{gap:3px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"],[href$="/en/tsumeshogi/daido/"])) #tocBtn{padding:0 4px;font-size:11px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"],[href$="/en/tsumeshogi/daido/"],[href$="/en/tsumeshogi/ranking/"],[href$="/en/tsumeshogi/kuzushi/"],[href$="/en/tsumeshogi/beginner/"])) header .hmid{font-size:11px}
}
/* Challenge box (#hchal, hub and 1-move page): "1 puzzle / 180 sec" is wider than 1問180秒 and was cut on phones (same sizes as css.d/tsumeN.css) */
@media (max-width:479.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"])) .hcsec button{font-size:11px}
}
@media (max-width:359.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"])) .hcsec button{font-size:10px;letter-spacing:-.2px}
}
/* Hub, castle-breaking box: "(5,922 puzzles)" never breaks inside (white-space:nowrap of the page), but in English the space before it was inside
   the nowrap span, so "mates (5,922 puzzles)" could not break at all and the link stuck out of the screen at 320px. As an inline-block the
   count goes to the second line as a whole, like the Japanese （5922問）. */
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"])) #kzhub .kzq{display:inline-block}
/* Buttons: same height as on the Japanese page. Their height comes from the line height of the label; a Japanese label is set in the CJK font,
   whose line is taller than the line of a Latin font where the Latin letters come from another font (Android, Linux; on iOS, macOS and Windows
   both come from the same font). An empty, zero-width ideographic space (U+3000) after the label puts the CJK line height into the English
   button too: same height as the Japanese button on every system, no visible character, no change of width. */
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"],[href$="/en/tsumeshogi/daido/"],[href$="/en/tsumeshogi/ranking/"],[href$="/en/tsumeshogi/kuzushi/"],[href$="/en/tsumeshogi/beginner/"])) :is(button, a.hcrank, a.patgo):not(#tocBtn):not(#menuBtn):not(.hrow):not(.starbtn):not(:empty)::after{content:"\3000";display:inline-block;width:0}
/* 320px: labels that are on one line in Japanese */
@media (max-width:359.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"])) .tdlv button{font-size:12.5px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/"],[href$="/en/tsumeshogi/1te/"])) .hcrank{padding-left:12px;padding-right:12px;font-size:14.5px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/ranking/"])) .rk3-tabs button{letter-spacing:-.3px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/beginner/"])) .pdctl button{padding-left:10px;padding-right:10px;font-size:12px;white-space:nowrap}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/beginner/"])) .pdctl button::after{font-size:13px}   /* line height of the 13px Japanese label (see the U+3000 rule above) */
}
/* ===== tsumeN family: /en/tsumeshogi/3te/ 5te/ 7te/ 9te/ (3-, 5-, 7-, 9-move mate parent pages). English labels are longer than the Japanese ones. ===== */
/* 1. Header: "Shogi Gym" and "Contents" are wider than 将棋ジム / 目次, so the page name ("| 3-move mates") was cut at 360-430px where the Japanese
      page shows it whole. Narrower "Contents" button, slightly smaller page name and gaps (phones only). */
@media (max-width:479.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) header{gap:5px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #tocBtn{padding:0 5px;font-size:11.5px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) header .hmid{font-size:12px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) header .hmid .sep{margin:0 3px}
}
@media (max-width:389.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) header{gap:3px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #tocBtn{padding:0 4px;font-size:11px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) header .hmid{font-size:11px}
}
/* 2. Course cards in two columns (360-491px): "Show move 1" / "Show next move" did not fit in half of the card. Retry gets 30% of the row, the blue
      button the rest; the widths are fixed (they do not change when the label changes), height stays 48px, one line. */
@media (min-width:360px) and (max-width:491.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) .courses .ccard .pdctl .pdreset{flex:0 0 30%}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) .courses .ccard .pdctl .pdstep{flex:1 1 0}
}
/* 3. Challenge box (shared /_inc/chal.php): "1 puzzle / 30 sec" is wider than 1問30秒 and was cut on phones */
@media (max-width:479.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) .hcsec button{font-size:11px}
}
@media (max-width:359.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) .hcsec button{font-size:10px;letter-spacing:-.2px}
}
/* 4. Short labels on board squares in the 9-move figures (guide-data.js marks: "Bishop reaches", "Guarded by silver"…): English words are wider than
      the 3-character Japanese lines; smaller type so a label stays on its square (a long word may still reach into the square on its left) */
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) .fg-mark-label{font-size:calc(var(--pdc) * .26);line-height:1.05}
/* 5. Today's puzzle heading row: "Today's 1 puzzle" + "Streak 12 days" are wider than 今日の1問 + 連続 12日. With a streak shown, the rank/progress bar
      of the row was pushed past the right edge at 320-359px (page scrolled sideways) and its "33.3%" was cut at 360-429px. Smaller heading and
      streak type on phones only. */
@media (max-width:429.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #todayBox .tdhead h2{font-size:14px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #todayBox .tdhead .tdstreak{font-size:10.5px;margin-right:2px}
}
@media (max-width:359.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #todayBox .tdhead{gap:4px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #todayBox .tdhead h2{font-size:13px}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #todayBox .tdhead .tdstreak{font-size:10px}
}
/* 6. Buttons under the puzzle boards (today's puzzle, easier/harder boards, new puzzles): the Japanese buttons take their width from their labels
      (1手目を見る and 次の手を見る are the same width). "Show move 1" -> "Show next move" is longer, so the other buttons narrowed when it changed
      (the row flickered) and at 320px "Show next move" / "Show answer" were cut. Fixed shares instead (Retry 1 : step 2.6 : others 2.2), so the widths
      never depend on the label; at 320-359px slightly smaller type in the 4-button row of today's puzzle. Height stays 48px, one line. */
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) :not(.ccard) > .pdemo .pdctl:not(.ngx-ctl):not(dialog .pdctl) > button{flex:2.2 1 0;min-width:0}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) :not(.ccard) > .pdemo .pdctl:not(.ngx-ctl):not(dialog .pdctl) > .pdreset{flex-grow:1}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) :not(.ccard) > .pdemo .pdctl:not(.ngx-ctl):not(dialog .pdctl) > .pdstep{flex-grow:2.6}
/* today's puzzle: /tsume-rate.js sets "#todaySlot .pdctl.has-next.has-step button{flex:1 1 auto}" (moves "Next 1 puzzle" into the row) -> same shares with an id */
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #todaySlot .pdctl.has-next > button{flex:2.2 1 0;min-width:0}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #todaySlot .pdctl.has-next > .pdreset{flex-grow:1}
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #todaySlot .pdctl.has-next > .pdstep{flex-grow:2.6}
@media (max-width:359.98px){
html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #todaySlot .pdctl.has-next.has-step > button, html[lang="en"]:has(link[rel="canonical"]:is([href$="/en/tsumeshogi/3te/"],[href$="/en/tsumeshogi/5te/"],[href$="/en/tsumeshogi/7te/"],[href$="/en/tsumeshogi/9te/"])) #todaySlot .pdctl.has-next.has-step #todayNext{font-size:10.5px;padding-left:2px;padding-right:2px}
}
/* hub /en/tsumeshogi/: the mate-length buttons "1-move" ... "9-move" stay on one line at 320-390px, as 1手 ... 9手 on the Japanese page (2026-11-21 verify) */
html[lang="en"]:has(link[rel="canonical"][href$="/en/tsumeshogi/"]) .tdlv button{white-space:nowrap;padding-left:2px;padding-right:2px;letter-spacing:-.03em;font-size:min(15px,3.6vw)}
@media (max-width:429px){html[lang="en"]:has(link[rel="canonical"][href$="/en/tsumeshogi/"]) .tdlv button[data-lv="daido"]{flex:0 0 auto;padding:0 8px}}   /* narrow phones: "Daido" is shorter than 大道詰, so its fixed 90px goes to the five length buttons; from 430px it keeps 90px as in Japanese */
/* ===== coordinator fixes (2026-11-21): things found after the family agents finished ===== */
/* shogi-rule.html, "Piece values" table: seven piece names in one row. English names are longer than one kanji, so on phones the cells get
   smaller type and tighter padding; the header cell may wrap. Without this the table is wider than the screen and the page scrolls sideways. */
@media (max-width:479px){
html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) #kachi + p + table th,
html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) #kachi + p + table td{padding-left:2px;padding-right:2px;font-size:12px;white-space:normal}
}
@media (max-width:359px){
html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) #kachi + p + table th,
html[lang="en"]:has(link[rel="canonical"][href$="/en/shogi-rule.html"]) #kachi + p + table td{padding-left:1px;padding-right:1px;font-size:10.5px}
}
/* promotion dialog (shogi-ui.js + assets/nari-dlg.js, every English page): "Don't promote" stays on one line and the dialog keeps the
   height of the Japanese one (hansoku agent, tested 320/390/430/1280) */
html[lang="en"] .sgpd .sgpd-r>button{font-size:max(11px,calc(var(--u)*4.8))!important;line-height:calc(max(12px,calc(var(--u)*6)) * 1.2)!important;letter-spacing:0!important;white-space:nowrap!important}
/* footer buttons (_inc/footnav.php): one line at 320px like the Japanese ones (koma agent, tested 320/360/390) */
html[lang="en"] .fnav a{padding-left:4px;padding-right:4px}
/* footer button "How the pieces move" on one line below 360px (koma agent, tested) */
@media (max-width:359px){html[lang="en"] .fnav a{font-size:12.5px}}
