/* Shared styles of the two-player games (common/games.css). Each page sets its palette in light and dark (--bg --panel --ink
   --muted --line --accent --accent-ink --danger, seat colours --s0 --s0e --s1 --s1e, its board colours, color-scheme:dark)
   and --board-ar, the aspect ratio of its board (e.g. 408/573), then adds its board-specific rules. */
*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{margin:0}
/* Layout: board on the left, game column on the right; stacked on phones */
:root{
  --f-display:"Bricolage Grotesque","Avenir Next",system-ui,sans-serif;
  --f-body:"IBM Plex Sans",system-ui,-apple-system,sans-serif;
  --f-mono:"IBM Plex Mono",ui-monospace,Menlo,monospace;
}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:15px;line-height:1.45;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:20px 32px}
.wrap{max-width:1080px;margin:0 auto;display:flex;flex-direction:column;gap:16px}
header{display:flex;flex-wrap:nowrap;align-items:flex-end;justify-content:space-between;gap:12px}
h1{font-family:var(--f-display);font-weight:800;font-size:2rem;letter-spacing:-.02em;margin:0;line-height:1}
h1 span{color:var(--muted);font-weight:600;font-size:1rem;letter-spacing:0;margin-left:.4em}
select,button{font:inherit;font-size:.9rem;color:var(--ink);background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:7px 10px;cursor:pointer}
button:hover:not(:disabled),select:hover{border-color:var(--muted)}
button:disabled{opacity:.45;cursor:default}
button.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* Game view (html.ingame, set by showGame): a fixed-height app, exactly the viewport, no page scroll. The game's section
   and <main> dissolve (display:contents) so the header, the board column and the side panel sit in one grid.
   Wide screens and landscape phones (html.wide, the WIDE query): header + board column on the left, side panel on the
   right over the full height, scrolling inside. Phones in portrait: header, players' row, board, action bar stacked;
   the side panel becomes a bottom sheet opened with « ⋯ ». */
:root{--barH:52px;--barW:150px;--barMax:112px;--sab:env(safe-area-inset-bottom,0px);--bp:9px}
html.ingame,html.ingame body{overflow:hidden;overscroll-behavior:none}
html.ingame body{height:100vh;height:100dvh;padding-top:max(10px,env(safe-area-inset-top,0px));padding-bottom:max(10px,var(--sab))}
html.ingame .wrap{max-width:none;height:100%;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:10px 16px}
html.ingame #game,html.ingame main{display:contents}
html.ingame header{grid-column:1;grid-row:1;flex-wrap:nowrap;align-items:center}
header .seg{margin-left:auto}
.optbtn{display:none;position:relative;font-size:1.2rem;line-height:1;padding:5px 12px;font-weight:700}
.optbtn.attn::after{content:"";position:absolute;top:3px;right:3px;width:9px;height:9px;border-radius:50%;background:var(--accent)}
html.ingame:not(.wide) .optbtn{display:inline-block}
.fsbtn{line-height:0;padding:6px 9px}.fsbtn.on{color:var(--accent);border-color:var(--accent)}
.boardwrap{position:relative;grid-column:1;grid-row:2;display:flex;flex-direction:column;gap:8px;min-width:0;min-height:0}
/* The board fits its area in both dimensions, keeping its proportions (--board-ar, set by the page), centred */
.boardarea{flex:1 1 0;min-height:0;min-width:0;container-type:size;display:flex;align-items:center;justify-content:center}
.board{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:8px;min-width:0;width:100%;height:100%}
.board svg{display:block;width:100%;height:100%;touch-action:manipulation;user-select:none;-webkit-user-select:none}
@supports (width:1cqh){.board{height:auto;width:min(100cqw,calc((100cqh - 2*var(--bp))*var(--board-ar) + 2*var(--bp)))}.board svg{height:auto;aspect-ratio:var(--board-ar)}}
html.ingame.wide .wrap{grid-template-columns:minmax(0,1fr) 300px}
.side > *{flex:none}
/* Wide: the header spans both columns; below it the board and the side panel start at the same height. The panel's top
   part (players' cards, then the action bar moved there by layoutMode) stays put; only .sidescroll below it scrolls. */
html.ingame.wide header{grid-column:1/-1}
html.ingame.wide .side{grid-column:2;grid-row:2;min-height:0;overflow:visible;padding:0}
html.ingame.wide .boardarea{align-items:flex-start}
.sidescroll{display:contents}
html.ingame.wide .side > .sidescroll{display:flex;flex-direction:column;gap:12px;flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:3px;margin:0 -3px -3px}
/* the action bar in the panel: message on its own lines, buttons wrapped full width; it takes the height it needs and
   what follows in the panel moves down */
