/* The chess table is part of Vesper's lounge, seen from the driver's chair. */
#gridlock-story-ui .story-chess,#gridlock-story-ui .story-chess *{box-sizing:border-box}
#gridlock-story-ui[data-story-screen="chess"] .story-main{padding:0;overflow:hidden;position:relative}
#gridlock-story-ui .story-chess{position:relative;width:100%;height:100%;min-height:280px;overflow:hidden;background:#151711;font-family:"Avenir Next","Segoe UI",sans-serif;color:#fff4d9}
#gridlock-story-ui .story-chess-scene,#gridlock-story-ui .story-chess-board-plane{position:absolute;left:50%;top:50%;width:min(100%,calc((100vh - 76px)*1.5988));height:auto;aspect-ratio:8/5;transform:translate(-50%,-50%)}
#gridlock-story-ui .story-chess-scene{pointer-events:none}
#gridlock-story-ui .story-chess-backdrop{display:block;width:100%;height:100%;object-fit:cover}
#gridlock-story-ui .story-chess-vesper{position:absolute;object-fit:contain;filter:drop-shadow(0 6px 8px #0003)}
#gridlock-story-ui .story-chess-board-plane{pointer-events:none}
#gridlock-story-ui .story-chess-board-frame{position:absolute;left:0;top:0;width:800px;height:800px;transform-origin:0 0;pointer-events:auto;border:14px solid #4a2b15;border-radius:7px;box-shadow:0 4px 0 #28170b,0 11px 16px #0008;background:#4a2b15}
#gridlock-story-ui .story-chess-board{width:100%;height:100%;display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr);border:3px solid #a98651;outline:1px solid #120d06}
#gridlock-story-ui button.story-chess-square{display:block;position:relative;padding:0;border:0;border-radius:0;box-shadow:none;transform:none;min-width:0;min-height:0;aspect-ratio:1;font:inherit;touch-action:manipulation;cursor:pointer;overflow:visible}
#gridlock-story-ui .story-chess-square.is-light{background:#d4bd8a}
#gridlock-story-ui .story-chess-square.is-dark{background:#526746}
#gridlock-story-ui .story-chess-square:after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(9deg,#fff1 0 1px,transparent 1px 11px);opacity:.3}
#gridlock-story-ui .story-chess-square.is-last{box-shadow:inset 0 0 0 6px #ead86f99}
#gridlock-story-ui .story-chess-square.is-selected{box-shadow:inset 0 0 0 6px #fff0a7}
#gridlock-story-ui .story-chess-square.is-legal:before{content:"";position:absolute;width:23%;height:23%;left:38.5%;top:38.5%;border-radius:50%;background:#163821a8;box-shadow:0 0 0 3px #f1e9bd80;z-index:1;pointer-events:none}
#gridlock-story-ui .story-chess-square.is-legal:has(.story-chess-piece):before{width:auto;height:auto;inset:6%;border:5px solid #f3e6a9;background:none;border-radius:50%;z-index:2}
#gridlock-story-ui .story-chess-square.is-check{background:#ad634e;box-shadow:inset 0 0 0 6px #ffb184}
#gridlock-story-ui .story-chess-square:focus-visible{outline:4px solid #fff9cc;outline-offset:-6px;z-index:4}
#gridlock-story-ui .story-chess-piece{display:block;position:absolute;inset:2%;background-image:url('/story/chess-pieces.webp');background-size:600% 200%;background-repeat:no-repeat;filter:drop-shadow(2px 5px 3px #0005);pointer-events:none;z-index:1}
#gridlock-story-ui .story-chess-coordinate{position:absolute;left:4px;bottom:1px;font-size:14px;font-weight:800;color:#203124aa;pointer-events:none;z-index:2}
#gridlock-story-ui .story-chess-square.is-dark .story-chess-coordinate{color:#fff1bccc}
#gridlock-story-ui .story-chess-heading{position:absolute;z-index:2;left:24px;right:24px;top:16px;display:flex;justify-content:space-between;align-items:flex-start;pointer-events:none;text-shadow:0 2px 7px #000}
#gridlock-story-ui .story-chess-heading>div:first-child{padding:10px 15px;border-left:3px solid #c8dfb1;background:linear-gradient(90deg,#13251beb,transparent);border-radius:0 6px 6px 0}
#gridlock-story-ui .story-chess-heading span{font-size:10px;letter-spacing:.14em;font-weight:850;color:#bfd2ad}
#gridlock-story-ui .story-chess-heading h1{font-family:"Avenir Next","Segoe UI",sans-serif;font-size:clamp(17px,2vw,26px);font-weight:750;margin-top:3px}
#gridlock-story-ui .story-chess-cash{display:grid;padding:10px 14px;background:#14251ddb;border:1px solid #78927270;border-radius:7px;min-width:133px}
#gridlock-story-ui .story-chess-cash strong{font-size:24px;line-height:1.15;color:#ffe299}
#gridlock-story-ui .story-chess-cash small{font-size:11px;color:#cfdbc1}
#gridlock-story-ui .story-chess-speech{position:absolute;left:69%;top:24%;max-width:27%;border:1px solid #dccf9b;border-radius:19px 19px 19px 4px;padding:12px 15px;background:#fff8def2;color:#293729;font-size:14px;line-height:1.4;box-shadow:0 5px 24px #0002;z-index:2;pointer-events:none}
#gridlock-story-ui .story-chess-speech strong{font-size:11px;color:#56714b;display:block;margin-bottom:5px}
#gridlock-story-ui .story-chess-footer{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 22px;background:linear-gradient(0deg,#101d18f5,#101d18dc);border-top:1px solid #aec28a36;z-index:3}
#gridlock-story-ui .story-chess-turn{font-size:17px;color:#fff0b9}
#gridlock-story-ui .story-chess-footer p{font-size:11px;color:#c5cbbb;margin:3px 0 0}
#gridlock-story-ui .story-chess-last{color:#a9bb98!important}
#gridlock-story-ui .story-chess-actions{display:flex;gap:8px;flex:none}
#gridlock-story-ui .story-chess-actions button,#gridlock-story-ui .story-chess-prompt button,#gridlock-story-ui .story-chess-error button{border:1px solid #84987999;border-radius:6px;background:#233626ef;color:#fff2ce;min-height:38px;padding:8px 13px;font-size:13px;font-weight:750;box-shadow:none}
#gridlock-story-ui .story-chess-actions button:hover,#gridlock-story-ui .story-chess-prompt button:hover{background:#3b523c}
#gridlock-story-ui .story-chess-actions button:disabled{opacity:.5}
#gridlock-story-ui .story-chess-actions [data-chess-action="resign"]{background:#231e18bb;color:#cdccbc;font-size:11px}
#gridlock-story-ui .story-chess-prompt{position:absolute;inset:0;z-index:5;display:grid;place-items:center;background:#060f0dbd;padding:20px}
#gridlock-story-ui .story-chess-prompt[hidden],#gridlock-story-ui .story-chess-error[hidden]{display:none}
#gridlock-story-ui .story-chess-prompt>div{width:min(480px,100%);padding:27px;border-radius:18px;border:1px solid #899b77;background:#fff6da;color:#273a29;box-shadow:0 20px 70px #0008}
#gridlock-story-ui .story-chess-prompt h2{font:800 22px "Avenir Next",sans-serif;margin:0 0 11px}
#gridlock-story-ui .story-chess-prompt p{font-size:14px;line-height:1.5;margin-bottom:20px}
#gridlock-story-ui .story-chess-prompt>div>div{display:flex;flex-wrap:wrap;gap:10px}
#gridlock-story-ui .story-chess-promotion-choices{margin-bottom:16px}
#gridlock-story-ui .story-chess-error{position:absolute;z-index:4;left:50%;top:20%;transform:translateX(-50%);max-width:460px;width:calc(100% - 32px);background:#3d2b1ff5;border:1px solid #cfa776;border-radius:12px;padding:16px;box-shadow:0 10px 40px #0008}
#gridlock-story-ui .story-chess-error p{margin-bottom:12px;font-size:14px}
@media(max-width:700px){
 #gridlock-story-ui .story-chess-heading{left:10px;right:10px;top:10px}.story-chess-heading h1{font-size:16px}
 #gridlock-story-ui .story-chess-heading>div:first-child{padding:6px 9px}#gridlock-story-ui .story-chess-cash{padding:6px 10px;min-width:100px}#gridlock-story-ui .story-chess-cash strong{font-size:19px}
 #gridlock-story-ui .story-chess-board-plane{width:100%;height:100%;aspect-ratio:auto!important;transform:none;left:0;top:0}
 #gridlock-story-ui .story-chess-board-frame{width:min(92vw,calc(100vh - 330px));height:min(92vw,calc(100vh - 330px));left:50%;top:auto;bottom:108px;transform:translateX(-50%)!important;border-width:8px}
 #gridlock-story-ui .story-chess-speech{left:50%;top:74px;transform:translateX(-50%);max-width:none;width:min(320px,90%);padding:9px 12px;font-size:12px}
 #gridlock-story-ui .story-chess-speech strong{margin-bottom:2px}
 #gridlock-story-ui .story-chess-footer{padding:10px 12px;gap:8px}.story-chess-help span{display:none}
 #gridlock-story-ui .story-chess-turn{font-size:14px}#gridlock-story-ui .story-chess-actions{flex-direction:column;gap:4px}#gridlock-story-ui .story-chess-actions button{padding:5px 9px;min-height:32px;font-size:11px}
 #gridlock-story-ui .story-chess-coordinate{font-size:8px;left:2px}#gridlock-story-ui .story-chess-square.is-last,#gridlock-story-ui .story-chess-square.is-selected{box-shadow:inset 0 0 0 3px #e9d88c}
}
@media(max-height:550px) and (min-width:701px){#gridlock-story-ui .story-chess-heading{top:6px;left:12px;right:12px}#gridlock-story-ui .story-chess-heading h1{font-size:15px}#gridlock-story-ui .story-chess-heading>div:first-child{padding:5px 10px}#gridlock-story-ui .story-chess-cash{padding:5px 10px}#gridlock-story-ui .story-chess-cash strong{font-size:18px}#gridlock-story-ui .story-chess-speech{top:24%;padding:8px 11px;font-size:11px}#gridlock-story-ui .story-chess-footer{padding:7px 15px}#gridlock-story-ui .story-chess-last{display:none}}

#gridlock-story-ui .story-chess-credits{color:#a6b69a;font-size:10px;display:inline-block;text-underline-offset:2px;margin-top:3px}

#gridlock-story-ui .story-chess-piece-layer{position:absolute;inset:0;pointer-events:none;z-index:1}
#gridlock-story-ui .story-chess-piece-upright{inset:auto;pointer-events:none;transform:none;filter:drop-shadow(2px 4px 2px #0006)}
#gridlock-story-ui .story-chess[data-narrow="false"] .story-chess-square>.story-chess-piece{visibility:hidden}
#gridlock-story-ui .story-chess[data-narrow="true"] .story-chess-piece-layer{display:none}

#gridlock-story-ui .story-chess-speech[hidden]{display:none}
