:root{--game-vw:1dvw;--game-vh:1dvh;--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px);--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);font-family:Inter,"Segoe UI",sans-serif;color:#173d39;background:#eef2eb;font-synthesis:none;color-scheme:light}*{box-sizing:border-box}body{margin:0}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.4;cursor:default}button:focus-visible,a:focus-visible,[role=button]:focus-visible{outline:3px solid #e3a440;outline-offset:3px}button[hidden],[hidden]{display:none!important}.nardy-shell{height:calc(100 * var(--game-vh));min-height:360px;display:flex;flex-direction:column;padding:0 clamp(14px,calc(3 * var(--game-vw)),48px);max-width:1900px;margin:auto}.wp-topbar{height:70px;border-color:#d7e1d6}.wp-topbar h1{font-size:22px;font-weight:600;letter-spacing:-.6px;margin:0}.wp-tools{gap:8px}.wp-language{margin-right:18px}.wp-icon{font-weight:600;font-size:21px}.wp-icon[aria-pressed=true]{background:#b9d7c9}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:clamp(20px,calc(3 * var(--game-vw)),44px);flex:1;min-height:0;padding:26px 0 10px}.table-area{min-width:0;min-height:0;display:flex;flex-direction:column;justify-content:center}.table-heading{display:flex;justify-content:space-between;gap:20px;align-items:center}.table-heading{margin-bottom:16px}.eyebrow{font-size:10px;letter-spacing:2px;font-weight:700;color:#6f8273}.table-heading #mode-label{font-size:12px;color:#758273}.board-wrap{min-height:0;flex:1;display:flex;align-items:center;justify-content:center;filter:drop-shadow(0 16px 20px #14231920)}#board{width:100%;height:100%;max-height:calc(76 * var(--game-vh));display:block;touch-action:none;user-select:none}.side-panel{display:flex;flex-direction:column;align-self:center;max-height:100%;min-height:0;padding:24px;background:#f9faf5;border:1px solid #dbe4d7;border-radius:22px;box-shadow:0 10px 40px #20442e06}.turn-heading{display:flex;justify-content:space-between;align-items:center}#turn-number{font-size:15px;font-variant-numeric:tabular-nums;color:#7a8d7a}.side-panel h2{font-size:24px;letter-spacing:-.8px;font-weight:600;margin:10px 0 22px}.players{display:flex;flex-direction:column;gap:8px}.player-card{display:flex;gap:12px;align-items:center;padding:12px 9px;border:1px solid transparent;border-radius:12px;background:#eff2e9;transition:background .2s}.player-card.active{border-color:#8fb39a;background:#e4eddf}.player-card strong{font-size:13px;display:block}.player-card div>span{font-size:10px;color:#82917d;display:block;margin-top:5px}.player-card>b{margin-left:auto;font-size:20px;font-weight:500}.player-card small{font-size:10px;color:#8d9989}.checker{display:block;width:30px;height:30px;flex-shrink:0;border-radius:50%;box-shadow:0 2px 3px #0004,inset 0 0 0 3px #ffffff24}.ivory{background:radial-gradient(circle at 35% 22%,#fffbeb,#e1cda4 65%,#a98a57);border:1px solid #d7bc8c}.dark{background:radial-gradient(circle at 35% 22%,#526c5c,#183a30 60%,#0b211b);border:1px solid #55705a}.roll-area{margin:20px 0 8px}.dice{display:flex;gap:12px;justify-content:center;min-height:50px}.die{display:block;width:50px;height:50px;border-radius:12px;background:#fffdf3;box-shadow:0 3px 0 #cec6b2,0 6px 12px #4a331414;overflow:hidden;border:1px solid #e4ddca;color:#244c40}.die svg{width:100%;height:100%}.die.used{opacity:.35}.remaining{display:flex;justify-content:center;gap:6px;min-height:20px;margin-top:14px}.remaining span{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#dce7d6;color:#3d6650;font-size:10px}.remaining span.empty{background:#e8ece1;color:#a2ad9a}#status{min-height:44px;margin:8px 0 15px;font-size:12px;line-height:1.5;color:#6c7f6c;text-align:center}.primary-button,.outline-button{min-height:44px;border-radius:11px;padding:11px 16px;border:1px solid #ccd9c7;font-size:12px;font-weight:600;transition:background .15s,transform .15s}.primary-button{background:#24513e;color:#fff9e8;border-color:#24513e;box-shadow:0 4px 8px #21442f12}.primary-button:hover:not(:disabled){background:#173e2e;transform:translateY(-1px)}.outline-button{background:transparent;color:#43634c}.outline-button:hover:not(:disabled){background:#e9efdf}.secondary-controls{display:flex;gap:8px;margin-top:10px}.secondary-controls button{flex:1;padding:8px 3px;font-size:11px}.text-button{border:0;background:transparent;color:#82907a;font-size:11px;padding:14px 5px}.text-button:hover{color:#214c38}.match-score{text-align:center;font-size:10px;color:#98a48f;letter-spacing:.3px}.wp-save-note{margin:4px 0 8px;color:#91a28e;font-size:10px}.wp-footer{min-height:36px;padding:6px 0 max(6px,var(--safe-bottom));border-color:#d8e2d5}.point-hit{fill:transparent;cursor:pointer}.point-hit:hover{fill:#ffffff0b}.point-hit:focus-visible{outline:none;stroke:#f9cf7d;stroke-width:3}.piece{pointer-events:none}.point-halo{fill:#edc66f25;stroke:#f3ca75;stroke-width:2;stroke-dasharray:5 4;pointer-events:none}.selected-ring{fill:none;stroke:#fff2b5;stroke-width:4}.target-ring{fill:#acd9a241;stroke:#daefb1;stroke-width:3}.board-count{font-family:Inter,"Segoe UI",sans-serif;font-size:17px;font-weight:700;pointer-events:none}.board-num{font:12px Inter,"Segoe UI",sans-serif;fill:#f6e6bf80}.board-caption{font:11px Inter,"Segoe UI",sans-serif;letter-spacing:3px;fill:#f0dbab55}.board-emblem{font-family:Georgia,serif;fill:#ebd2a16b}.last-dot{fill:#e9cc7b}.roll-area.rolling .die{animation:toss .24s ease-in-out 2}@keyframes toss{50%{transform:rotate(14deg) translateY(-8px)}}dialog{color:#173d39;background:#f5f7ed;border:1px solid #dbe3cf;border-radius:22px;max-width:min(520px,calc(100 * var(--game-vw) - 28px));width:480px;--dialog-height:calc(90 * var(--game-vh));--dialog-pad:34px;max-height:var(--dialog-height);padding:0;overflow:hidden;box-shadow:0 30px 120px #102e3270}dialog::backdrop{background:#0f2c267a;backdrop-filter:blur(6px)}dialog h2{font-size:28px;font-weight:600;letter-spacing:-.8px;margin:12px 0 18px}dialog p,dialog li{font-size:13px;line-height:1.65;color:#6c7e69}dialog ul{padding-left:20px}dialog li{margin-bottom:10px}.dialog-close{position:absolute;inset-inline-end:12px;top:12px;z-index:2;display:grid;place-items:center;flex:none;appearance:none;padding:0;margin:0;border:1px solid #dce4d3;background:#eaf0e2;color:#4c6b4c;border-radius:50%;width:40px;height:40px;min-width:40px;min-height:40px;line-height:1}.dialog-close svg{display:block;width:20px;height:20px;pointer-events:none}.dialog-close:hover{background:#dfe9d5}.dialog-body{max-height:calc(var(--dialog-height) - 2px);overflow-y:auto;overscroll-behavior:contain;padding:var(--dialog-pad)}dialog:not(.result-dialog) .dialog-body>:is(.eyebrow,h2){display:block;padding-inline-end:42px}.mode-choices{display:grid;gap:10px;margin-top:22px}.mode-choice{text-align:left;padding:20px;border:1px solid #c8d8bf;background:#e9efdf;border-radius:12px;color:#315740}.mode-choice:hover{background:#dfead4}.mode-choice strong{font-size:16px;display:block}.mode-choice span{display:block;font-size:11px;margin-top:6px;color:#7b8d70}.dialog-body>.primary-button{width:100%;margin-top:14px}.game-focused .nardy-shell{padding:0 max(8px,var(--safe-right)) 0 max(8px,var(--safe-left))}.game-focused .wp-topbar{height:48px;min-height:0}.game-focused .wp-footer,.game-focused .wp-save-note{display:none}.game-focused .game-layout{padding:8px 0}