html.ingame.wide .side .notice{height:auto;min-height:var(--barH);flex-direction:column;align-items:stretch;gap:6px;padding:8px 10px}
html.ingame.wide .side .notice .msg{-webkit-line-clamp:unset;line-clamp:none}
html.ingame.wide .side .notice .btns{flex-wrap:wrap;justify-content:center}
html.ingame.wide .side .notice .btns button{flex:1 1 auto}
/* Phones: thin side gutters, no frame around the board, compact players' row */
html.ingame:not(.wide) body{padding-left:max(8px,env(safe-area-inset-left,0px));padding-right:max(8px,env(safe-area-inset-right,0px));padding-top:max(6px,env(safe-area-inset-top,0px));padding-bottom:max(6px,var(--sab))}
html.ingame:not(.wide) .wrap,html.ingame:not(.wide) .boardwrap{gap:6px}
html.ingame:not(.wide) h1{font-size:1.45rem}
/* a long game name stays on one line, shortened, so the language switch and ⋯ stay on screen */

/* small phones: « games / » becomes a single back arrow, so the game's name stays whole */
@media (max-width:420px){html.ingame:not(.wide) h1{font-size:1.3rem}html.ingame h1 a.crumb{font-size:0}html.ingame h1 a.crumb::before{content:'‹';font-size:1.3rem;margin-right:.25em}html.ingame h1 .sep{display:none}}html.ingame header .seg,html.ingame header .optbtn{flex-shrink:0}
html.ingame:not(.wide) .board{--bp:0px;padding:0;border:0;border-radius:0;background:none}
html.ingame:not(.wide) .player{padding:4px 8px;border-radius:10px}
html.ingame:not(.wide) .player .who{font-size:.9rem}
html.ingame:not(.wide) .player .clock{font-size:1.15rem}
/* The bottom sheet: at most 80% of the height, scrolls inside, grabber on top, dimmed backdrop */
.sheetbg{position:fixed;inset:0;z-index:29;background:rgba(0,0,0,.42)}
html.ingame:not(.wide) .side{position:fixed;z-index:30;left:0;right:0;bottom:0;margin:0 auto;max-width:600px;max-height:80vh;max-height:80dvh;overflow:auto;overscroll-behavior:contain;
  background:var(--bg);border-radius:16px 16px 0 0;box-shadow:0 -10px 30px rgba(0,0,0,.3);outline:none;
  padding:8px max(12px,env(safe-area-inset-right,0px)) max(16px,var(--sab)) max(12px,env(safe-area-inset-left,0px));
  transform:translateY(105%);visibility:hidden;transition:transform .22s ease,visibility 0s .22s}
html.ingame.sheet:not(.wide) .side{transform:none;visibility:visible;transition:transform .22s ease}
html.ingame:not(.wide) .side::before{content:"";flex:none;align-self:center;width:40px;height:5px;border-radius:3px;background:var(--line);margin-bottom:2px}
@media (prefers-reduced-motion:reduce){html.ingame .side{transition:none!important}}
/* Action bar under the board: the only place for the move commands. Fixed height (the board does not jump when its
   buttons change), message clamped to 2 lines; on narrow screens the message goes above the buttons. */
