.escape-word { max-width: 720px; margin-inline: auto; }
.ew-board { position: relative; width: 100%; max-width: 560px; margin: 1.25rem auto; padding-inline: 1rem; }
/* The team colours of the markers, for the shared team line and name bubble. */
:root { --team-seat-0: var(--accent, #5c56d8); --team-seat-1: #cf6732; --team-seat-2: #b0307a; }
:root[data-contrast="true"] { --team-seat-0: #b54b00; --team-seat-1: #1554c0; --team-seat-2: #8b1a5e; }
.ew-pause-frame { width: calc(100% - 2rem); max-width: 528px; aspect-ratio: 1; margin: 1.25rem auto; }
.ew-maze { display: block; width: 100%; overflow: visible; touch-action: none; background: var(--surface, #fff); border-radius: .45rem; }
/* An outline is a closed line, which looks like a wall across the door's opening. This ring is drawn in the maze with a gap at the door.
   The browser also draws its own ring when the maze takes focus after a touch or a click, so every focus state turns the outline off. */
.ew-maze:focus { outline: none; }
.ew-focus { visibility: hidden; fill: none; stroke: var(--accent, #5c56d8); stroke-width: 3px; vector-effect: non-scaling-stroke; pointer-events: none; }
.ew-maze:focus-visible .ew-focus { visibility: visible; }
.ew-maze.dimmed { opacity: .45; }
.ew-walls { fill: none; stroke: var(--ink, #25283e); stroke-width: .065; stroke-linecap: square; }
.ew-trail { fill: none; stroke: var(--accent, #5c56d8); stroke-opacity: .18; stroke-width: .16; stroke-linecap: round; stroke-linejoin: round; }
.ew-tile { font: 700 .56px system-ui, sans-serif; fill: var(--ink, #25283e); text-anchor: middle; dominant-baseline: central; }
.ew-maze:is([data-size="17"], [data-size="23"]) .ew-tile { font-size: .78px; }
.ew-maze:is([data-size="17"], [data-size="23"]) .ew-walls { stroke-width: .075; }
.ew-marker { fill: var(--accent, #5c56d8); stroke: var(--ink, #25283e); stroke-width: .055; }
.ew-marker.seat-1 { fill: #cf6732; }
.ew-marker.seat-2 { fill: #b0307a; }
.ew-door { fill: var(--good, #288663); stroke: var(--good, #288663); stroke-opacity: .3; stroke-width: .14; }
.ew-ring { fill: none; stroke: var(--accent, #5c56d8); stroke-width: .07; pointer-events: none; }
.ew-flash, .ew-route { fill: none; stroke: var(--accent, #5c56d8); stroke-width: .12; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.ew-flash.seat-1 { stroke: #cf6732; }
.ew-flash.seat-2 { stroke: #b0307a; }
.ew-route { stroke-opacity: .35; }
.ew-tray { margin: 1.5rem auto; text-align: center; }
.ew-slots, .ew-loose { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-block: .8rem; }
.ew-slot, .ew-loose-tile { min-width: 44px; min-height: 44px; border: 1px solid var(--line, #d9dce7); border-radius: .55rem; font: 700 1.1rem system-ui, sans-serif; color: var(--ink, #25283e); background: var(--surface, #fff); cursor: pointer; }
.ew-slot[aria-disabled="true"] { cursor: default; }
.ew-slot[aria-label*="locked"] { border: 2px solid var(--good, #288663); }
.escape-word .scorebar { max-width: 560px; margin: var(--s4) auto; gap: 1rem; }
.escape-word .play-actions { display: flex; flex-wrap: wrap; gap: .65rem; justify-content: center; margin-block: 1rem; }
.escape-word .play-actions button { min-height: 44px; }
.escape-word .timer { font-variant-numeric: tabular-nums; font-size: 1.5rem; }
.ew-pace { max-width: 528px; margin: 0 auto; padding: var(--s3); border: 1px solid var(--line, #d9dce7); border-radius: .55rem; }
.ew-pace-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; }
.ew-pace-heading strong, .ew-pace-budget { font-variant-numeric: tabular-nums; }
.ew-pace p { margin: .5rem 0 0; }
.ew-pace progress { display: block; width: 100%; height: .45rem; margin-top: .65rem; accent-color: var(--accent, #5c56d8); }
.ew-word { font-size: 2rem; letter-spacing: .12em; }
.ew-example { max-width: 200px; margin: 1rem auto; }
.ew-example circle { animation: ew-walk 8s infinite steps(1); }
@keyframes ew-walk { 0%, 15% { transform: translate(0,0); } 30% { transform: translate(1px,0); } 50% { transform: translate(1px,-1px); } 75%, 100% { transform: translate(2px,-1px); } }
@media (prefers-reduced-motion: reduce) { .ew-example circle { animation: none; transform: translate(2px,-1px); } }
@media (forced-colors: active) { .ew-focus { stroke: Highlight; } .ew-maze { background: Canvas; } .ew-walls, .ew-flash, .ew-route { stroke: CanvasText; } .ew-tile { fill: CanvasText; } .ew-marker { fill: Highlight; stroke: CanvasText; } }

.ew-example .ew-demo-letter { animation: ew-collect 8s infinite steps(1); }
.ew-example .ew-demo-tray, .ew-example .ew-demo-door { animation: ew-unlock 8s infinite steps(1); }
@keyframes ew-collect { 0%, 29% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes ew-unlock { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .ew-example .ew-demo-letter { animation: none; opacity: 0; }
    .ew-example .ew-demo-tray, .ew-example .ew-demo-door { animation: none; opacity: 1; }
}

:root[data-contrast="true"] .ew-walls { stroke-width: .09; }
:root[data-contrast="true"] .ew-marker.seat-0 { fill: #b54b00; }
:root[data-contrast="true"] .ew-marker.seat-1 { fill: #1554c0; }
:root[data-contrast="true"] .ew-marker.seat-2 { fill: #8b1a5e; }

.escape-word .game-intro { margin-bottom: var(--s4); }
.ew-hint { display: flex; flex: 1 1 150px; max-width: 250px; flex-direction: column; gap: var(--s2); text-align: center; }
.ew-hint button { display: flex; width: 100%; align-items: center; justify-content: center; gap: var(--s3); }
.ew-hint button small { white-space: nowrap; }
.escape-word .play-actions { align-items: flex-start; max-width: 560px; margin-inline: auto; }
.ew-answer { text-align: center; margin: 0 0 var(--s4, 1rem); }
