/* Reinforcement Learning Gridworld (/reinforcement-learning-gridworld): the grid world (with its chart beside or under it) fills a focus
   stage, with the four tiles in the floating panel beside it (docs/app-kit.md). Tiles, panels and buttons come from the app kit
   (css/app-kit, docs/app-kit.md). Loaded only on this app's page (StylePaths). */

/* Click or drag on the grid to paint cells with the chosen tool. No scrolling or zooming while a finger paints. */
.rl-landing-app .rl-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: cell;
}

.rl-landing-app .rl-canvas:focus-visible {
    outline: 2px solid var(--ak-accent, #2563eb);
    outline-offset: -2px;
}

/* The tool picker: a small swatch of each kind of cell before its name; the buttons wrap on narrow screens. */
.rl-landing-app .rl-tools > .ak-seg-btn {
    flex: 1 1 auto;
    padding-inline: 0.5rem;
}

.rl-landing-app .rl-tool::before {
    content: "";
    flex: none;
    width: 0.8em;
    height: 0.8em;
    border-radius: 2px;
    background: var(--rl-swatch);
    box-shadow: 0 0 0 1px rgba(8, 12, 28, 0.45);
}

.rl-landing-app .rl-tool--wall { --rl-swatch: #334155; }
.rl-landing-app .rl-tool--goal { --rl-swatch: #16a34a; }
.rl-landing-app .rl-tool--pit { --rl-swatch: radial-gradient(circle, #000 45%, #dc2626 50%, #fde2e2 60%); }
.rl-landing-app .rl-tool--start { --rl-swatch: #ff7a1a; }
.rl-landing-app .rl-tool--empty { --rl-swatch: #eef2f7; }

/* Phones: a squarer picture (the grid above the chart). */
@media (max-width: 640px) {
    .rl-landing-app .rl-canvas {
        aspect-ratio: 1 / 1;
    }
}