.notice{height:var(--barH);flex:none;display:flex;align-items:center;justify-content:center;gap:4px 10px;padding:4px 10px;border-radius:10px;font-weight:500;font-size:.9rem;line-height:1.3;text-align:center;border:1px solid transparent;overflow:hidden;min-width:0}
.notice .msg{min-width:0;max-width:100%;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
.notice .btns{display:flex;gap:6px;flex:none;max-width:100%;min-width:0}
.notice.on{background:var(--panel);border-color:var(--line)}
.notice.turn{border-color:var(--accent)}.notice.win{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}
.notice button{padding:5px 10px;font-size:.85rem;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis}
@media (max-width:560px){:root{--barH:86px;--barMax:124px}.notice.has-btns{flex-direction:column;gap:5px}}
/* Not wide: the bar takes the height it needs, up to --barMax, kept free under the board (core: lockBoard) */
html.ingame:not(.wide) .boardwrap > .notice{height:auto;min-height:var(--barH)}
.players{display:flex;justify-content:space-between;gap:8px;flex:none}
.players.side-only{flex-direction:column}
.player{flex:1;min-width:0;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:8px 10px;display:flex;flex-direction:column;gap:2px;opacity:.75}
.player.active{opacity:1;border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}
.player .who{font-size:1rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.player.active .who{color:var(--ink)}
.player .clock{font-size:1.4rem;line-height:1.1}
.side details.prominent{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}
.side details.prominent summary{color:var(--ink);font-size:1rem}
.side details.prominent .link input{font-size:.95rem;padding:9px 10px}
.side details{padding:8px 12px}.side details summary{font-size:.85rem;font-weight:600;color:var(--muted)}
.side details > *:not(summary){margin-top:8px}
.side details .link,.side details .hint{margin-top:6px}
.navbar{flex:none}
/* Landscape phones: compact header, narrower side panel, thinner frame round the board */
@media (orientation:landscape) and (max-height:500px){
  :root{--barH:48px}
  body{padding-block:6px 12px}
  html.ingame body{padding-top:max(6px,env(safe-area-inset-top,0px));padding-bottom:max(6px,var(--sab))}
  .wrap,.view{gap:6px}
  html.ingame.wide .wrap{grid-template-columns:minmax(0,1fr) 260px;gap:6px 10px}
  .boardwrap{gap:6px}
  h1{font-size:1.3rem}h1 a.crumb,h1 .sep{font-size:.85rem}
  .seg button{padding:3px 8px}
  .board{--bp:5px;padding:4px;border-radius:12px}
  :root{--barW:100px}
  .boardwrap .notice{flex-direction:row!important}}
.status{font-weight:500;padding:10px 12px;border-radius:10px;background:var(--panel);border:1px solid var(--line);min-height:calc(2.9em + 22px);display:flex;align-items:center}
.status.turn{border-color:var(--accent)}
.status.win{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}
.side{display:flex;flex-direction:column;gap:12px;min-width:0}
.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:8px}
.card h2{margin:0;font-size:.72rem;text-transform:uppercase;letter-spacing:.09em;color:var(--muted);font-weight:600;display:flex;justify-content:space-between;align-items:center}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:visible}
.seg button{border:0;border-radius:0;padding:6px 10px;font-size:.8rem;font-weight:600;color:var(--muted)}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.seg .themeBtn{border-right:1px solid var(--line);min-width:2.4em;border-radius:7px 0 0 7px}
/* language: one frame with the current code, a menu drops from it */
.langdd{position:relative;display:inline-flex}
.langBtn{border-radius:0 7px 7px 0}.langBtn::after{content:'▾';margin-left:.3em;opacity:.65}
.langdd .menu{position:absolute;right:-1px;top:calc(100% + 5px);display:flex;flex-direction:column;min-width:8.5em;background:var(--panel);border:1px solid var(--line);border-radius:8px;overflow:hidden;box-shadow:0 6px 20px rgb(0 0 0/.18);z-index:30}
.langdd .menu[hidden]{display:none}
.langdd .menu button{text-align:left;padding:8px 14px;font-size:.85rem;font-weight:500;color:var(--ink);background:transparent;border:0;border-radius:0}
.langdd .menu button:hover{background:var(--line)}
.langdd .menu button[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.home{max-width:440px;margin:0 auto;display:flex;flex-direction:column;gap:14px;width:100%}
.home button.big{padding:14px;font-size:1.05rem}
.lede{color:var(--muted);margin:0;font-size:.95rem}   /* the game in one line, above the home card */
.newHead{display:flex;justify-content:space-between;align-items:center;gap:8px}
.newHead button.back,.linkish{background:none;border:none;padding:0;color:var(--muted);text-decoration:underline;text-underline-offset:3px;font-size:.85rem;cursor:pointer}
.linkish{color:var(--ink)}
.picks{display:flex;flex-direction:column;gap:8px}
.pick{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;padding:10px 12px}
.pick b{font-size:.98rem;color:var(--ink)}.pick span{font-size:.8rem;color:var(--muted);font-weight:400}
.joinLine{margin:0;text-align:center;font-size:.88rem;color:var(--muted)}
.home .err{color:var(--danger)}.home .err:empty{display:none}
/* home: Play, Analyse, the game to resume, the codes, in one card */
.homeMain{display:flex;flex-direction:column;gap:10px}
.homeMain[hidden]{display:none}
.resumeIn{display:flex;flex-direction:column;gap:6px;padding-top:4px}
.resumeIn[hidden]{display:none}
.home details.sub{padding:8px 12px}.home details.sub summary{font-size:.9rem}
.home details.sub > :not(summary){margin-top:8px}
/* a player's name that can be renamed in place: only the text cursor shows it */
.nmEdit{cursor:text;outline:none;border-radius:3px;min-width:2ch}
.nmEdit:focus{box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 55%,transparent)}
.home .card.primary-card{border-color:var(--ink);box-shadow:0 1px 0 var(--line)}
.home .card.primary-card h2{color:var(--ink);font-size:.95rem;text-transform:none;letter-spacing:0}
.home details{padding:10px 14px}
.home details .card{margin-top:10px}
.lvl{display:flex;align-items:center;gap:8px;font-size:.9rem;color:var(--muted)}
.lvl select{flex:1;min-width:0}
.who{display:flex;align-items:center;gap:6px;font-weight:600;color:var(--muted)}
.dot{width:15px;height:15px;border-radius:50%;flex:none;display:inline-block;vertical-align:-2px;margin-right:4px}
.dot.c0{background:var(--s0);border:1.5px solid var(--s0e)}
.dot.c1{background:var(--s1);border:1.5px solid var(--s1e)}
.hint{font-size:.8rem;color:var(--muted);margin:0}
/* the list's columns shared by every row (subgrid): the names as wide as the widest one, shrunk only when space runs out */
ol.log{margin:0;padding:0;list-style:none;font-family:var(--f-mono);font-size:.82rem;max-height:220px;overflow:auto;display:grid;grid-template-columns:minmax(2.2em,max-content) minmax(0,max-content) minmax(0,1fr);column-gap:8px;row-gap:2px;align-content:start}
ol.log li{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;font-variant-numeric:tabular-nums}
ol.log li span:last-child{overflow-wrap:anywhere}
ol.log .n{color:var(--muted)}
ol.log li.go{cursor:pointer;border-radius:4px}ol.log li.go:hover{background:color-mix(in srgb,var(--accent) 12%,transparent)}
ol.log li.cur{background:color-mix(in srgb,var(--accent) 28%,transparent)}
.navbar{display:flex;align-items:center;justify-content:center;gap:4px}
.navbar button{min-width:40px;padding:6px 8px}
/* analysis: the alternatives of the move shown, above and below the move number */
.navmid{display:flex;flex-direction:column;align-items:center;gap:2px}
.navbar .navalt{min-width:0;padding:0 18px;font-size:.62rem;line-height:1.5}
.navbar button:disabled{opacity:.35;cursor:default}
@media (max-width:400px){.navbar{gap:2px}.navbar button:not(.navalt){min-width:34px;padding:6px 4px}}   /* a phone, in analysis: seven buttons and « Jugada 44 / 44 » on one line */
ol.log .alt{color:var(--accent);margin-left:2px}
/* a private move at a shared analysis (only this page sees it): italic, a dashed frame */
ol.log li.priv{font-style:italic;outline:1px dashed color-mix(in srgb,var(--muted) 80%,transparent);outline-offset:-1px;border-radius:4px}
ol.log li.priv .n::after{content:' ⦿';color:var(--muted);font-style:normal}
.navpos{font-family:var(--f-mono);font-size:.85rem;font-variant-numeric:tabular-nums;min-width:11ch;text-align:center;color:var(--muted);white-space:nowrap}
details{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:10px 14px}
details summary{cursor:pointer;font-weight:600}
details ul{margin:.6em 0 0;padding-left:1.2em;max-width:70ch}
details li{margin:.25em 0}
.cell{cursor:pointer}
@media (prefers-reduced-motion:no-preference){.pulse{animation:pulse 1.4s ease-in-out infinite}@keyframes pulse{50%{opacity:.45}}}

