.path-game{--pg-ink:#254c49;--pg-wood:#bb9760;--pg-snow:#e3ece8;--pg-red:#98473f;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(4px,.9vh,10px);color:var(--pg-ink);width:100%;margin:auto;line-height:1.16;font-family:var(--text,Neucha,sans-serif)}
.path-game button{touch-action:manipulation;color:inherit;font-family:inherit}
.path-game :is(button,svg):focus-visible{outline:3px solid #296b80;outline-offset:1px}
.path-game .pg-actions,.path-game .pg-legend,.path-game .pg-choices{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:clamp(4px,.65vw,10px);margin:0}
.path-game .pg-arrows{display:grid;grid-template-columns:repeat(3,clamp(31px,3.4vw,48px));grid-template-rows:repeat(2,clamp(25px,3.7vh,39px));gap:2px}
.path-game .pg-dir,.path-game .pg-utility,.path-game .pg-pick{
 border:1px solid #b59460;border-radius:7px;background:linear-gradient(#fffaf0,#f3e5c9);box-shadow:inset 0 0 0 2px #fff9e5,0 1px 1px #8c765240;
 line-height:1.05;min-width:0;min-height:0;cursor:pointer;
}
.path-game .pg-dir{font:600 clamp(20px,2.6vh,26px)/1 system-ui,sans-serif;display:grid;place-items:center;padding:0}
.path-game .pg-up{grid-column:2;grid-row:1}.path-game .pg-left{grid-column:1;grid-row:2}.path-game .pg-down{grid-column:2;grid-row:2}.path-game .pg-right{grid-column:3;grid-row:2}
.path-game .pg-utility{padding:5px 12px;font-size:clamp(16px,1.4vw,21px)}.path-game .pg-utility:disabled{opacity:.55;cursor:default}
.path-game .pg-count{font-size:clamp(15px,1.4vw,20px);color:#635338}
.path-game .pg-maze-map{display:block;width:min(100%,calc(126svh - 192px));height:auto;max-width:100%;border:3px double #b39461;border-radius:8px;touch-action:manipulation;background:#f0f4ee;cursor:pointer}
.path-game .pg-trail{stroke:#9a503c;stroke-width:2.6;stroke-dasharray:2.2 4.5;fill:none;stroke-linecap:round;stroke-linejoin:round}
.path-game .pg-next{fill:#688b97;stroke:#fff6dc;stroke-width:1.1;opacity:.82;pointer-events:none}
.path-game .pg-position{pointer-events:none}
.path-game .pg-field{display:grid;grid-template-columns:repeat(var(--pg-cols),minmax(0,1fr));grid-template-rows:repeat(var(--pg-rows),minmax(0,1fr));height:auto;aspect-ratio:var(--pg-cols)/var(--pg-rows);padding:clamp(3px,.48vw,7px);border:4px double #a78457;border-radius:8px;background:linear-gradient(125deg,#c5d9d9,#cbdcd8 49%,#dfddd0);box-shadow:0 2px 3px #6b5e492d}
.path-game.pg-guide .pg-field{width:min(100%,calc(125svh - 268px),820px)}
.path-game.pg-stars .pg-field{width:min(100%,calc(116svh - 180px),790px)}
.path-game .pg-cell{appearance:none;position:relative;display:grid;place-items:center;cursor:pointer;border:1px solid #acc3bf;border-radius:5px;margin:0;padding:3px;background:radial-gradient(ellipse at top left,#fdf9ec 15%,#f4f5ee 55%,#d8e9e8);min-width:0;min-height:0}
.path-game .pg-cell:nth-child(2n){background:radial-gradient(ellipse at top left,#faf5e5 5%,#f4efe0 57%,#e4e5d6)}
.path-game .pg-cell img{position:absolute;left:15%;top:9%;width:70%;height:82%;object-fit:contain;user-select:none;pointer-events:none}
.path-game .pg-cell.pg-blocked{background:linear-gradient(120deg,#d7dacf,#c6d0cb)}
.path-game .pg-ice{font:bold clamp(17px,3vw,37px)/1 Georgia,serif;color:#b9d1d0}
.path-game .pg-cell.pg-walked{box-shadow:inset 0 0 0 2px #9d915d;background-color:#e6bd79}
.path-game .pg-cell.pg-walked:not(.pg-here)::after{content:'';position:absolute;left:9%;bottom:8%;width:clamp(4px,.7vw,9px);height:clamp(4px,.7vw,9px);border-radius:50%;background:#905e42;outline:1px solid #fff8df}
.path-game .pg-cell.pg-here{box-shadow:inset 0 0 0 3px #915444;background:radial-gradient(#fff5c6,#ffebbb 60%,#e6dcb8)}
.path-game .pg-cell.pg-here[data-occupied="1"] img:first-child{left:45%;top:13%;width:52%;height:70%}
.path-game .pg-cell img.pg-hero{width:75%;height:95%;left:12%;top:2%;filter:drop-shadow(0 2px 1px #5a5e4d45)}
.path-game .pg-cell.pg-here[data-occupied="1"] .pg-hero{width:57%;left:1%;height:80%;top:16%}
.path-game .pg-token,.path-game .pg-times{display:grid;place-items:center;border-radius:20%;height:clamp(24px,3.6vh,40px);min-width:clamp(24px,2.75vw,42px);font:600 clamp(18px,2.4vh,28px)/1 system-ui,sans-serif;color:#614b34}
.path-game .pg-token{border:1px solid #c3b087;background:#fbf1d8}
.path-game .pg-token.pg-spent{color:#40645b;background:#e2ebdd;border-color:#abc3b5}
.path-game .pg-token.pg-now{background:#fff2bd;outline:2px solid #925340}
.path-game .pg-gem{display:inline-flex;align-items:center;gap:3px;font-size:clamp(15px,1.35vw,20px)}
.path-game .pg-gem img{height:clamp(20px,3.4vh,38px);width:clamp(20px,2.6vw,38px);object-fit:contain}
.path-game .pg-pick{display:inline-flex;gap:3px;align-items:center;padding:3px 7px;font-size:clamp(15px,1.45vw,20px)}
.path-game .pg-pick img{height:clamp(18px,3.7vh,34px);width:clamp(18px,2.7vw,34px);object-fit:contain}
.path-game .pg-pick[aria-pressed="true"]{background:#e1eddf;outline:2px solid #537665;outline-offset:-2px}
@media(orientation:portrait){.path-game .pg-maze-map,.path-game.pg-guide .pg-field,.path-game.pg-stars .pg-field{width:min(100%,660px)}.path-game .pg-legend,.path-game .pg-choices{gap:3px}.path-game .pg-pick{font-size:15px;padding:3px}.path-game .pg-gem{font-size:14px}.path-game .pg-actions{gap:5px}}
@media(orientation:landscape) and (max-height:540px){
 .path-game .pg-actions{gap:4px}.path-game .pg-gem span{font-size:14px}.path-game .pg-arrows{grid-template-columns:repeat(3,30px);grid-template-rows:repeat(2,22px)}
 .path-game.pg-guide .pg-field{width:min(94%,calc(125svh - 210px))}.path-game .pg-token{min-width:22px;height:22px}
}
.path-game{max-height:calc(100cqh - 10px)}


/* The complete landscape, its character and its click targets scale as one piece. */
.path-game.pg-maze{
  --maze-controls:clamp(65px,11cqh,98px);
  width:100%;max-height:none;gap:clamp(4px,.65cqh,9px)
}
.path-game.pg-maze .pg-maze-map{
  box-sizing:border-box;flex:0 0 auto;aspect-ratio:4/3;height:auto;
  width:min(100%,calc((100cqh - var(--maze-controls) - 10px)*4/3));
  max-width:100%;border:0;border-radius:8px;overflow:hidden;
  outline:1px solid #aa8b65;outline-offset:-1px;
  box-shadow:0 3px 10px #4b593f26
}
@media (orientation:portrait){
  .path-game.pg-maze .pg-maze-map{width:100%}
}

/* The rule, controls and status have a dedicated side of the landscape board. */
.pg-sidebar{display:grid;align-content:center;justify-items:center;gap:clamp(5px,1.2cqh,15px);max-width:100%}
.pg-rule-title{color:#285443;font:normal clamp(18px,2.3cqh,28px)/1.2 var(--text)}
.pg-sidebar .pg-times{background:transparent;white-space:nowrap;font:normal clamp(15px,1.35vw,20px)/1.1 var(--text)}
.pg-stop-hand{position:absolute;right:-5%;top:-7%;z-index:4;display:grid;place-items:center;pointer-events:none;
 width:clamp(23px,4.1cqh,36px);aspect-ratio:1;border-radius:100%;background:#fff7dd;border:2px solid #ac473e;box-shadow:0 2px 3px #56322d77;font:clamp(18px,3cqh,29px)/1 system-ui}
.pg-stop-hand[hidden]{display:none!important}
.pg-field{position:relative}
@media(orientation:landscape) and (min-width:700px){
 #lesson #workshop .path-game.pg-stars{display:grid;grid-template-columns:minmax(0,1fr) clamp(150px,20cqw,250px);align-items:center;justify-content:center;gap:clamp(10px,2cqw,30px);
  width:min(100%,calc(118cqh + clamp(150px,20cqw,250px)));max-height:none;padding:6px;box-sizing:border-box}
 #lesson #workshop .path-game.pg-stars .pg-field{grid-column:1;grid-row:1;justify-self:end;width:min(100%,calc((100cqh - 24px)*1.16666));box-sizing:border-box}
 #lesson #workshop .pg-stars .pg-sidebar{grid-column:2;grid-row:1;justify-self:start;width:100%;padding:clamp(8px,2cqh,20px) 5px;box-sizing:border-box;
 border:1px solid #bea371;border-radius:13px;background:linear-gradient(135deg,#fff8e9f0,#f6ead4ed);box-shadow:0 2px 6px #82674629}
 .pg-sidebar .pg-legend,.pg-sidebar .pg-actions{display:flex;flex-direction:column;align-items:center}
 .pg-sidebar .pg-legend{align-items:flex-start}
 .pg-sidebar .pg-gem{display:grid;grid-template-columns:29px 1fr;text-align:left;gap:6px}
 .pg-sidebar .pg-gem img{height:28px;width:28px}
 .pg-sidebar .pg-actions{gap:clamp(4px,1cqh,10px)}
 .pg-sidebar .pg-count{white-space:nowrap;font-size:clamp(14px,1.3vw,19px)}
}
@media(orientation:landscape) and (max-height:550px) and (min-width:700px){
 .pg-sidebar{gap:3px}.pg-sidebar .pg-gem{font-size:14px}.pg-sidebar .pg-gem img{width:19px;height:19px}
 .pg-sidebar .pg-legend,.pg-sidebar .pg-actions{gap:2px}.pg-sidebar .pg-rule-title{font-size:16px}
}
@media(orientation:portrait),(max-width:699px){
 .pg-stars .pg-field{order:0}.pg-stars .pg-sidebar{order:1;gap:5px}.pg-sidebar .pg-rule-title{display:none}
}


/* Paint the confirmed arrows and mark the last correct cell during a detour.
   These effects are inset or absolutely positioned and never resize the grid. */
#lesson .pg-guide .pg-token.pg-spent{
  color:#fffdf2;background:linear-gradient(145deg,#347b51,#1e5a3e);
  border-color:#23503c;box-shadow:inset 0 0 0 1px #86a884;
}
#lesson .pg-guide .pg-cell.pg-anchor{
  outline:3px solid #2d744a;outline-offset:-4px;
}
#lesson .pg-guide .pg-cell.pg-anchor::before{
  content:'';position:absolute;z-index:1;right:7%;top:8%;
  width:clamp(16px,2.7vh,28px);height:clamp(16px,2.7vh,28px);border-radius:50%;
  background:
    radial-gradient(ellipse at 32% 36%,#fffbe9 0 12%,transparent 15%),
    radial-gradient(ellipse at 32% 61%,#fffbe9 0 7%,transparent 10%),
    radial-gradient(ellipse at 67% 46%,#fffbe9 0 12%,transparent 15%),
    radial-gradient(ellipse at 67% 71%,#fffbe9 0 7%,transparent 10%),#28683e;
  border:1px solid #f9f7df;pointer-events:none;
}