@media(orientation:landscape) and (max-width:1100px),(orientation:portrait) and (max-height:1100px),(min-width:901px) and (max-width:1100px){.game-layout{grid-template-columns:minmax(0,1fr) 220px;gap:18px}.side-panel{padding:18px}.wp-topbar h1{font-size:18px}}
@media(orientation:landscape) and (max-height:600px),(orientation:portrait) and (max-width:600px){.nardy-shell{min-height:0;padding:0 max(12px,var(--safe-left)) 0 max(12px,var(--safe-right))}.wp-topbar{height:48px;min-height:0}.wp-topbar .wp-brand{font-size:15px}.wp-topbar .brand-icon{width:26px!important;height:26px!important;font-size:20px!important}.wp-topbar h1{font-size:16px}.wp-topbar .wp-icon{min-width:38px;min-height:38px;width:38px;height:38px;border-radius:9px}.wp-language{margin-right:16px}.wp-language button{min-height:38px}.game-layout{grid-template-columns:minmax(0,1fr) 190px;gap:12px;padding:8px 0 2px}.table-heading{margin:0 0 3px}.table-heading .eyebrow{font-size:8px;letter-spacing:1.4px}.table-heading #mode-label{font-size:9px}.side-panel{padding:10px 12px;border-radius:14px;align-self:stretch;justify-content:safe center}.side-panel h2{font-size:18px;margin:3px 0 8px}.turn-heading .eyebrow{font-size:8px}.turn-heading #turn-number{font-size:11px}.players{flex-direction:row;gap:5px}.player-card{padding:6px;gap:5px;flex:1;min-width:0;flex-wrap:wrap;border-radius:8px}.player-card .checker{width:18px;height:18px}.player-card strong{font-size:9px}.player-card div>span{display:none}.player-card>b{font-size:14px}.player-card small{font-size:8px}.roll-area{margin:9px 0 1px}.dice{gap:10px;min-height:32px}.die{width:32px;height:32px;border-radius:8px}.remaining{min-height:12px;margin-top:7px;gap:4px}.remaining span{width:12px;height:12px;font-size:8px}#status{font-size:10px;line-height:1.3;min-height:26px;margin:5px 0}.primary-button,.outline-button{min-height:35px;padding:7px;font-size:11px}.secondary-controls{margin-top:5px;gap:5px}.secondary-controls button{font-size:9px;min-height:32px}.text-button{padding:6px;font-size:10px}.match-score{font-size:8px}.wp-save-note{font-size:8px;margin:3px 0}.wp-footer{font-size:8px;min-height:22px;padding:2px 0}.wp-footer button{padding:2px}.table-area{justify-content:stretch}#board{max-height:none}dialog{--dialog-pad:22px;--dialog-height:calc(94 * var(--game-vh))}dialog h2{font-size:22px;margin:8px 0}.mode-choices{grid-template-columns:1fr 1fr;margin-top:10px}.mode-choice{padding:13px}.mode-choice strong{font-size:13px}.mode-choice span{font-size:10px}}
@media(orientation:landscape) and (max-height:390px),(orientation:portrait) and (max-width:390px){.wp-save-note,.wp-footer,.table-heading{display:none}.wp-topbar{height:42px}.side-panel h2{font-size:15px;margin-bottom:5px}.game-layout{grid-template-columns:minmax(0,1fr) 170px}.side-panel{padding:7px 9px}.turn-heading{display:none}.match-score{display:none}.wp-topbar h1{font-size:14px}.wp-language{margin-right:12px}.wp-tools{gap:5px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
.side-panel>*{flex-shrink:0}.side-panel{padding-top:20px;padding-bottom:20px}.side-panel h2{margin-bottom:16px}.roll-area{margin-top:16px}.match-score{margin-top:2px}
@media(orientation:landscape) and (min-height:601px),(orientation:portrait) and (min-width:601px){.side-panel .player-card{padding-top:10px;padding-bottom:10px}.side-panel h2{margin-bottom:12px}.roll-area{margin-top:10px}#status{margin-top:5px;margin-bottom:10px}.side-panel>.text-button{padding-top:10px;padding-bottom:10px}}
.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}.game-options{display:flex;align-items:center;gap:8px;justify-content:space-between;margin-top:3px}.game-options .text-button{font-size:10px;padding:10px 0;text-align:left}.game-options label{min-width:0}.game-options select,.new-difficulty select{color:#395c43;background:#e8efdf;border:1px solid #cbd9c2;border-radius:8px;font:inherit;font-size:11px;min-height:32px;max-width:100%;padding:5px 6px;cursor:pointer}.new-difficulty{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#6b7e63;font-size:12px;margin:16px 0}.new-difficulty select{min-width:130px}.game-options select:focus-visible{outline:3px solid #d9b36b;outline-offset:2px}
@media(orientation:landscape) and (max-height:600px),(orientation:portrait) and (max-width:600px){.game-options{gap:4px;margin-top:0}.game-options .text-button{font-size:9px;padding:7px 0}.game-options select{font-size:9px;padding:3px;min-height:28px;max-width:80px}.new-difficulty{margin:6px 0}.new-difficulty select{min-height:30px}}
@media(orientation:landscape) and (max-height:600px),(orientation:portrait) and (max-width:600px){.side-panel{padding:8px 10px}.side-panel h2{margin-bottom:6px}.roll-area{margin-top:7px}.player-card{display:grid;grid-template-columns:18px 1fr;gap:4px}.player-card>b{grid-column:2;margin:0}.player-card strong{white-space:nowrap;font-size:8px}}

.result-dialog{width:460px;text-align:center;--dialog-pad:26px 32px 30px;background:radial-gradient(ellipse at top,#fff7d9 0,#f5f7ed 58%)}.result-badge{width:84px;height:84px;margin:0 auto 14px;color:#ab8237}.result-badge svg{width:100%;height:100%}.result-dialog h2{font-size:32px;margin:10px 0}.result-dialog p{margin:0 auto 12px;max-width:330px}.result-award{display:inline-block;padding:7px 14px;border-radius:20px;background:#e8e4c6;color:#76632d;font-size:12px;font-weight:600}.result-scores{margin:20px 0}.result-scoreboard{display:flex;justify-content:center;align-items:center;gap:20px;margin-top:8px}.result-scoreboard>div{min-width:100px;padding:9px;border-radius:12px;background:#e9eedf}.result-scoreboard>div.winner{background:#d9e7ce;border:1px solid #a6bd94}.result-scoreboard span{display:block;font-size:12px;color:#6d8065}.result-scoreboard strong{display:block;font-size:30px;font-weight:600;margin-top:3px}.result-colon{font-size:22px!important}.result-actions{display:flex;gap:10px}.result-actions button{flex:1}.result-dialog[data-outcome=loss]{background:#f5f7ed}.result-dialog[data-outcome=loss] .result-badge{color:#6d8974}.result-dialog[open] .result-badge{animation:result-arrive .45s ease-out}@keyframes result-arrive{from{transform:translateY(8px) scale(.8);opacity:0}to{transform:none;opacity:1}}
@media(orientation:landscape) and (max-height:600px),(orientation:portrait) and (max-width:600px){.result-dialog{width:490px;--dialog-pad:16px 24px}.result-badge{width:48px;height:48px;margin-bottom:6px}.result-dialog h2{font-size:25px;margin:5px 0}.result-dialog p{font-size:11px;line-height:1.4;margin-bottom:8px;max-width:380px}.result-award{font-size:10px;padding:5px 12px}.result-scores{margin:10px 0}.result-scoreboard{margin-top:5px;gap:14px}.result-scoreboard>div{padding:5px 12px;display:flex;align-items:center;gap:14px;justify-content:space-between;min-width:120px}.result-scoreboard strong{font-size:22px;margin:0}.result-scoreboard span{font-size:10px}.result-actions button{min-height:38px}}

/* Keep icons geometrically centered regardless of font, flex width or zoom. */
.wp-topbar :is(.wp-brand,.wp-tools,.wp-language,.wp-icon,.brand-icon){flex-shrink:0}.wp-topbar h1{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-icon{appearance:none;line-height:1}.wp-icon svg{flex:none;pointer-events:none}.die{flex-shrink:0}.die svg{display:block}.result-badge{flex-shrink:0}.result-badge svg{display:block}.result-actions button{min-width:0}

/* Scrollable rules retain a clear lane below the fixed close control. */
#help-dialog .dialog-body{padding-inline-end:64px}
.dialog-body,.side-panel{scrollbar-width:thin;scrollbar-color:#8fa58a transparent}
.dialog-body::-webkit-scrollbar,.side-panel::-webkit-scrollbar{width:7px;height:7px}
.dialog-body::-webkit-scrollbar-track,.side-panel::-webkit-scrollbar-track{background:transparent;margin-block:14px}
.dialog-body::-webkit-scrollbar-thumb,.side-panel::-webkit-scrollbar-thumb{background:#8fa58a;border:2px solid #f5f7ed;border-radius:10px}
.dialog-body::-webkit-scrollbar-thumb:hover,.side-panel::-webkit-scrollbar-thumb:hover{background:#647f61}
.dialog-body::-webkit-scrollbar-button,.side-panel::-webkit-scrollbar-button{display:none;width:0;height:0}
.dialog-body::-webkit-scrollbar-corner,.side-panel::-webkit-scrollbar-corner{background:transparent}

/* Virtual landscape: rotate only the page, without device orientation APIs.
   Viewport units and safe-area edges follow the same clockwise quarter turn.
   Native modal dialogs live in the top layer, so they rotate independently. */
@media(orientation:portrait) and (max-width:900px){
 :root{--game-vw:1dvh;--game-vh:1dvw;--safe-left:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-bottom,0px);--safe-top:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-left,0px)}
 html,body{width:100%;height:100%;overflow:hidden}
 .nardy-shell{position:fixed;left:100dvw;top:0;width:100dvh;height:100dvw;max-width:none;min-height:0;margin:0;transform-origin:top left;transform:rotate(90deg)}
 dialog{position:fixed;inset:50% auto auto 50%;margin:0;transform:translate(-50%,-50%) rotate(90deg)}
}
/* Keep browser chrome/notches outside controls in either orientation. */
@media(orientation:landscape) and (max-height:600px),(orientation:portrait) and (max-width:900px){
 .nardy-shell,.game-focused .nardy-shell{padding-inline-start:max(12px,var(--safe-left));padding-inline-end:max(12px,var(--safe-right));padding-top:var(--safe-top);padding-bottom:var(--safe-bottom)}
}

/* Very short screens keep every action reachable within the side panel. */
.side-panel{overflow-y:auto;overscroll-behavior:contain}
