header.kingdom-header{display:grid;grid-template-columns:minmax(0,1fr) auto 480px;gap:12px 20px;align-items:center}
.kingdom-header .release-label{display:none}
#online-root{min-width:0;width:100%;text-align:left}
.online-panel{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;background:#142b34;border:1px solid #59717a;border-radius:10px;padding:8px 12px;font-size:12px;line-height:1.4}
#online-game,#online-lobby{grid-column:1;grid-row:1}
#online-lobby{grid-column:1 / -1}
.online-panel:has(#online-lobby:not([hidden])) .online-footer{grid-column:2;grid-row:1;align-self:start}
.online-panel:has(#online-lobby:not([hidden])) #online-help summary{padding-top:0}
.online-panel:has(#online-lobby:not([hidden])) h2{padding-right:100px}
.online-panel h2{margin:0;font:600 16px/1.3 Georgia,serif;color:#f2da9f}
.online-panel p{margin:5px 0 0;line-height:1.4}
.online-panel button,.online-panel select{padding:5px 8px;font-size:12px;line-height:1.4;min-height:29px}
.online-panel button:disabled{opacity:.5}
.online-panel a{color:#e9cc83;text-underline-offset:3px}
.online-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.online-row h2{margin-right:auto}
.online-row label{display:flex;align-items:center;gap:6px}
.online-row select{width:auto;min-width:80px}
.online-create-row{margin-top:7px;justify-content:space-between}
#online-status{font-weight:600;color:#f1d89c}
.online-seats{display:flex;flex-wrap:wrap;gap:2px 12px;margin:4px 0;font-size:11px;color:#c6d7dd}
.online-dot{display:inline-block;width:6px;height:6px;background:#a4a7ab;border-radius:50%;margin-right:4px}
.online-dot.connected{background:#8bddb5}
.invite-row{display:flex;gap:10px;margin-top:6px;align-items:center;flex-wrap:wrap}
#invite-link{width:100%;min-width:0;box-sizing:border-box;margin-top:6px;background:#0d2028;color:#f1e9d8;border:1px solid #66828d;border-radius:6px;padding:8px;font-size:12px}
.online-footer{grid-column:2;grid-row:1;display:flex;flex-direction:column;gap:4px;align-items:flex-end;justify-content:center}
.online-actions{display:flex;gap:6px;flex-wrap:wrap}
#online-offer{border-top:1px solid #59717a;margin-top:7px;padding-top:2px}
#online-offer .online-actions{margin-top:5px}
#online-join-button{margin-top:6px}
.online-details{border:0;border-radius:0;padding:0;margin:0;background:none;min-width:0}
.online-details summary{font-size:11px;font-weight:400;color:#e9cc83;cursor:pointer;white-space:nowrap;padding:4px 0;line-height:1.5}
#online-help{margin-left:auto;flex-shrink:0}
.online-popover{position:absolute;z-index:20;top:calc(100% + 6px);right:0;box-sizing:border-box;width:352px;max-width:100%;max-height:min(60vh,420px);overflow:auto;background:#142b34;border:1px solid #59717a;border-radius:10px;padding:12px 14px;box-shadow:0 8px 24px #0007}
.online-popover p:first-child{margin-top:0}
.online-popover p+p{margin-top:10px}
.online-links{display:flex;flex-direction:column;gap:8px;margin-top:12px;font-size:12px}
.online-note{font-size:11px;color:#afc5cd}
#online-recent:not(:empty){margin-top:12px;border-top:1px solid #59717a;padding-top:9px}
#online-recent a{display:block;margin:6px 0;font-size:12px}
#online-error{color:#ffbfab;white-space:pre-line;overflow-wrap:anywhere}
#online-error{grid-column:1 / -1}
#online-error:empty{display:none}
[hidden]{display:none!important}
#computerpanel,#live-status,#ar-timeline,#explain-mate,#explain-draw,#undo,#load,#new,.leftcolumn>.panel:has(#demo),.leftcolumn>.panel:has(#introstart){display:none!important}
.online-disabled #board{opacity:.73}
#piecehelp{min-height:3em}
.special-action{display:flex;align-items:stretch;min-width:0;border:1px solid #536b74;border-radius:7px;background:#273e47;overflow:hidden}
.special-action>button{border:0;border-radius:0;background:transparent;min-width:0;padding:8px 5px;font-size:12px;flex:1}
.special-action>button:hover:not(:disabled){background:#36515c}
.special-action>.special-help-button{flex:0 0 27px;color:#f2da9f;border-left:1px solid #536b74;padding:5px;font-size:13px;font-weight:700}
.special-action>button:focus-visible{outline:2px solid #f2da9f;outline-offset:-3px}
#special-help{max-width:390px;width:calc(100% - 40px);box-sizing:border-box;padding:22px;border:1px solid #59717a;border-radius:12px;background:#142b34;color:#e1ebef;box-shadow:0 12px 50px #0008}
#special-help::backdrop{background:#07131ac9}
#special-help h2{margin:0 0 10px;color:#f2da9f;font:600 22px/1.3 Georgia,serif}
#special-help p{margin:0 0 18px;font-size:15px;line-height:1.6}
#special-help-close{min-height:36px}
.chat-panel{min-width:0;padding:12px}
.chat-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.chat-heading h2{margin:0;font-size:17px}
.chat-heading span{font-size:10px;color:#b2c1c6}
#chat-log{height:clamp(160px,27vh,230px);overflow-y:auto;overscroll-behavior:contain;border:1px solid #34464e;border-radius:7px;background:#12232b;padding:8px;scrollbar-width:thin}
#chat-empty{margin:4px;color:#b2c1c6;font-size:12px}
.chat-message{margin-bottom:8px;padding:7px 8px;border-radius:7px;background:#1e333e}
.chat-message:last-child{margin-bottom:0}
.chat-own{background:#284039}
.chat-meta{display:flex;gap:6px;align-items:baseline;justify-content:space-between;font-size:10px;color:#c3d6d8}
.chat-meta strong{font-weight:600;color:#edcf92}
.chat-meta time{white-space:nowrap;font-size:9px}
.chat-message p{margin:3px 0 0;font-size:13px;line-height:1.4;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-compose{display:flex;align-items:stretch;gap:6px;margin-top:8px}
#chat-input{flex:1;min-width:0;resize:vertical;max-height:130px;min-height:52px;width:100%;font:13px/1.4 system-ui;color:#f3eee1;background:#12232b;border:1px solid #59717a;border-radius:6px;padding:7px}
#chat-send{font-size:12px;padding:6px 9px}
#chat-send:disabled{opacity:.5}
#chat-status,#chat-error{margin:6px 0 0;font-size:10px;line-height:1.4;color:#b2c1c6}
#chat-error{color:#ffbfab}
#chat-error:empty{display:none}
#chat-latest{font-size:11px;padding:4px 8px;width:100%;margin-top:5px}
@media(min-width:801px) and (max-width:1100px){
  header.kingdom-header{grid-template-columns:minmax(0,1fr) 480px;gap:6px 14px}
  .kingdom-header .kingdom-brand{grid-column:1;grid-row:1}
  .kingdom-header .tourlink{grid-column:1;grid-row:2;justify-content:flex-start}
  #online-root{grid-column:2;grid-row:1 / 3}
}
@media(max-width:800px){
  header.kingdom-header{grid-template-columns:minmax(0,1fr) auto;gap:8px}
  #online-root{grid-column:1 / -1}
  .online-panel{padding:8px 10px}
}
@media(max-width:520px){
  .online-panel{display:block}
  .online-footer{flex-direction:row;justify-content:space-between;align-items:center;margin-top:5px}
  .online-panel:has(#online-lobby:not([hidden])) .online-footer{position:absolute;top:8px;right:10px;margin:0}
}
@media(max-width:650px){
  .online-panel button,.online-panel select{min-height:34px}
  .online-details summary{padding:7px 0}
  .leftcolumn>#online-chat{order:2}
}
.assist-panel{padding:12px;min-width:0}
.assist-panel h2{font-size:17px;margin:0 0 9px;color:#f2da9f}
.assist-strength{display:flex;gap:8px;align-items:center;font-size:12px}
.assist-strength select{flex:1;min-width:0;width:auto;padding:5px;font-size:12px}
.assist-range{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:9px;font-size:11px;color:#c5d2d7}
.assist-range input{display:block;box-sizing:border-box;width:100%;min-width:0;margin-top:3px;padding:6px;border:1px solid #59717a;border-radius:5px;background:#12232b;color:#f3eee1;font-size:13px}
.assist-note{margin:7px 0;font-size:11px;line-height:1.4;color:#b2c1c6}
.assist-buttons{display:flex;flex-wrap:wrap;gap:6px}
.assist-buttons button{flex:1;min-width:85px;padding:6px;font-size:12px}
.assist-buttons button:disabled{opacity:.5}
#assist-status,#assist-suggestion,#assist-error{margin:8px 0 0;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
#assist-status{color:#c5d2d7}
#assist-suggestion{color:#f2da9f}
#assist-error{color:#ffbfab}
#assist-suggestion:empty,#assist-error:empty{display:none}
#board .sq.assist-from{box-shadow:inset 0 0 0 4px #f3c862}
#board .sq.assist-to{box-shadow:inset 0 0 0 4px #57c6f0}
#board .sq.assist-capture{outline:3px solid #e88e83;outline-offset:-5px}
.assist-mark{position:absolute;bottom:2px;left:50%;transform:translateX(-50%);background:#10202ee6;color:#fff4d1;font:700 9px/1.3 system-ui;padding:1px 3px;border-radius:3px;pointer-events:none;max-width:100%}
.assisted-view #chat-log{height:clamp(120px,18vh,160px)}
@media(max-width:650px){.leftcolumn>.assist-panel{order:2}.assist-mark{font-size:7px}.assist-buttons button{min-height:36px}}
