/* The Lilac Longhall. The scene is a phone-sized board, not a background poster. */
*{box-sizing:border-box}
:root{color-scheme:light;--plum:#561c48;--pearl:#fff4ff;--lilac:#dfbfed}
body{margin:0;background:#2c192e;color:#43203d;font-family:system-ui,sans-serif}
main{max-width:none;margin:0;padding:0}
.hf-scene{--u:min(.2564102564vw,.1184834123svh);position:relative;width:calc(390 * var(--u));height:calc(844 * var(--u));margin:0 auto;isolation:isolate;background:#cfb1e5 url('../assets/play/hnefatafl/fjord.webp') center center/100% 100% no-repeat;box-shadow:0 0 90px #100b1799;overflow:hidden}
.hf-scene h1{position:absolute;z-index:2;inset:calc(7 * var(--u)) 0 auto;margin:0;width:100%;height:calc(104 * var(--u));font-size:0}
.hf-scene h1 img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 4px 3px #3f133b66)}
.sides{position:absolute;top:calc(116 * var(--u));left:calc(17 * var(--u));right:calc(17 * var(--u));display:flex;gap:calc(7 * var(--u));height:calc(47 * var(--u))}
button{font:700 calc(15 * var(--u))/1.1 Georgia,'Times New Roman',serif;cursor:pointer;color:var(--plum);border:0;min-width:0;min-height:0;transition:filter .12s,transform .12s;-webkit-tap-highlight-color:transparent}
.sides button,.actions button,#hf-over-btn{background:transparent url('../assets/play/hnefatafl/button-pearl.webp') center/100% 100% no-repeat;text-shadow:0 1px #fff9;filter:drop-shadow(0 3px 2px #47143f66)}
.sides button{flex:1;padding:0 calc(16 * var(--u));font-size:calc(14 * var(--u));white-space:nowrap}
.sides button[aria-pressed=true]{filter:brightness(1.12) drop-shadow(0 0 3px #fff);color:#451435}
.sides button[aria-pressed=false]{filter:brightness(.86);color:#57234f}
.turn-plaque{position:absolute;top:calc(172 * var(--u));left:calc(24 * var(--u));width:calc(342 * var(--u));height:calc(67 * var(--u));padding:calc(9 * var(--u)) calc(16 * var(--u)) calc(5 * var(--u));text-align:center;color:#fff4ff;background:transparent url('../assets/play/hnefatafl/button-plum.webp') center/100% 100% no-repeat;filter:drop-shadow(0 3px 2px #41123655)}
#hf-turn{display:block;font:900 calc(23 * var(--u))/1.12 Georgia,serif;letter-spacing:calc(.5 * var(--u));text-shadow:0 2px 2px #2d0626}
#hf-status{font:500 calc(10.5 * var(--u))/1.25 system-ui,sans-serif;margin:calc(3 * var(--u)) auto 0;max-width:calc(282 * var(--u));min-height:calc(26 * var(--u));color:#fff3ff;text-shadow:0 1px 1px #310c29}
.hud{position:absolute;z-index:3;top:calc(246 * var(--u));left:calc(44 * var(--u));width:calc(302 * var(--u));height:calc(32 * var(--u));display:flex;justify-content:center;align-items:stretch;background:linear-gradient(#fff1ff,#dbb7e5 65%,#b58abf);border:calc(2 * var(--u)) solid #fff0ff;border-radius:calc(18 * var(--u));box-shadow:0 2px 0 #794a76,0 4px 5px #59234c44;font-size:calc(11 * var(--u));overflow:hidden}
.hud>div{display:flex;align-items:center;justify-content:center;gap:calc(3 * var(--u));padding:0 calc(7 * var(--u));white-space:nowrap}
.hud>div+div{border-left:1px solid #95638d55}
.hud b{color:#4b183d;font-size:calc(13 * var(--u));font-variant-numeric:tabular-nums}
.hud .on{background:#fff5ff7a}
.sw{display:block;width:calc(18 * var(--u));height:calc(23 * var(--u));object-fit:contain}
.stage{position:absolute;top:calc(244 * var(--u));left:calc(6 * var(--u));width:calc(378 * var(--u));height:calc(402.3633 * var(--u))}
.board-frame{position:absolute;inset:0;display:block;width:100%;height:100%;z-index:2;pointer-events:none;filter:saturate(.82) brightness(.86) drop-shadow(0 4px 3px #44112f99)}
#hf-canvas{position:absolute;left:9.5703125%;top:15.04587156%;display:block;width:80.859375%;height:auto;touch-action:none;cursor:pointer;border-radius:1px;box-shadow:0 0 0 2px #4c1e47;background:#d9b9e7}
#hf-canvas:focus-visible{outline:3px solid #fff6ff;outline-offset:3px}
.actions{position:absolute;top:calc(652 * var(--u));left:calc(14 * var(--u));right:calc(14 * var(--u));display:flex;gap:calc(8 * var(--u));height:calc(61 * var(--u))}
.actions button{flex:1;font-size:calc(23 * var(--u));text-transform:uppercase;padding:0 calc(21 * var(--u));white-space:nowrap}
.actions #hf-new{font-size:calc(20 * var(--u))}
.toolbar{position:absolute;top:calc(720 * var(--u));left:calc(14 * var(--u));right:calc(14 * var(--u));display:flex;gap:calc(8 * var(--u));height:calc(45 * var(--u))}
.toolbar button{flex:1;background:transparent url('../assets/play/hnefatafl/button-plum.webp') center/100% 100% no-repeat;color:#fff2ff;font-size:calc(12 * var(--u));text-shadow:0 1px 1px #25051c;padding:0 calc(12 * var(--u));white-space:nowrap;filter:drop-shadow(0 3px 2px #42143866)}
button:disabled{filter:saturate(.35) brightness(.8);cursor:default}
button:focus-visible{outline:3px solid #fff;outline-offset:1px;border-radius:28px;box-shadow:0 0 0 5px #762868}
button:not(:disabled):active{transform:translateY(2px)}
@media(hover:hover){button:not(:disabled):hover{filter:brightness(1.12) drop-shadow(0 3px 2px #42143855)}}
#hf-over{position:absolute;z-index:3;left:9.5703125%;top:15.04587156%;width:80.859375%;height:75.96330275%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(18 * var(--u));padding:calc(24 * var(--u));background:#401135ed;border:calc(3 * var(--u)) solid #d5a8e7;color:#fff4ff;text-align:center;backdrop-filter:blur(2px);box-shadow:inset 0 0 40px #1e051a88}
#hf-over[hidden]{display:none}
#hf-over p{font:700 calc(21 * var(--u))/1.4 Georgia,serif;margin:0;color:inherit}
#hf-over-btn{width:calc(210 * var(--u));height:calc(58 * var(--u));font-size:calc(22 * var(--u));padding:0 calc(20 * var(--u))}
.hf-scene[data-result=win] #hf-over{background:#f6e8faed;color:#541c49;border-color:#fff}
.hf-scene[data-result=loss] #hf-turn{color:#f0c7f4}
.hf-guide{max-width:780px;padding:26px 22px 44px;margin:auto;background:#f5ebf8;line-height:1.6}
.hf-guide header{padding:0 0 18px;font-size:13px}
.hf-guide a{color:#6d295f;text-decoration:underline}
.hf-guide h2{font:700 25px/1.2 Georgia,serif;color:#5b224e;margin:22px 0 10px}
.hf-guide p{margin:12px 0}.hf-guide .intro{color:#62445f}
.legend{padding-left:21px}.legend li{margin:10px 0}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(prefers-reduced-motion:reduce){button{transition:none}}