[hidden]{display:none!important}
.view{display:flex;flex-direction:column;gap:16px}
a{color:inherit}
.form{display:flex;flex-direction:column;gap:10px}
.form label{display:flex;flex-direction:column;gap:4px;font-size:.8rem;color:var(--muted)}
.form label.toggle{flex-direction:row;font-size:.9rem;color:var(--ink)}
.clock{font-family:var(--f-mono);font-size:1.6rem;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.clock.run{color:var(--ink)}
.clock.idle{color:var(--muted)}
.clock.low{color:var(--danger)}
.clock[data-inc]::after{content:attr(data-inc);margin-left:.6em;font-family:var(--f-body);font-size:.62em;font-weight:500;letter-spacing:0;color:var(--muted);white-space:nowrap}
.link{display:flex;gap:6px}
.link input{flex:1;min-width:0;font:inherit;font-family:var(--f-mono);font-size:.78rem;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:6px 8px}
.confirm{display:flex;gap:8px}
.confirm button{flex:1}
.toggle{display:flex;align-items:center;gap:8px;font-size:.9rem;cursor:pointer}
.toggle input{width:18px;height:18px;accent-color:var(--accent);flex:none}
.danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 50%,var(--line))}
.empty{color:var(--muted);margin:0}
.txt{font:inherit;font-size:.95rem;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:8px 10px;min-width:0}
#watchInfo{text-transform:none;letter-spacing:0;font-weight:400}

/* header breadcrumb: games / game name */
h1 a.crumb{color:var(--muted);font-weight:600;font-size:1rem;letter-spacing:0;text-decoration:none}
h1 a.crumb:hover,h1 a.gname:hover{color:var(--accent)}
h1 .sep{margin:0 .3em;font-weight:400;color:var(--muted);font-size:1rem}
h1 a.gname{color:inherit;text-decoration:none}
/* One line, always: the buttons keep their size on the right, the title takes the room left. When it lacks room
   (fitHead, core.js) the title drops « peer to peer » (.hnosub), then « games / » for « ‹ » (.hshort), then shrinks down
   to --h1min (rem), and only then is cut by « … » */
header h1{--h1min:1.15;flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-block:.12em;margin-block:-.12em}
header>:not(h1){flex-shrink:0}
header.hnosub h1>span[data-i18n="sub"]{display:none}
header.hshort h1 a.crumb{font-size:0}header.hshort h1 a.crumb::before{content:'‹';font-size:1.3rem;margin-right:.25em}header.hshort h1 .sep{display:none}

