/* Шини shares the local typefaces and restrained colors of Mentorio's games. */
body.sh-page{background:#f2f5fa;color:#0f1429}
.sh-page .zb-header{height:76px;background:#fff;border-bottom:1px solid #dce3ef}
.sh-brand{display:inline-flex;align-items:center;justify-content:center;gap:10px;color:#102440!important;font-size:29px;font-weight:900;line-height:1;white-space:nowrap}
.sh-brand-icon{display:grid;place-items:center;width:39px;height:42px;border-radius:9px;background:#102440;color:#fcd000;font-size:24px}
.sh-brand:hover{color:#39465a!important}
.sh-page .zb-header nav{gap:24px}

.sh-page .zb-home{min-height:44px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #fcd000;border-radius:6px;background:#fcd000}
.sh-page .zb-home:hover{background:#e6be00;border-color:#e6be00}
.sh-main{max-width:1160px;margin:32px auto 60px;padding:0 20px}
.sh-layout{display:grid;grid-template-columns:minmax(0,1.85fr) minmax(270px,1fr);align-items:start;gap:24px}
.sh-card{min-width:0;padding:24px;background:#fff;border:1px solid #dce3ef;border-radius:10px}
.sh-top{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;font-size:13px;color:#536477;font-variant-numeric:tabular-nums}
.sh-top strong{color:#0f1429}
.sh-grid-shell{display:grid;grid-template-columns:2rem minmax(0,1fr);grid-template-rows:2rem minmax(0,1fr);width:100%;max-width:600px;margin:20px auto 16px;gap:4px}
.sh-clue-corner{display:grid;place-items:center;color:#a3adba;font-size:12px}
.sh-col-clues{display:grid;grid-template-columns:repeat(var(--size,6),minmax(0,1fr));align-items:center;text-align:center}
.sh-row-clues{display:grid;grid-template-rows:repeat(var(--size,6),minmax(0,1fr));align-items:center;text-align:center}
.sh-col-clues>*:not(.zb-sr-only),.sh-row-clues>*:not(.zb-sr-only){display:grid;place-items:center;min-width:0;color:#536477;font-size:clamp(15px,2vw,21px);font-weight:900;line-height:1}
.sh-col-clues>.sh-clue,.sh-row-clues>.sh-clue{place-self:center;width:28px;height:28px;max-width:100%;border-radius:6px}
.sh-col-clues .complete,.sh-row-clues .complete,.sh-col-clues .correct,.sh-row-clues .correct{color:#126b37;background:#d9f3e3;box-shadow:inset 0 0 0 1px #79bc91}
.sh-col-clues .invalid,.sh-row-clues .invalid,.sh-col-clues .over,.sh-row-clues .over{color:#ad3038}
.sh-board{display:grid;grid-template-columns:repeat(var(--size,6),minmax(0,1fr));grid-template-rows:repeat(var(--size,6),minmax(0,1fr));position:relative;aspect-ratio:1;min-width:0;isolation:isolate;overflow:hidden;border:1px solid #aab7c9;border-radius:7px;background:#fff;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:none}
.sh-page button.sh-cell{--sh-track-bed:#fff;display:grid;place-items:center;position:relative;aspect-ratio:1;min-width:0;min-height:0;margin:0;padding:0;border:0;border-right:1px solid #dce3ef;border-bottom:1px solid #dce3ef;border-radius:0;background:var(--sh-track-bed);color:#697889;font-size:clamp(16px,3.5vw,31px);font-weight:800;line-height:1;box-shadow:none;touch-action:none}
.sh-page .sh-cell:nth-child(even){--sh-track-bed:#fafbfd}
.sh-page .sh-cell svg{display:block;width:100%;height:100%;overflow:visible;pointer-events:none}
.sh-page .sh-cell.track{--sh-track-bed:#f4f7fb}
.sh-page .sh-cell.empty{--sh-track-bed:#f8fafc;color:#9aa5b5}
.sh-page .sh-cell.fixed{--sh-track-bed:#fff8dc;cursor:default}
.sh-page .sh-cell.endpoint{--sh-track-bed:#fff1b1}
.sh-page .sh-cell.invalid{--sh-track-bed:#fff0f1;box-shadow:inset 0 0 0 2px #bc5361}
.sh-page .sh-cell:not(:disabled):hover{--sh-track-bed:#eaf0f7}
.sh-page .sh-cell:focus-visible{z-index:2;outline:3px solid #3f6297;outline-offset:-4px}
.sh-page .sh-cell:disabled{opacity:1;cursor:default}
.sh-station-label{position:absolute;z-index:3;inset:auto auto 3px 4px;display:grid;place-items:center;min-width:18px;height:18px;padding:0 3px;border-radius:4px;background:#102440;color:#fff;font-size:11px;font-weight:900;line-height:1;pointer-events:none}
.sh-fixed-icon{position:absolute;right:4px;top:4px;color:#877421;font-size:9px;pointer-events:none}
.sh-sleeper{stroke:#d3a76c;stroke-width:8;stroke-linecap:round}
.sh-rail-outline{fill:none;stroke:#102440;stroke-width:8;stroke-linecap:round;stroke-linejoin:round}
.sh-rail{fill:none;stroke:#536d8c;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.sh-board-caption{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;line-height:1.5}
.sh-board-caption>span{display:inline-flex;align-items:center;gap:6px;color:#66768a;font-size:11px}
.sh-page p.sh-message{min-height:3.3em;margin:15px 0 12px;color:#102440;font-size:14px;font-weight:800;line-height:1.65}
.sh-message.error{color:#a02a33!important}
.sh-message.success{color:#267346!important}
.sh-tool-section{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px;border:1px solid #e3e8ef;border-radius:8px;background:#f8fafc}
.sh-tools{display:flex;justify-content:center;gap:7px;width:100%}
.sh-page .sh-tool{display:inline-flex;flex:1;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 12px;border:1px solid #d5dfea;border-radius:6px;background:#fff;color:#536477;font-size:13px;font-weight:800;line-height:1.4}
.sh-page .sh-tool[aria-pressed=true]{background:#102440;border-color:#102440;color:#fff}
.sh-page .sh-tool:not([aria-pressed=true]):hover{background:#eaf0f7;border-color:#aabbd1}
.sh-piece-tools{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;width:100%;max-width:360px}
.sh-page .sh-piece-tools button{display:grid;place-items:center;aspect-ratio:1;min-height:44px;min-width:0;padding:3px;border:1px solid #d5dfea;border-radius:5px;background:#fff;line-height:1}
.sh-piece-tools button svg{display:block;width:100%;height:100%;max-height:46px;pointer-events:none}
.sh-page .sh-piece-tools button[aria-pressed=true]{background:#fff3bc;border-color:#bea229;box-shadow:0 0 0 1px #bea229}
.sh-page .sh-piece-tools button:hover{background:#edf1f6}
.sh-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:18px}
.sh-page .sh-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 13px;border:1px solid #cbd4e1;border-radius:6px;background:#fff;color:#102440;font-size:13px;font-weight:800;line-height:1.45;box-shadow:none;transform:none}
.sh-page .sh-button:hover{background:#edf1f6;border-color:#aabbd1}
.sh-page .sh-primary{background:#fcd000;border-color:#fcd000;color:#0f1429}
.sh-page .sh-primary:hover{background:#e6be00;border-color:#e6be00}
.sh-page button:disabled{cursor:default;opacity:.45}
.sh-secondary-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:10px}
.sh-page .sh-text-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:8px 0;border:0;background:transparent;color:#536477;font-size:12px;font-weight:800;line-height:1.5}
.sh-page .sh-text-button:hover{color:#102440;text-decoration:underline;text-underline-offset:4px}
.sh-muted{color:#637286;font-size:13px;line-height:1.8}
.sh-page .sh-controls{margin-top:10px;font-size:12px}
.sh-side{display:grid;gap:20px;min-width:0}
.sh-side h2{font-size:21px;line-height:1.35;margin-bottom:18px}
.sh-eyebrow{display:block;margin-bottom:9px;color:#69778a;font-size:10px;letter-spacing:1.3px;font-weight:900;line-height:1.7}
.sh-rules{margin:0;padding-left:21px;color:#536477;font-size:14px;line-height:1.85}
.sh-rules strong{color:#102440;font-weight:800}
.sh-rules li+li{margin-top:13px}
.sh-rule-note{display:flex;align-items:center;gap:12px;margin-top:23px;padding:14px 12px;border-radius:6px;background:#fff8dc;color:#655724}
.sh-rule-note>i{color:#102440;font-size:25px;flex-shrink:0}
.sh-rule-note p{font-size:12px;line-height:1.75}
.sh-stats{display:flex;gap:28px;margin:0 0 12px}
.sh-stats dt{color:#637286;font-size:12px}
.sh-stats dd{margin:0;color:#0f1429;font-size:32px;font-weight:900;line-height:1.5;font-variant-numeric:tabular-nums}
.sh-size-label{display:block;margin-top:18px;margin-bottom:7px;color:#536477;font-size:12px;font-weight:800}
.sh-size-select{width:100%;min-height:44px;border:1px solid #cbd4e1;border-radius:6px;padding:9px 12px;background:#fff;color:#102440;font:inherit;font-size:14px}
.sh-other-games{display:grid;gap:12px}
.sh-other-games a{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:5px 2px;color:#102440;font-size:14px;line-height:1.6}
.sh-other-games a span{text-decoration:underline;text-underline-offset:4px}
.sh-other-games a i{display:inline-flex;align-items:center;font-size:12px;line-height:1}
.sh-other-games a:hover{color:#3f6297}
.sh-result{margin-top:24px;padding:24px;border:1px solid #d1dfd6;border-radius:8px;background:#f5faf6;text-align:center}
.sh-result-icon{display:grid;place-items:center;width:45px;height:45px;margin:0 auto 12px;border-radius:12px;background:#fcd000;color:#102440;font-size:25px}
.sh-result h2{font-size:22px;line-height:1.35}
.sh-page .sh-result p{margin-top:10px;font-size:14px;line-height:1.75;color:#536477}
.sh-result .sh-button{margin-top:18px}
.sh-train-overlay{position:absolute;inset:0;z-index:5;width:100%;height:100%;overflow:visible;pointer-events:none}
.sh-train-car{stroke-linejoin:round}
.sh-train-car .sh-car-shadow{fill:#0f1429;opacity:.16}
.sh-smoke circle{stroke:none}
.sh-page .sh-footer{border-top:1px solid #dce3ef;background:#fff;color:#0f1429}
.sh-footer .sh-brand{font-size:24px}
.sh-footer .sh-brand-icon{width:32px;height:35px;border-radius:7px;font-size:19px}
.sh-page .sh-footer p{margin-top:12px;color:#536477}
.sh-page .sh-footer .sh-credit{color:#536477;font-size:11px}
.sh-page .sh-footer .zb-footer-links a{color:#536477}
.sh-page .sh-footer a:hover{color:#3f6297}
.sh-page dialog.sh-help{position:relative;width:min(920px,calc(100% - 32px));max-height:calc(100dvh - 32px);padding:42px 28px 30px;border:1px solid #dce3ef;border-radius:10px;background:#fff;overflow:auto;color:#0f1429}
.sh-page dialog.sh-help::backdrop{background:#0f142999}
.sh-help-close{position:absolute;right:12px;top:10px;display:grid;place-items:center;min-width:40px;min-height:40px;padding:8px;border:0;background:transparent;color:#637286;font-size:19px;line-height:1}
.sh-help-close:hover{color:#102440;background:#f2f5fa;border-radius:6px}
.sh-help h2{font-size:30px;line-height:1.3}
.sh-help-intro{font-size:14px;color:#637286;line-height:1.8}
.sh-help-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:26px 0 22px;text-align:left}
.sh-help-steps article{padding:20px;border:1px solid #dce3ef;border-radius:8px;background:#f8fafc}
.sh-step{display:grid;place-items:center;width:33px;height:33px;margin-bottom:15px;border:1px solid #cbd4e1;border-radius:7px;background:#e7edf5;color:#102440;font-size:16px;font-weight:900}
.sh-help-steps article:nth-child(2) .sh-step{background:#fff3bc;border-color:#f0d660}
.sh-help-steps h3{margin-bottom:10px;font-size:18px;line-height:1.4}
.sh-help-steps p{font-size:13px;line-height:1.8;color:#637286}
.sh-help-demo{display:flex;align-items:center;gap:6px;margin-top:19px;min-height:36px;color:#102440}
.sh-help-demo b{display:grid;place-items:center;width:34px;height:34px;border:1px solid #ccd6e3;background:white;border-radius:3px;font-size:17px}
.sh-help-demo .sh-demo-count{padding-right:4px;font-size:22px;font-weight:900}
.sh-help-demo .sh-demo-station{background:#102440;color:#fff;font-size:14px;font-weight:900}
.sh-demo-train{display:grid;place-items:center;width:33px;height:33px;color:#102440;font-size:27px}
.sh-demo-track{width:55px;height:15px;border-block:3px solid #102440;background:repeating-linear-gradient(90deg,transparent 0 6px,#d3a76c 6px 10px,transparent 10px 15px)}
.sh-help-demo>span.sh-demo-station{display:grid;place-items:center;width:30px;height:33px;border-radius:4px}
.sh-help form{margin-top:24px}
@media(max-width:980px){.sh-layout{grid-template-columns:minmax(0,1.65fr) minmax(250px,1fr);gap:20px}.sh-card{padding:20px}.sh-page .sh-button{padding-inline:11px;font-size:12px}.sh-rules{font-size:13px}.sh-side h2{font-size:20px}}
@media(max-width:760px){.sh-main{margin-top:22px}.sh-layout{grid-template-columns:1fr}.sh-game{max-width:650px;width:100%;margin:auto}.sh-side{grid-template-columns:1fr 1fr;gap:16px}.sh-other-games{grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.sh-help-steps{grid-template-columns:1fr}.sh-help-demo{margin-top:14px}.sh-page .zb-header nav{gap:16px}.sh-page .sh-help{padding-inline:20px}.sh-help h2{font-size:27px}}
@media(max-width:480px){.sh-main{padding-inline:12px;margin-bottom:38px}.sh-page .zb-header{height:70px;padding:10px 16px}.sh-page .zb-header nav{gap:12px}.sh-brand{gap:8px;font-size:24px}.sh-brand-icon{width:31px;height:35px;font-size:20px}.sh-page .zb-home{padding:8px 10px;font-size:11px}.sh-card{padding:16px}.sh-top{font-size:11px;gap:9px}.sh-grid-shell{grid-template-columns:1.5rem minmax(0,1fr);grid-template-rows:1.5rem minmax(0,1fr);margin-top:15px;gap:3px}.sh-board-caption{font-size:11px;gap:8px}.sh-board-caption>span{font-size:10px;gap:4px}.sh-board-caption strong{font-size:11px}.sh-page p.sh-message{font-size:12px;min-height:3.3em;margin-top:12px}.sh-tool-section{padding:10px;gap:9px}.sh-page .sh-tool{padding:7px 8px;gap:5px;font-size:12px}.sh-piece-tools{gap:5px}.sh-page .sh-piece-tools button{padding:2px;min-height:40px}.sh-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:14px}.sh-page .sh-button{font-size:12px;min-height:44px}.sh-side{grid-template-columns:1fr}.sh-side h2{font-size:20px}.sh-rules{font-size:14px}.sh-other-games{grid-template-columns:1fr;gap:8px}.sh-other-games a{font-size:13px}.sh-page .sh-controls{font-size:11px}.sh-page .sh-text-button{font-size:11px}.sh-station-label{min-width:14px;height:14px;left:2px;bottom:2px;font-size:9px}.sh-fixed-icon{font-size:7px;right:2px;top:2px}.sh-result{padding:20px 14px}.sh-result h2{font-size:20px}.sh-page dialog.sh-help{padding:42px 18px 24px}.sh-help h2{font-size:25px}.sh-help-intro{font-size:13px}.sh-eyebrow{font-size:9px;letter-spacing:1px}}
@media(max-width:480px){.sh-col-clues>.sh-clue,.sh-row-clues>.sh-clue{width:24px;height:24px;border-radius:5px}}
@media(prefers-reduced-motion:reduce){.sh-page *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

/* Board and track look: wooden sleepers with two navy rails, a framed board and gates at the stations. */
.sh-board{overflow:visible;border:4px solid #3b4659;border-radius:9px;background:#fff}
.sh-page button.sh-cell{border-right:1px solid #cdd5e1;border-bottom:1px solid #cdd5e1;overflow:hidden}
.sh-page .sh-cell.track{--sh-track-bed:#f7f9fc}
.sh-page .sh-cell.empty{--sh-track-bed:#fff;color:#8b96a6;font-size:clamp(13px,2.4vw,22px)}
.sh-page .sh-cell.fixed{--sh-track-bed:#e9eef6}
.sh-page .sh-cell.endpoint{--sh-track-bed:#e9eef6;overflow:visible}
.sh-sleepers rect{fill:#d69c5f}
.sh-rails path{fill:none;stroke:#1d3157;stroke-width:5.5}
.sh-fixed-icon{color:#7d8899}
.sh-gate{position:absolute;z-index:4;display:grid;place-items:center;background:#3b4659;color:#fcd000;font-size:13px;line-height:1;pointer-events:none}
.sh-gate--left,.sh-gate--right{top:22%;bottom:22%;width:10px}
.sh-gate--top,.sh-gate--bottom{left:22%;right:22%;height:10px}
.sh-gate--left{left:-7px;border-radius:5px 0 0 5px}
.sh-gate--right{right:-7px;border-radius:0 5px 5px 0}
.sh-gate--top{top:-7px;border-radius:5px 5px 0 0}
.sh-gate--bottom{bottom:-7px;border-radius:0 0 5px 5px}
.sh-gate i{display:inline-block;line-height:1;vertical-align:0}

/* Piece palette: one bar with every track shape. */
.sh-tool-section{padding:12px;border:1px solid #dce3ef;border-radius:10px;background:#fff}
.sh-piece-tools{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;max-width:520px}
.sh-page .sh-piece-tools button{padding:4px;border:2px solid transparent;border-radius:8px;background:#eef3fa}
.sh-page .sh-piece-tools button:hover{background:#e2eaf5}
.sh-page .sh-piece-tools button[aria-pressed=true]{background:#e2eaf5;border-color:#2fb36b;box-shadow:none}
.sh-piece-tools button svg{max-height:58px}
.sh-piece-tools .sh-sleepers rect{fill:#d69c5f}

/* Win state: the result panel replaces the tools. */
.sh-game{position:relative}
.sh-game.is-won .sh-tool-section,.sh-game.is-won .sh-actions,.sh-game.is-won .sh-controls,.sh-game.is-won .sh-secondary-actions{display:none}
.sh-result{margin-top:8px;padding:8px 0 4px;border:0;background:transparent}
.sh-result h2{font-size:24px}
.sh-page .sh-result p{font-size:15px}
.sh-result-actions{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:20px}
.sh-page .sh-result .sh-next{width:min(100%,360px);min-height:54px;margin-top:0;border-radius:10px;font-size:17px}
.sh-page .sh-result .sh-button{margin-top:0}
@media(max-width:480px){.sh-gate{font-size:10px}.sh-gate--left,.sh-gate--right{width:8px}.sh-gate--top,.sh-gate--bottom{height:8px}.sh-gate--left{left:-6px}.sh-gate--right{right:-6px}.sh-gate--top{top:-6px}.sh-gate--bottom{bottom:-6px}.sh-piece-tools{gap:5px}}

/* Seamless track: grid lines are drawn underneath instead of as borders, so every piece fills its
   whole cell and the rails of neighbouring cells meet exactly. */
.sh-page button.sh-cell { border: 0; }
.sh-page button.sh-cell::before { content: ""; position: absolute; inset: 0; z-index: 0; border-right: 1px solid #cdd5e1; border-bottom: 1px solid #cdd5e1; pointer-events: none; }
.sh-page .sh-cell > svg { position: relative; z-index: 1; }
.sh-page .sh-cell > i { position: relative; z-index: 1; }
.sh-rails path { stroke-linecap: butt; shape-rendering: geometricPrecision; }

/* The train enters and leaves the board under the station gates instead of vanishing on the board. */
.sh-train-overlay { overflow: hidden; }
.sh-page .sh-gate { z-index: 6; }

/* X marks: two pen strokes; a newly added X draws itself, first line then second, each from top to bottom. */
.sh-page .sh-cell svg.sh-x { width: 100%; height: 100%; }
.sh-x line { fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: round; }
.sh-x--new line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sh-x-draw .14s ease-out forwards; }
.sh-x--new line + line { animation-delay: .14s; }
@keyframes sh-x-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .sh-x--new line { animation: none; stroke-dashoffset: 0; } }

/* A piece turned by dragging eases into its new direction. */
.sh-cell svg.sh-turn { transform-origin: 50% 50%; animation: sh-turn .22s cubic-bezier(.2,.8,.2,1) .04s both; }
@keyframes sh-turn { from { opacity: .3; transform: scale(.86) rotate(-14deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sh-cell svg.sh-turn { animation: none; } }

/* "?" — track goes here, direction still to be dragged in. */
.sh-q { font-size: clamp(18px, 4vw, 30px); font-weight: 800; line-height: 1; color: #b07a2c; }
.sh-q--new { animation: sh-q-pop .18s cubic-bezier(.2,.8,.2,1) both; }
@keyframes sh-q-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sh-q--new { animation: none; } }
