/* v15 / miniature non-modal Snake window. No backdrop or button panel. */
.snake-launch{width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--border);background:var(--bg);color:var(--ink);padding:0;flex:none}
.snake-launch:hover,.snake-launch[aria-expanded="true"]{background:var(--ink);color:var(--bg)}
.snake-dialog{position:fixed;inset:auto 18px auto auto;top:86px;margin:0;width:min(236px,calc(100vw - 24px));max-height:calc(100dvh - 100px);overflow:auto;z-index:100;border:2px solid var(--ink);background:var(--bg);color:var(--ink);padding:12px;font:11px/1.4 var(--mono);box-shadow:5px 5px 0 color-mix(in srgb,var(--ink) 22%,transparent)}
.snake-dialog[open]{display:block;animation:snake-enter .16s ease-out}
.snake-dialog::backdrop{background:transparent}
@keyframes snake-enter{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
.snake-head,.snake-info{display:flex;align-items:center;justify-content:space-between;gap:12px}
.snake-head{margin-bottom:8px}
.snake-head h2{font:700 18px/1 var(--mono);letter-spacing:-.06em;margin:0}
.snake-close{font:22px/1 var(--mono);border:0;background:none;color:var(--ink);width:28px;height:28px;padding:0}
.snake-info{margin-bottom:7px}
.snake-board{display:block;width:100%;height:auto;aspect-ratio:1;border:1px solid var(--ink);touch-action:none;cursor:crosshair}
.snake-board:focus-visible{outline:1px dashed var(--ink);outline-offset:2px}
@media(max-width:760px){.snake-launch{width:33px;height:33px}.snake-dialog{top:73px;right:10px;width:min(224px,calc(100vw - 20px));max-height:calc(100dvh - 84px)}}
@media(prefers-reduced-motion:reduce){.snake-dialog[open]{animation:none}}

/* v21: a pixel S chasing an apple. The eye inverts with the foreground. */
.snake-launch{--snake-eye:var(--bg);border:1px solid var(--ink)}
.snake-launch:hover,.snake-launch[aria-expanded="true"]{--snake-eye:var(--ink)}
.snake-launch .snake-glyph{display:block}
.snake-launch:focus-visible{outline:1px solid var(--ink);outline-offset:3px}

/* The closed loop is an ending, not a restart screen. */
.snake-info [hidden]{display:none!important}
.snake-info:has(>span[hidden]){justify-content:center;letter-spacing:.015em}

/* Chapter-gated launcher: both entry and exit fade. JS hides the button
   after the exit transition, and disables it immediately while fading out. */
.snake-launch[hidden]{display:none!important}
.snake-launch{opacity:0;transition:opacity .32s ease-in-out}
.snake-launch.snake-visible{opacity:1}
.snake-launch:disabled{pointer-events:none}
@media(prefers-reduced-motion:reduce){.snake-launch{transition:none}}