/* action bar: a button's short label shows only when the full labels don't fit (core.js fitBtns) */
.notice .btns.measure{flex-wrap:nowrap!important}.notice .btns.measure>button{flex:none!important;max-width:none!important}   /* !important: a page's own rule on the buttons must not upset the measure */
/* buttons that overflow even with their short labels: two rows, the bar grows (fitBtns) */
.notice.rows2{height:auto;min-height:var(--barH);align-items:stretch}.notice.rows2 .btns{flex-wrap:wrap;justify-content:center}.notice.rows2 .btns button{flex:1 1 auto}.notice .bs{display:none}.notice.short .bl{display:none}.notice.short .bs{display:inline}
/* Mochalunt: the match card in the side panel (table, score, seat choice, the tables) */
.mcard h2{font-size:.9rem}
.mcard .mscore{margin:0;font-weight:650}
.mlist{margin:0;padding:0;list-style:none;font-size:.85rem;display:grid;grid-auto-flow:column;grid-template-columns:1fr 1fr;gap:2px 14px}
.mlist li{display:flex;flex-wrap:wrap;column-gap:6px;min-width:0}
.mlist li.cur{font-weight:650}
.mlist a{color:inherit}
.mlist .mres{color:var(--muted)}
/* the name asked over the board on arriving by a link (a player: the name the opponent sees; a spectator: a name or none) */
.nameov{position:absolute;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;padding:16px;background:color-mix(in srgb,var(--bg) 60%,transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
.nameov[hidden]{display:none}
.startov{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:12px;border-radius:inherit;pointer-events:none}
.startov:has(>#startCard:not([hidden])){pointer-events:auto;background:color-mix(in srgb,var(--bg) 55%,transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
.startov .card{width:min(20rem,100%);box-shadow:0 10px 32px rgba(0,0,0,.22);text-align:center}
.startov .card h2{justify-content:center}.startov .card .hint{margin:0}.startov .card .hint:empty{display:none}
.startov .sfmsg{margin:0;font-weight:700;color:var(--ink)}
.startov #sfChoice{font-weight:650;color:var(--ink)}
.startov .sfbig{font-size:3.6rem;font-weight:700;line-height:1;margin:4px 0;color:#a87a0c;font-variant-numeric:tabular-nums}   /* gold, in both themes */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .startov .sfbig{color:#e8b84a}}
:root[data-theme="dark"] .startov .sfbig{color:#e8b84a}
.startov .sfbig.pop{animation:sfpop .45s ease-out}
@keyframes sfpop{from{transform:scale(1.5);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.startov .sfbig.pop{animation:none}}
#mAsk:not([hidden]){display:flex;flex-direction:column;gap:8px}
/* a rematch offered to me (core.js, renderGame): a frame over the board, as the start frame, with a cross to close it */
.rmov{position:absolute;inset:0;z-index:25;display:flex;align-items:center;justify-content:center;padding:12px;border-radius:inherit;background:color-mix(in srgb,var(--bg) 55%,transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
.rmov[hidden]{display:none}
.rmov .card{position:relative;width:min(20rem,100%);box-shadow:0 10px 32px rgba(0,0,0,.22);text-align:center}
.rmov .sfmsg{margin:4px 22px 0;font-weight:700;color:var(--ink)}
.rmov .rmx{position:absolute;top:4px;right:4px;width:30px;height:30px;padding:0;border:0;background:none;font-size:1.25rem;line-height:1;color:var(--muted);cursor:pointer}
.rmov .rmx:hover{color:var(--ink)}
.mqopt{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.mqopt button{flex:none}.mqopt small{font-size:.72rem;line-height:1.3;color:var(--muted)}
.nameov .card{width:min(22rem,100%);box-shadow:0 10px 32px rgba(0,0,0,.22)}
.nameov h2{margin:0;font-size:1.05rem}.nameov .hint{margin:0}
.nameov .confirm{justify-content:flex-start}
/* the spectators, listed in their section of the side column */
.wlist{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:2px;font-size:.88rem}
.wlist .hint{font-size:.85rem}
/* the chat (online games), in the side column: a framed area of its own (kept even when empty, so one sees where the
   messages and the game's log go), the field under it; each name in its own colour (--nh, a hue), then « : » */
.chatlist{list-style:none;margin:8px 0 0;padding:6px 8px;min-height:7.5em;max-height:200px;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:3px;font-size:.88rem;overflow-wrap:anywhere;
  background:var(--bg);border:1px solid var(--line);border-radius:8px}
details .chatlist li{margin:0}
.chatlist .nm{font-weight:700;color:hsl(var(--nh,210) 62% 36%)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .chatlist .nm{color:hsl(var(--nh,210) 75% 72%)}}
:root[data-theme="dark"] .chatlist .nm{color:hsl(var(--nh,210) 75% 72%)}
.chatlist .obs{color:var(--muted);font-size:.85em}
.chatlist li.log{color:var(--muted);font-style:italic;font-size:.82rem}
.chatlist .hint{font-size:.85rem}
#chatHint{margin:6px 0 0;font-size:.8rem}
.chatform{display:flex;gap:6px;margin-top:8px}
.chatform .txt{flex:1 1 auto;padding:6px 9px}
.chatform button{flex:none}
#chatName{margin-top:8px;width:100%}
/* voice chat between the two players: at the bottom of the chat frame */
.voicein{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.voicein .hint{margin:0;font-size:.85rem}
.voicein .confirm{justify-content:flex-start}
.voicectl{display:flex;align-items:center;gap:8px}
.voicectl input[type=range]{flex:1;min-width:0;accent-color:var(--accent)}
#voiceMute{flex:none;padding:5px 10px;line-height:1}#voiceMute.on{border-color:var(--danger);color:var(--danger)}
#voiceHang{flex:none}
.player .vmic{margin-left:.35em;font-size:.85em}

/* spectators present: one line at the top of the chat frame */
.wline{margin:6px 0 0;font-size:.85rem;color:var(--muted)}
.voicein{padding-top:8px;border-top:1px solid var(--line)}

/* Band layout (<html data-band>): on wide screens the players' cards form a band above the board. Each
   card: name over clock on the outer side, the game's own information (Tintas: the colours taken) towards the middle */
html.ingame.band .boardwrap > .players{gap:10px;align-items:stretch}
html.ingame.band #playersTop > .player{display:grid;grid-template-columns:minmax(0,max-content) minmax(min-content,1fr);grid-template-areas:"who x" "clock x";column-gap:14px;row-gap:0;align-items:center;padding:6px 12px}
html.ingame.band #playersTop > .player > *{grid-area:x;min-width:0}
html.ingame.band #playersTop > .player > .who{grid-area:who}
html.ingame.band #playersTop > .player > .clock{grid-area:clock;font-size:1.2rem}
html.ingame.band #playersTop > .player.c1{grid-template-columns:minmax(min-content,1fr) minmax(0,max-content);grid-template-areas:"x who" "x clock";text-align:right}
html.ingame.band #playersTop > .player.c1 > :not(.who):not(.clock){justify-self:start}
html.ingame.band #playersTop > .player.c0 > :not(.who):not(.clock){justify-self:end}
html.ingame.band #playersTop > .player > .clock[hidden]+*{grid-row:1 / span 2}
/* « haut »: the status sentence between the two cards; its buttons stay in the bar under the board */
.bandmsg{order:1;flex:1 1 0;min-width:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:4px 10px;border:1px solid var(--line);border-radius:12px;background:var(--panel);font-weight:500;font-size:.9rem;line-height:1.3}
.bandmsg .msg{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;overflow-wrap:anywhere}
.bandmsg.turn{border-color:var(--accent)}.bandmsg.win{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}
html.ingame.band .boardwrap > .notice.empty{visibility:hidden}
html.ingame.band #playersTop > .player.c1{order:2}
/* the bar under the board, once its sentence has gone up: buttons only, no frame */
html.ingame.band[data-band="haut"] .boardwrap > .notice{background:none;border-color:transparent;box-shadow:none}
/* wide screens: the chat docked at the bottom of the side column (chatDock), its height dragged from the top edge;
   the other frames scroll in what is left above it */
.chatgrip{display:none}
html.ingame.wide .side > #chatBox{position:relative;flex:none;margin-top:0}
html.ingame.wide .side > #chatBox .chatlist{min-height:0;max-height:none}
html.ingame.wide .side > #chatBox[open] > .chatgrip{display:block;position:absolute;left:0;right:0;top:-7px;height:12px;margin:0;cursor:ns-resize;touch-action:none;z-index:2}
html.ingame.wide .side > #chatBox[open] > .chatgrip::after{content:"";position:absolute;left:50%;top:4px;width:36px;height:4px;margin-left:-18px;border-radius:2px;background:var(--line)}
html.ingame.wide .side > #chatBox[open] > .chatgrip:hover::after{background:var(--muted)}
html.ingame.band #playersTop > .player .tally{min-width:150px}
/* Codes frame: one compact row per code: label, the code in clear (wide enough for a whole code: pe-k7m2qab), two small
   buttons (code, link; « copy … » on hover) */
.vh{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.coderow{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;column-gap:6px}
.side details .coderow{margin-top:4px}
.side details #invPart > .coderow:first-of-type{margin-top:8px}
.coderow > .hint{margin:0!important;font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.coderow .codetxt{min-width:0;width:10.2ch;border:none;background:none;padding:0;font-family:var(--f-mono);font-size:.9rem;color:var(--ink);text-overflow:ellipsis}
.coderow .cbtns{display:flex;gap:4px}
.coderow .cbtns button{padding:2px 7px;font-size:.78rem;line-height:1.4;min-width:3.6em}
#invPart:has(#linksBox[hidden]) .lnk,#invPart:has(#oppLink[hidden]) #codePBox .lnk,#invPart:has(#watchLinkBox[hidden]) #codeWBox .lnk{visibility:hidden}
/* a match: links only, no code */
.coderow.linkonly .codetxt,.coderow.linkonly .cbtns button:not(.lnk){display:none}.coderow.linkonly .cbtns{grid-column:3}
/* the host's note only while waiting for the opponent */
#inviteBox:not(.prominent) #hostNote{display:none}
/* band: names at the top, the command bar at the bottom, the board centred in the room between */
html.ingame.band .boardarea{align-items:center}
/* Phones in portrait, a network game: the chat in the game view, under the action bar, in the room the board does not
   use (core: lockBoard puts html.pchat when there is room, chatMode sets data-cm from the frame's height): « full » the
   messages and the field, « line » the last message only; otherwise « 💬 » in the header (.chatbtn). A touch opens it
   over the board (html.chatup), with the observers, the voice chat and the hint. */
.chatbtn{display:none;position:relative;flex-shrink:0;font-size:1rem;line-height:1;padding:5px 9px}
html.ingame:not(.wide) .chatbtn:not([hidden]){display:inline-block}
.chatbtn[data-n]:not([data-n=""])::after{content:attr(data-n);position:absolute;top:-6px;right:-6px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:var(--accent);color:var(--accent-ink);font-size:.7rem;font-weight:700;line-height:17px;text-align:center}
html.ingame:not(.wide) .boardwrap > #chatBox{display:none}
html.ingame.pchat:not(.wide) .boardwrap > #chatBox:not([hidden]){display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:hidden;margin:0;padding:0;border:0;border-radius:0;background:none;cursor:pointer}
html.ingame:not(.wide) .boardwrap > #chatBox > :where(summary,.wline,#chatHint,.voicein,.chatgrip){display:none}
/* its title on the frame of the messages, like a legend (7 px of the chat's height) */
html.ingame.pchat:not(.wide):not(.chatup) .boardwrap > #chatBox:not([hidden]){position:relative;padding-top:7px}
html.ingame.pchat:not(.wide):not(.chatup) .boardwrap > #chatBox:not([data-cm="none"]) > summary{display:block;position:absolute;top:1px;left:10px;z-index:1;list-style:none;margin:0;padding:0 5px;font-size:.7rem;line-height:12px;font-weight:600;color:var(--muted);background:var(--bg);pointer-events:none}
html.ingame.pchat:not(.wide):not(.chatup) .boardwrap > #chatBox > summary::-webkit-details-marker{display:none}
html.ingame.pchat:not(.wide):not(.chatup) .boardwrap > #chatBox[data-cm="line"]{padding-top:6px}
html.ingame.pchat:not(.wide):not(.chatup) .boardwrap > #chatBox[data-cm="line"] > summary{top:0}
html.ingame.pchat:not(.wide):not(.chatup) .boardwrap > #chatBox[data-cm="line"] .chatlist{padding-block:2px;line-height:1.2}
html.ingame.pchat:not(.wide):not(.chatup) .boardwrap > #chatBox[data-cm="full"] .chatlist{padding-top:9px;-webkit-mask-image:linear-gradient(transparent 7px,#000 13px);mask-image:linear-gradient(transparent 7px,#000 13px)}
html.ingame:not(.wide) .boardwrap > #chatBox .chatlist{flex:1 1 0;min-height:0;max-height:none;margin:0;padding:4px 8px;gap:2px}
html.ingame:not(.wide) .boardwrap > #chatBox .chatform,html.ingame:not(.wide) .boardwrap > #chatBox #chatName{margin-top:5px;flex:none}
html.ingame:not(.chatup) .boardwrap > #chatBox[data-cm="line"] :is(.chatform,#chatName){display:none}
html.ingame:not(.chatup) .boardwrap > #chatBox[data-cm="line"] .chatlist{overflow:hidden;justify-content:center}
html.ingame:not(.chatup) .boardwrap > #chatBox[data-cm="line"] .chatlist li{display:none}
html.ingame:not(.chatup) .boardwrap > #chatBox[data-cm="line"] .chatlist li:last-child{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.ingame:not(.chatup) .boardwrap > #chatBox[data-cm="none"] > *{visibility:hidden}
/* opened over the board: a bottom sheet of its own, the board under it keeps its size */
.chatbg{z-index:31}
html.ingame.chatup:not(.wide) .boardwrap > #chatBox:not([hidden]){display:flex;flex-direction:column;position:fixed;z-index:32;left:0;right:0;bottom:0;margin:0 auto;max-width:600px;height:min(70vh,560px);height:min(70dvh,560px);
  bottom:var(--kb,0px);max-height:calc(var(--vvh,100vh) - 8px);
  padding:10px max(12px,env(safe-area-inset-right,0px)) max(12px,var(--sab)) max(12px,env(safe-area-inset-left,0px));border:0;border-radius:16px 16px 0 0;background:var(--bg);box-shadow:0 -10px 30px rgba(0,0,0,.3);cursor:auto}
html.ingame.chatup:not(.wide) .boardwrap > #chatBox > :is(summary,.wline){display:block;flex:none}
html.ingame.chatup:not(.wide) .boardwrap > #chatBox > summary{list-style:none;cursor:pointer;font-weight:600;padding:2px 0 6px;text-align:center}
html.ingame.chatup:not(.wide) .boardwrap > #chatBox > summary::-webkit-details-marker{display:none}
/* where the browser tells what is seen (visual viewport): the open chat stands on its bottom, the top of the keyboard
   when it is out, whatever the browser does with its own bars */
html.ingame.chatup.vv:not(.wide) .boardwrap > #chatBox:not([hidden]){top:var(--vvb);bottom:auto;transform:translateY(-100%)}
/* 16 px at least: a phone does not zoom on the field when it gets the focus */
html.ingame:not(.wide) .boardwrap > #chatBox #chatIn{font-size:16px}
html.ingame.chatup:not(.wide) .boardwrap > #chatBox > summary::before{content:"";display:block;width:40px;height:5px;border-radius:3px;background:var(--line);margin:0 auto 8px}
html.ingame.chatup:not(.wide) .boardwrap > #chatBox > .wline{margin:0 0 6px;font-size:.82rem;color:var(--muted)}
html.ingame.chatup:not(.wide) .boardwrap > #chatBox > #chatHint:not([hidden]){display:block;flex:none}
html.ingame.chatup:not(.wide) .boardwrap > #chatBox > .voicein:not([hidden]){display:flex;flex:none}
html.ingame.chatup:not(.wide) .boardwrap > #chatBox .chatlist{padding:6px 8px;gap:3px}
html.ingame.chatup:not(.wide) .boardwrap > #chatBox > .voicein{margin-top:8px}
html.ingame:not(.wide) .boardwrap > #chatBox .chatlist > li:first-child{margin-top:auto}
/* « Comment jouer » (GAME.howto, common/core.js): a card over the board, its pages animated; the grey behind it does not
   close it. The language and theme buttons stay usable over it: they translate or recolour it, it stays open. A page
   may set its picture's background (#htSvg) */
.howto{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.45)}
.howto[hidden]{display:none}
html.htshown header .seg{position:relative;z-index:61}
.htcard{width:min(420px,100%);max-height:100%;overflow:auto;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,.35);padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.hthead{display:flex;justify-content:space-between;align-items:baseline}.hthead b{font-size:1.05rem}.hthead span{color:var(--muted);font-size:.85rem;font-variant-numeric:tabular-nums}
#htSvg{width:100%;height:auto;display:block;border-radius:10px;background:var(--wood,var(--bg))}
.htcard p{margin:0;min-height:5.6em;line-height:1.4;font-size:.93rem}
/* short texts (GAME.howto.titled): the action on its own line, the instruction under it, centred; the buttons named
   look like the page's buttons */
.howto.titled .htcard p{text-align:center;min-height:4.5em}
.howto.titled .htcard p>b:first-child{display:block;font-size:1.02rem;margin-bottom:1px}
.htcard p .bt{display:inline-block;font-size:.84rem;line-height:1.25;border:1px solid var(--line);border-radius:6px;padding:0 6px;background:var(--panel);white-space:nowrap}
.htnav{display:flex;align-items:center;justify-content:space-between;gap:8px}.htnav button{min-width:44px;font-size:1.1rem;padding:4px 12px}
.htdots{display:flex;gap:7px}.htdots i{width:8px;height:8px;border-radius:50%;background:var(--line);cursor:pointer}.htdots i.on{background:var(--accent)}
.htfoot{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:.88rem}.htfoot label{display:flex;align-items:center;gap:6px;color:var(--muted);cursor:pointer}
.htopen{margin:.6em 0 0}
/* « Signaler un défaut » (core.js, reportUi): a discreet link at the end of Options */
.rpline{margin:4px 0 0;font-size:.82rem}.rpline a{color:var(--muted)}.rpline a:hover{color:var(--accent)}
/* A phone held sideways during a game: one line asking to turn it, over everything (decision of 15.11.2026) */
.rotatemsg{display:none}
@media (orientation:landscape) and (max-height:500px) and (pointer:coarse){
  html.ingame .rotatemsg{display:flex;position:fixed;inset:0;z-index:1000;align-items:center;justify-content:center;background:var(--bg);color:var(--ink);
    padding:max(16px,env(safe-area-inset-top,0px)) max(24px,env(safe-area-inset-right,0px)) max(16px,var(--sab)) max(24px,env(safe-area-inset-left,0px));text-align:center}
  html.ingame .rotatemsg p{margin:0;font-family:var(--f-display);font-weight:800;font-size:1.3rem;max-width:22em}
  html.ingame .rotatemsg p::before{content:"⟳";display:block;font-size:2.4rem;margin-bottom:8px;color:var(--accent)}}
/* board coordinates, the same drawing in every game: monospace, semi-bold, the page's --lab colour (set for both themes) */
svg .coord{font-family:var(--f-mono);font-weight:600;fill:var(--lab);pointer-events:none;-webkit-user-select:none;user-select:none}
/* the shared analysis (core.js: anRender): those at the table, who has control */
.ancard .anwho{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:3px}
.ancard .anwho li{display:flex;align-items:center;gap:6px 8px;flex-wrap:wrap;font-size:.9rem;padding:4px 8px;border-radius:8px;min-height:30px}
.ancard .anwho li.ctl{background:color-mix(in srgb,var(--accent) 16%,transparent)}
.ancard .anwho .nm{font-weight:600;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.ancard .anwho .tag{color:var(--muted);font-size:.8rem}
.ancard .anwho button{margin-left:auto;padding:3px 12px;font-size:.82rem}
.ancard #anCtlTxt{color:var(--ink)}
