/* Tileroad is confined to Zone B; no body/root styles or global key handlers. */
.tileroad-module{container-type:size;display:flex;gap:12px;padding:8px 14px;width:100%;height:100%;min-height:0;box-sizing:border-box;color:var(--tr-text,#111);font-family:'DM Mono',ui-monospace,Menlo,Consolas,monospace;overflow:hidden;user-select:none}
.tileroad-module *{box-sizing:border-box}
.tileroad-module [hidden]{display:none!important}
.tileroad-module{position:relative}
.tileroad-board{flex:1;position:relative;min-width:0;min-height:0;touch-action:none}
.tileroad-road{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;transition:transform .25s ease;cursor:grab;border-radius:6px;padding-left:4px}
.tileroad-road.is-selected{background:color-mix(in srgb,var(--tr-gold) 28%,transparent);outline:3px solid var(--tr-gold)}
.tileroad-label{width:2.2em;text-align:right;padding-right:.5em;font-weight:700;font-size:var(--tr-fs);flex:none}
.tileroad-module.hide-numbers .tileroad-label{visibility:hidden}
.tileroad-module.hide-numbers .tileroad-road.has-number .tileroad-label{visibility:visible}
.tileroad-module .tileroad-road.is-zero .tileroad-track{outline:2px dashed #aab2c6;border-radius:6px;min-width:24px;min-height:24px}
.tileroad-module .tileroad-road.is-zero.is-wave .tileroad-track{outline-color:var(--tr-highlight);box-shadow:0 0 0 6px #b98be533}
.tileroad-module.is-vertical-roads .tileroad-road{right:auto;flex-direction:column-reverse;padding-left:0;cursor:pointer}
.tileroad-module.is-vertical-roads .tileroad-track{width:100%;height:100%;flex-direction:column-reverse}
.tileroad-module.is-vertical-roads .tileroad-tile{width:100%;height:auto;flex:0 0 10%}
.tileroad-module.is-vertical-roads .tileroad-road.is-zero .tileroad-track{flex:none;height:10%;width:100%}
.tileroad-module.is-vertical-roads .tileroad-label{position:absolute;bottom:-30px;padding:0;width:100%;text-align:center}
.tileroad-lesson-controls{position:absolute;bottom:8px;right:12px;display:flex;gap:8px;z-index:6}
.tileroad-module.is-lesson .tileroad-board{margin-bottom:48px}
.tileroad-module .tileroad-lesson-controls .tileroad-control{flex:none;padding:10px 14px;font-size:14px;background:#485c94}
.tileroad-track{flex:1;display:flex;height:100%;min-width:0}
.tileroad-module .tileroad-tile{flex:0 0 10%;height:100%;min-width:0;min-height:0;padding:0;margin:0;border:0;border-radius:3px;box-shadow:0 2px 3px #0003;position:relative;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:var(--tr-fs);transition:filter .1s,transform .1s;transform:none;touch-action:none;cursor:pointer}
.tileroad-module .tileroad-tile.is-red{background:var(--tr-red)}
.tileroad-module .tileroad-tile.is-blue{background:var(--tr-blue)}
.tileroad-tile::before{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(180deg,#ffffff4d,#fff0 50%,#00000024),repeating-linear-gradient(45deg,#ffffff14 0 2px,#fff0 2px 5px);box-shadow:inset 0 2px 0 #fff6,inset 0 -3px 0 #0003,inset 0 0 0 1px #fff3}
.tileroad-module .tileroad-tile.is-lit{background:var(--tr-highlight);animation:tileroad-pop .4s ease-out}
.tileroad-module .tileroad-tile.is-ghost{opacity:0}
.tileroad-module .tileroad-tile.is-needed{opacity:.35;outline:2px dashed var(--tr-highlight);outline-offset:-2px}
.tileroad-module .tileroad-tile.is-extra{outline:3px solid #ff8c32;outline-offset:-3px}
.tileroad-label,.tileroad-track{transition:opacity .25s}
.tileroad-module .tileroad-plus{flex:none;width:calc(var(--tr-fs)*1.8);text-align:center;font-size:calc(var(--tr-fs)*1.3);line-height:1;color:#8a929e;font-weight:300;cursor:pointer;position:relative;z-index:2;border:0;background:none;padding:0;margin:0;border-radius:0;box-shadow:none;transform:none;touch-action:none}
.tileroad-scribble{display:none;position:absolute;left:50%;top:50%;width:calc(var(--tr-fs)*3.2);height:calc(var(--tr-fs)*3.2);transform:translate(-50%,-50%);pointer-events:none;overflow:visible}
.tileroad-road.is-hint .tileroad-scribble{display:block}
.tileroad-road.is-hint .tileroad-plus{color:var(--tr-highlight);font-weight:600;animation:tileroad-nudge 1.3s ease-in-out infinite}
.tileroad-scribble path{fill:none;stroke:var(--tr-highlight);stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;animation:tileroad-scribble 2.6s ease-in-out infinite}
.tileroad-road.is-missing .tileroad-label{color:var(--tr-highlight)}
.tileroad-road.is-correct .tileroad-label{color:#2e9e5b}
.tileroad-road.is-dim .tileroad-label,.tileroad-road.is-dim .tileroad-track{opacity:var(--tr-dim-opacity,.3)}
.tileroad-road.is-wave .tileroad-tile.is-lit{animation:tileroad-wave 1.1s ease-in-out infinite;animation-delay:calc(var(--i)*80ms)}
.tileroad-panel{width:200px;background:var(--tr-panel);border-radius:14px;padding:10px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-content:center;text-align:center;flex:none}
.tileroad-title{margin:0;font-size:22px;flex-basis:100%;font-family:inherit;color:inherit}
.tileroad-info{font-size:13px;min-height:2.4em;flex-basis:100%}
.tileroad-module .tileroad-control{flex:1 1 45%;font-family:inherit;font-size:12px;line-height:1.15;padding:8px 2px;border:0;border-radius:12px;background:#7b8794;color:#fff;cursor:pointer;touch-action:manipulation;box-shadow:none;margin:0;transform:none;min-width:0}
.tileroad-module .tileroad-control:hover,.tileroad-module .tileroad-tile:hover{transform:none}
.tileroad-module .tileroad-control:active{transform:scale(.95)}
.tileroad-module .tileroad-control:focus-visible,.tileroad-module .tileroad-tile:focus-visible,.tileroad-module .tileroad-plus:focus-visible{outline:3px solid var(--tr-gold);outline-offset:2px}
.tileroad-module .tileroad-control[aria-pressed=true]{background:var(--tr-highlight)}
.tileroad-panel>.tileroad-control:nth-of-type(1),.tileroad-panel>.tileroad-control:nth-of-type(2){background:var(--tr-red);font-size:16px;padding:12px 0}
.tileroad-module .tileroad-win{position:absolute;inset:0;background:#000a;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;color:#fff;text-align:center;z-index:9;padding:20px}
.tileroad-win .tileroad-control{flex:none;padding:12px 28px;background:var(--tr-red);font-size:16px}
@keyframes tileroad-pop{0%{background:#fff}60%{background:#c9a4f5}100%{background:var(--tr-highlight)}}
@keyframes tileroad-wave{0%,100%{background:var(--tr-highlight)}50%{background:#d9bcff}}
@keyframes tileroad-nudge{50%{transform:scale(1.15)}}
@keyframes tileroad-scribble{0%{stroke-dashoffset:1;opacity:1}45%,85%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
@container(max-width:540px){.tileroad-panel{width:130px;padding:6px;gap:5px}.tileroad-title{font-size:16px}.tileroad-info{font-size:11px}.tileroad-module .tileroad-control{font-size:10px;padding:6px 2px}}
@media(orientation:portrait){.tileroad-module{flex-direction:column}.tileroad-panel{width:auto;flex-basis:auto;flex-direction:row;flex-wrap:wrap;align-items:center}.tileroad-module .tileroad-panel>.tileroad-control{flex:1 1 20%}.tileroad-title,.tileroad-info{flex-basis:100%}}
@media(prefers-reduced-motion:reduce){.tileroad-road,.tileroad-label,.tileroad-track{transition:none}.tileroad-module .tileroad-tile.is-lit,.tileroad-road.is-wave .tileroad-tile.is-lit,.tileroad-road.is-hint .tileroad-plus,.tileroad-scribble path{animation:none}.tileroad-scribble path{stroke-dashoffset:0}}
