/* Keep the document visible at all times. Animate only newly shown panels;
   full-page opacity and closing top-layer transitions can freeze in bfcache. */
.chess-app-trigger{display:inline-flex;align-items:center;justify-content:center;flex:none;gap:7px;min-width:44px;min-height:44px;padding:8px 11px;border:1px solid #b5c2ab50;border-radius:9px;background:#ffffff08;color:#eee9dc;font:650 12px/1.2 system-ui,sans-serif;cursor:pointer;text-decoration:none}
.chess-app-trigger:hover{background:#b5d69d16;border-color:#b5d69d}
.chess-app-trigger-icon{font-size:16px;line-height:1}
.chess-app-trigger:focus-visible,.chess-app-dialog a:focus-visible,.chess-app-dialog button:focus-visible{outline:3px solid #dec18c;outline-offset:3px}
.chess-app-dialog{box-sizing:border-box;position:fixed;inset:0;margin:auto;width:min(560px,calc(100% - 32px));max-width:none;max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;padding:22px;background:#1c2520;color:#f3eee1;border:1px solid #afba9d55;border-radius:18px;box-shadow:0 24px 80px #0009;font:14px/1.5 system-ui,sans-serif}
.chess-app-dialog *{box-sizing:border-box}
.chess-app-dialog:not([open]){display:none;pointer-events:none}
.chess-app-dialog[open]{animation:chess-app-menu-in 150ms ease-out}
.chess-app-dialog::backdrop{background:#080c09b8;backdrop-filter:blur(5px)}
.chess-app-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.chess-app-heading h2{margin:0;color:#f3eee1;font:500 29px/1.15 Georgia,serif}
.chess-app-close{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;min-height:44px;padding:7px;border:1px solid #ffffff24;border-radius:9px;background:#ffffff06;color:#e8e7da;font:17px/1 system-ui,sans-serif;cursor:pointer}
.chess-app-close:hover{background:#ffffff10}
.chess-app-destinations{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.chess-app-destination{display:flex;align-items:center;gap:11px;min-width:0;min-height:65px;padding:11px;border:1px solid #afba9d36;border-radius:10px;background:#ffffff04;color:#f3eee1;font:650 13px/1.4 system-ui,sans-serif;text-decoration:none}
.chess-app-destination:last-child{grid-column:1/-1}
.chess-app-destination:hover{background:#b5d69d12;border-color:#b5d69d99}
.chess-app-destination[aria-current=page]{background:#b5d69d18;border-color:#b5d69d80}
.chess-app-symbol{display:grid;place-items:center;flex:none;width:33px;height:33px;border:1px solid #dec18c40;border-radius:8px;background:#dec18c0c;color:#dec18c;font-size:23px;font-weight:400;line-height:1}
.chess-app-name{min-width:0;overflow-wrap:anywhere}
.chess-app-current{margin-left:auto;flex:none;color:#b5d69d;font-size:10px;font-weight:500}
.chess-app-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:14px;padding-top:10px;border-top:1px solid #ffffff1c}
.chess-app-resume{display:inline-flex;align-items:center;min-height:44px;padding:5px 2px;color:#dec18c;font-size:12px;font-weight:650;text-decoration:none}
.chess-app-resume:hover{text-decoration:underline}
.chess-app-clock-note{flex-basis:100%;margin:0;color:#c3cbbd;font-size:11px;line-height:1.5}
.chess-app-clock-note[hidden]{display:none}
body.chess-navigation-open{overflow:hidden}
@keyframes chess-app-menu-in{from{opacity:.7;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes chess-app-content-in{from{opacity:.55}to{opacity:1}}
.music-menu[open]>:not(summary),.lobby-disclosure[open]>:not(summary),.soundscape[open]>:not(summary){animation:chess-app-content-in 140ms ease-out}
@media(max-width:620px){
  .topbar .chess-app-trigger{width:44px;padding:8px}
  .topbar .chess-app-trigger-label{display:none}
  .chess-navigation-ready .app>.topbar{flex-wrap:wrap}
  .chess-navigation-ready .top-actions{min-width:0;flex-wrap:wrap;justify-content:flex-end;gap:4px}
  .chess-navigation-ready .top-actions>.icon-btn{box-sizing:border-box;flex:none;width:44px;min-width:44px;min-height:44px;padding:0}
  .chess-navigation-ready .topbar:has(>nav){height:auto;min-height:72px;flex-wrap:wrap;gap:6px 10px;padding-block:8px}
  .chess-navigation-ready .topbar>nav{display:flex;flex:1 1 225px;min-width:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px}
  .chess-navigation-ready .topbar>nav>a,.chess-navigation-ready .topbar>nav>button,.chess-navigation-ready .topbar>nav>details>summary{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;min-height:44px;padding:6px 8px;white-space:nowrap}
  .chess-navigation-ready .top-actions>.top-puzzles{display:none}
  .chess-app-dialog{inset:auto 8px max(8px,env(safe-area-inset-bottom));width:calc(100% - 16px);max-height:calc(100dvh - 24px);padding:18px;border-radius:16px}
  .chess-app-heading{margin-bottom:13px}
  .chess-app-heading h2{font-size:27px}
  .chess-app-destinations{grid-template-columns:1fr;gap:7px}
  .chess-app-destination{min-height:56px;padding:8px 11px}
}
@media(max-width:420px){
  .chess-navigation-ready .top-actions>#newGameTop{display:none}
  .chess-navigation-ready .topbar:has(>nav)>.brand{gap:7px}
  .chess-navigation-ready .topbar:has(>nav)>.brand small{display:none}
  .chess-navigation-ready .topbar:has(>nav) .brand-mark{width:32px;height:32px;font-size:24px}
}
@media(max-width:360px){
  .chess-navigation-ready .app>.topbar{padding-inline:0;gap:6px}
  .chess-navigation-ready .app>.topbar .hex-logo{width:30px;height:30px;font-size:20px}
}
@media(orientation:landscape) and (max-height:540px){
  .chess-app-dialog{inset:8px;margin:auto;width:min(560px,calc(100% - 24px));max-height:calc(100dvh - 16px);padding:13px 17px}
  .chess-app-heading{margin-bottom:9px}
  .chess-app-destinations{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .chess-app-destination{min-height:49px;padding:7px}
  .chess-app-footer{margin-top:9px;padding-top:4px}
}
@media(prefers-reduced-motion:reduce){
  .chess-app-dialog[open]{animation:none}
  .chess-app-dialog,.chess-app-dialog::backdrop{transition:none!important}
  .music-menu[open]>:not(summary),.lobby-disclosure[open]>:not(summary),.soundscape[open]>:not(summary){animation:none}
}
