.ladder-room{--ladder-ink:#3b4b50;--ladder-a:#477a82;--ladder-b:#a16e47;--ladder-stone:#eeece2;width:100%;max-width:1280px;margin:auto;color:var(--ladder-ink)}
.game-shell.wide:has(.ladder-room) .play{width:100%;margin:0 auto;align-self:start}
.game-shell .play .ladder-room .session-banner{max-width:none;margin:0 0 1rem;text-align:left}
.game-shell.wide .play .ladder-room h2{font-size:clamp(1.6rem,2.3vw,2.55rem);text-align:left;line-height:1.25}
.game-shell.wide .play .ladder-room .session-banner .meta{margin-inline:0;text-align:left}
.game-shell .play .ladder-room p{text-align:left;line-height:1.5}
.game-shell .play .ladder-room button{min-height:44px;white-space:normal}
.ladder-room .actions{justify-content:flex-start}
.ladder-desk{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,1fr);gap:2rem;align-items:start}
.ladder-plan{width:min(100%,650px);text-align:left}
.ladder-board{display:grid;grid-template-columns:26px repeat(5,minmax(0,1fr));grid-template-rows:26px repeat(5,minmax(0,1fr));gap:5px;aspect-ratio:1;width:100%;padding:0;background:#d8dbd1;border:1px solid #aab4a8;box-shadow:4px 5px 0 #dfe1d7}
.ladder-corner,.ladder-axis{display:grid;place-items:center;font:.85rem ui-monospace,monospace;color:#637468;background:#e7e9df}
.game-shell .play .ladder-room .ladder-cell{position:relative;display:grid;place-items:center;min-height:44px;min-width:0;aspect-ratio:1;padding:0;border:1px solid #c7cabc;border-radius:1px;background:#f5f3e8;color:#3b4b50;box-shadow:none;overflow:hidden}
.ladder-coordinate{position:absolute;top:4px;left:5px;font:.68rem ui-monospace,monospace;color:#7c8677;z-index:4}
.game-shell .play .ladder-room .ladder-cell[data-ladder-goal="0"]{border-bottom:4px solid #82a9aa}
.game-shell .play .ladder-room .ladder-cell[data-ladder-goal="1"]{border-top:4px solid #bb987a}
.game-shell .play .ladder-room .ladder-cell:disabled{opacity:1;cursor:default}
.game-shell .play .ladder-room .ladder-cell[data-ladder-legal-step=true]{background:#eef4e4;outline:1px solid #7c9b7c;outline-offset:-3px}
.ladder-step-dot{font:550 2rem ui-monospace,monospace;color:#76977b;z-index:1}
.ladder-pawn{display:grid;place-items:center;width:43%;aspect-ratio:1;border-radius:50%;border:2px solid #315e66;background:#477a82;color:#fff;box-shadow:0 3px 0 #395963;z-index:3}
.ladder-pawn b{font:750 clamp(1rem,2vw,1.65rem) ui-monospace,monospace}
.ladder-pawn-1{border-radius:3px;transform:rotate(45deg);background:#926240;border-color:#855c3a;box-shadow:2px 2px 0 #7c5c42}
.ladder-pawn-1 b{transform:rotate(-45deg)}
.ladder-ridge{width:44%;height:65%;border:1px solid #877e69;border-radius:1px;background:repeating-linear-gradient(90deg,#b2a991 0 4px,#d7cfb7 4px 7px,#8f8771 7px 8px);box-shadow:3px 3px 0 #c0bca8;z-index:2}
.ladder-route-a,.ladder-route-b{position:absolute;inset:0;opacity:0;pointer-events:none;z-index:0}
.ladder-route-a{background:repeating-linear-gradient(45deg,transparent 0 9px,#477a8266 10px 13px)}
.ladder-route-b{background:repeating-linear-gradient(-45deg,transparent 0 9px,#a16e4766 10px 13px)}
[data-ladder-route-a=true] .ladder-route-a,[data-ladder-route-b=true] .ladder-route-b{opacity:1}
.game-shell .play .ladder-room .ladder-cell[aria-pressed=true]{outline:3px dashed #626576;outline-offset:-5px;background:#f0edf1}
.ladder-ghost{display:grid;place-items:center;width:47%;aspect-ratio:1;border:2px dashed #737284;border-radius:50%;color:#626576;background:#faf8ee;font-size:1.5rem;z-index:3}
.ladder-ghost-fence{border-radius:2px}
.ladder-blocked-mark{font-size:1.1rem;color:#a97a60;z-index:2}
.ladder-goals{display:flex;justify-content:space-between;gap:1rem;margin:.8rem 0 .3rem;font-size:.8rem;color:#5c6e65}
.ladder-goals span:first-child{border-bottom:3px solid #82a9aa;padding-bottom:.25rem}.ladder-goals span:last-child{border-bottom:3px solid #bb987a;padding-bottom:.25rem}
.ladder-rail{min-width:0;text-align:left;padding:.2rem 0}
.ladder-stocks{display:flex;gap:1.4rem;flex-wrap:wrap;margin:0 0 1rem}
.ladder-stocks>div{display:flex;align-items:center;gap:.6rem;border-bottom:2px solid #bdc8b7;padding:.2rem 0 .5rem}
.ladder-stocks span{font-size:.9rem}.ladder-stocks strong{font:650 1.45rem ui-monospace,monospace}
.ladder-stocks i{display:block;width:11px;height:22px;background:repeating-linear-gradient(90deg,#aba28a 0 3px,#d2c8ae 3px 5px);border:1px solid #8f8670}
.ladder-modes{display:grid;grid-template-columns:1fr 1fr;gap:.6rem;margin:.5rem 0}
.game-shell .play .ladder-room .ladder-modes button{background:#f0f3e9;border:1px solid #b4c1ad;color:#4a645a;border-radius:3px;font-size:.95rem;box-shadow:none;padding:.6rem .5rem}
.game-shell .play .ladder-room .ladder-modes button[aria-pressed=true]{outline:2px solid #5c7e70;outline-offset:-2px;background:#e0eadd}
.ladder-modes button:disabled{opacity:.45}
.ladder-preview{min-height:66px;margin:.8rem 0;font-size:.95rem;line-height:1.5}
.ladder-preview>strong{font-weight:600}.game-shell .play .ladder-room [data-ladder-blocked]{font-size:.85rem;color:#99543f;margin:.35rem 0}
.ladder-preview-actions{display:flex;gap:.6rem;flex-wrap:wrap;margin:.6rem 0 1rem}
.ladder-preview-actions>button:first-child{flex:1}
[data-ladder-confirm]:disabled{opacity:.45}
.ladder-distances{border-top:1px solid #b9c5b1;padding-top:.5rem;margin:.8rem 0}
.game-shell .play .ladder-room .ladder-distances>p{font-size:.82rem;margin:.2rem 0 .6rem;color:#5c6e65}
.ladder-distances>div{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}
.ladder-distances article{display:flex;align-items:baseline;gap:.45rem;flex-wrap:wrap;padding:.65rem .8rem;background:#edf1e5;border-left:3px solid #7ca4a7;min-width:0}
.ladder-distances article:last-child{border-left-color:#b6916b}
.ladder-distances article>span{flex-basis:100%;font-size:.8rem;margin-bottom:.2rem}
.ladder-distances strong{font:600 1.3rem ui-monospace,monospace;overflow-wrap:anywhere}
.ladder-distances b{font-weight:400;color:#748171}
.ladder-rail>button{margin:.35rem .4rem .35rem 0}
.game-shell .play .ladder-room .ladder-small{font-size:.82rem;color:#5c6e65;margin:.6rem 0;line-height:1.5}
.ladder-route-legend{display:flex;gap:1.2rem;margin:.6rem 0;font-weight:650}.ladder-route-legend span:first-child{color:#477a82}.ladder-route-legend span:last-child{color:#a16e47}
.ladder-history-nav{display:flex;align-items:end;gap:.7rem;flex-wrap:wrap;margin:.8rem 0}
.ladder-history-nav>label{display:grid;gap:.25rem;flex:1;max-width:470px;min-width:170px;font-size:.8rem;text-align:left}
.ladder-history-nav select{width:100%;min-height:44px;padding:.45rem;font:inherit;color:#3b4b50;background:#f4f5eb;border:1px solid #b6c3ad;border-radius:3px}
.game-shell .play .ladder-room .ladder-record-status{font-size:1rem;font-weight:650;margin:.7rem 0}
.ladder-action-record{padding:.6rem 0;margin:.4rem 0;border-bottom:1px solid #b9c5b1;font-weight:650;overflow-wrap:anywhere}
.ladder-terminal{font-weight:650;color:#47766a}
@media(min-width:1000px) and (min-height:680px){.game-shell.wide .play .ladder-room .ladder-desk{grid-template-columns:minmax(0,min(650px,calc(100dvh - 215px))) minmax(320px,1fr)}.game-shell.wide .play .ladder-room .ladder-plan{width:min(100%,650px,calc(100dvh - 215px))}.game-shell.wide .play .ladder-room:is([data-ladder-phase=replay],[data-ladder-phase=result]) .ladder-plan{width:min(100%,650px,calc(100dvh - 300px))}.game-shell.wide .play .ladder-room:is([data-ladder-phase=replay],[data-ladder-phase=result]) .ladder-desk{grid-template-columns:minmax(0,min(650px,calc(100dvh - 300px))) minmax(320px,1fr)}}
@media(max-width:760px){.ladder-desk{grid-template-columns:1fr;gap:1.2rem}.ladder-board{grid-template-columns:20px repeat(5,minmax(44px,1fr));grid-template-rows:20px repeat(5,minmax(44px,1fr));gap:3px;max-width:100%}.ladder-axis{font-size:.8rem}.ladder-coordinate{top:3px;left:3px;font-size:.6rem}.ladder-pawn{width:46%;min-width:20px}.ladder-pawn b{font-size:1rem}.ladder-ghost{min-width:22px;font-size:1rem}.ladder-rail{padding:0}.ladder-goals{font-size:.75rem}.ladder-history-nav>label{order:-1;flex-basis:100%;max-width:none}.ladder-history-nav{gap:.5rem}.ladder-history-nav>button{flex:1}.ladder-distances strong{font-size:1.2rem}}
@media(max-width:380px){.ladder-board{grid-template-columns:18px repeat(5,minmax(44px,1fr));grid-template-rows:18px repeat(5,minmax(44px,1fr));gap:2px}.ladder-coordinate{font-size:.55rem;top:2px;left:2px}}
@media(prefers-reduced-motion:reduce){.ladder-room *{scroll-behavior:auto}}

.page-game .game-shell.theme-ladder:has(.ladder-room) {
  --ladder-stage:#f4f2e7;
  color:#29443c;background:radial-gradient(ellipse at top left,#fcf9ef,var(--ladder-stage) 75%);
}
.page-game .game-shell.theme-ladder:has(.ladder-room) .game-toolbar {
  color:#29443c;background:var(--ladder-stage);border-color:#b8bca9;
}
.page-game .game-shell.theme-ladder:has(.ladder-room) .game-toolbar .button {
  color:#29443c;background:#fbf8ec;border-color:#969f8c;
}
.ladder-room {--ladder-ink:#29443c;--ladder-a:#26608a;--ladder-b:#aa531f}
.game-shell .play .ladder-room .session-banner h2 {
  color:var(--ladder-ink);font-size:clamp(1.75rem,3.6vw,2.95rem);line-height:1.1;letter-spacing:-.025em;
}
.game-shell .play .ladder-room .session-banner .meta {color:#4f6659}
.ladder-board {
  background:linear-gradient(145deg,#ebe4cd,#c8c6ac);
  border:1px solid #7a846f;border-radius:6px;
  box-shadow:inset 0 1px 0 #fff9,0 4px 0 #98997e,0 9px 19px #46533a24;
}
.ladder-axis {color:#344e42;background:transparent;font-weight:650}
.ladder-corner {background:transparent}
.game-shell .play .ladder-room .ladder-cell {
  border-color:#b3a482;border-radius:4px;
  background:repeating-linear-gradient(125deg,#fff3 0 1px,transparent 1px 6px),linear-gradient(145deg,#f9f1dc,#efe2c4);
  box-shadow:inset 0 1px 0 #fff9,0 1px 0 #6d705a44;
}
.ladder-coordinate {color:#465848}
.game-shell .play .ladder-room .ladder-cell[data-ladder-goal="0"] {border-bottom-color:#34728a}
.game-shell .play .ladder-room .ladder-cell[data-ladder-goal="1"] {border-top-color:#a36d31}
.game-shell .play .ladder-room .ladder-cell[data-ladder-legal-step=true] {background:#eaf0d9;outline-color:#64875e}
.game-shell .play .ladder-room .ladder-cell[aria-pressed=true] {outline-color:#a35d15;background:#ffebc4}
.game-shell .play .ladder-room .ladder-cell:focus-visible {outline:3px solid #3a6574;outline-offset:-3px}
.game-shell .play .ladder-room .ladder-cell[aria-pressed=true]:focus-visible {
  outline:3px dashed #a35d15;outline-offset:-5px;box-shadow:inset 0 0 0 2px #365665;
}
.ladder-pawn {
  background:radial-gradient(circle at 28% 15%,#578caa,#225579 70%);
  border-color:#254a65;box-shadow:inset 0 1px 0 #dcedff80,0 3px 1px #26364157;
}
.ladder-pawn-1 {
  background:radial-gradient(circle at 27% 18%,#d08343,#9b4a1c 76%);
  border-color:#854415;box-shadow:inset 0 1px 0 #ffcf9f78,2px 2px 1px #56372060;
}
.ladder-ridge,.ladder-ghost-fence {
  border:2px solid #956028;border-radius:3px;
  background:repeating-linear-gradient(135deg,#99612b 0 4px,#f8deb0 4px 8px);
  box-shadow:inset 0 0 0 1px #ffdd9f,0 2px 0 #835f3760;
}
.ladder-ghost-fence {color:#714619;text-shadow:0 1px #fff3d6;background:repeating-linear-gradient(135deg,#ca9a61 0 4px,#ffefca 4px 8px)}
.game-shell .play .ladder-room .ladder-preview {min-height:2.4em}
.ladder-distances article {background:#e5ecd8;border-color:#357287;color:#2b463a}
.ladder-distances article:last-child {background:#f1e5ce;border-color:#aa632e}
.ladder-distances strong {font-size:clamp(1.15rem,3vw,1.9rem)}
.page-game .game-shell .play .ladder-room .button[data-ladder-confirm] {background:#355c4b;color:white;border-color:#355c4b}
.page-game .game-shell .play .ladder-room .button.secondary {
  background:#fbf8ec;color:#29443c;border-color:#969f8c;
}
@media(max-width:760px) {
  .ladder-plan {width:min(100%,520px);margin-inline:auto}
  .ladder-desk {gap:1rem}
}
@media(max-width:350px) {
  .ladder-board {
    grid-template-columns:14px repeat(5,minmax(44px,1fr));
    grid-template-rows:14px repeat(5,minmax(44px,1fr));
  }
}
