#nook-chess[hidden],#nook-chess [hidden]{display:none!important}
#nook-chess{margin:24px 0;padding:24px;border:1px solid var(--line,#405044);border-radius:16px;background:rgba(14,25,22,.95);box-sizing:border-box;min-width:0}
#nook-chess h3{font:28px Georgia,serif;margin:6px 0 10px;color:var(--gold,#d7b56d)}
#nook-chess p{line-height:1.5}#nook-chess .chess-muted{color:var(--muted,#acb5ae);font-size:14px}
#nook-chess button,#nook-chess select,#nook-chess textarea{font:inherit;box-sizing:border-box;max-width:100%;border:1px solid #647061;border-radius:8px;background:#17291f;color:#eee;padding:9px 12px}
#nook-chess button{cursor:pointer}#nook-chess button:disabled{opacity:.55;cursor:default}#nook-chess button:focus-visible{outline:3px solid #e1bd6e;outline-offset:2px}
#nook-chess .chess-primary{background:#c6aa6b;color:#151c18;font-weight:600}
.chess-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin:16px 0}.chess-controls label{display:grid;gap:6px;min-width:0;font-size:14px}.chess-controls select{width:100%}
.chess-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:24px}.chess-layout>*{min-width:0}
#chess-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));gap:0;width:100%;aspect-ratio:1;border:5px solid #6e5636;border-radius:5px;box-sizing:border-box;overflow:hidden}
#nook-chess .chess-square{appearance:none;-webkit-appearance:none;border:0;border-radius:0;margin:0;padding:0;position:relative;width:100%;height:100%;min-width:0;min-height:0;max-height:none;line-height:1;display:grid;place-items:center;opacity:1;touch-action:manipulation;overflow:hidden}
#nook-chess .chess-square.light{background:#d9ccae}#nook-chess .chess-square.dark{background:#62756a}#nook-chess .chess-square.selected{box-shadow:inset 0 0 0 4px #e7b73e}#nook-chess .chess-square.possible:after{content:'';position:absolute;width:25%;height:25%;background:#193d2b99;border-radius:50%;pointer-events:none}
#nook-chess .chess-square.last-move{background-image:linear-gradient(#dab74244,#dab74244)}
.chess-square img{width:84%;height:84%;pointer-events:none}.chess-square small{position:absolute;left:2px;bottom:0;font:9px system-ui;color:#15231b;pointer-events:none}
#chess-moves{display:flex;flex-wrap:wrap;gap:5px;max-height:125px;overflow:auto;margin:14px 0}#nook-chess #chess-moves button{padding:5px 8px;font-size:13px}#nook-chess #chess-moves .current{border-color:#e1bd6e}
#chess-chat-log{max-height:280px;overflow:auto;min-height:60px}#chess-chat-log p{white-space:pre-wrap;border-left:2px solid #c6aa6b;padding:8px 12px;background:#1c3026}
#chess-talk{display:grid;gap:10px}#chess-message{width:100%;min-height:80px;resize:vertical}#chess-notice{color:#e1bd6e;white-space:pre-wrap}#chess-pgn,#nook-chess a{color:#e1bd6e}#chess-promotion{padding:12px;border:1px solid #c6aa6b}#chess-promotion button{margin:4px}
@media(max-width:720px){#nook-chess{padding:16px}.chess-layout{grid-template-columns:1fr}.chess-controls label{flex:1 1 120px}.chess-controls #chess-history{max-width:100%}}
