/* Responsive colouring workspace: keep the illustration, navigation and every colour visible. */
.color-screen{position:fixed;inset:0;z-index:20;box-sizing:border-box;height:100dvh;display:flex;flex-direction:column;align-items:center;gap:6px;overflow:auto;padding:max(8px,env(safe-area-inset-top)) 10px max(12px,env(safe-area-inset-bottom));background:radial-gradient(ellipse at 12% 10%,#fff4d5,transparent 52%),linear-gradient(145deg,#e4f2e3,#e4eee8 55%,#fae6da);color:#3f4560}
.color-screen .game-toolbar,.color-screen .at-game-steps{flex-shrink:0}
.color-screen .at-game-steps{display:flex;box-sizing:border-box;margin:0 auto 3px}
.color-intro{flex:none;text-align:center;color:#375d53;font-size:clamp(16px,3vw,22px);line-height:1.2;margin:0;font-weight:900}
.color-palette{flex:none;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;width:min(100%,680px);padding:5px;box-sizing:border-box;overflow:visible}
.color-palette button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:64px;border:2px solid #ffffffb5;border-radius:15px;padding:5px 2px;background:#ffffffd0;color:#384d60;font-family:inherit;cursor:pointer;touch-action:manipulation;box-sizing:border-box}
.color-palette button[aria-pressed=true]{outline:3px solid #e84f95;outline-offset:0;box-shadow:0 0 0 5px #fff7}
.color-palette .color-swatch{display:block;flex:none;width:36px;height:36px;border-radius:50%;background:var(--swatch);border:2px solid #74818b;box-shadow:inset 3px 3px 5px #ffffffb8,0 3px 5px #606e7d55}
.color-palette small{font-size:14px;line-height:1.2;font-weight:800;white-space:nowrap}
.color-palette .color-study-letter{color:#c9152b;font-weight:950;text-shadow:0 0 1px #fff,0 1px 0 #fff}
/* Absolute SVG sizing avoids intrinsic SVG dimensions growing the flex/grid row.
   The complete 740:590 viewBox is contained; no independent width/height scaling. */
.color-paper{position:relative;flex:1 1 0;width:min(100%,1100px);min-height:120px;min-width:0;align-self:center}
.color-paper>svg{position:absolute;inset:0;display:block;width:100%;height:100%;max-height:none;min-height:0;object-fit:contain;filter:drop-shadow(0 7px 10px #51645126);touch-action:manipulation}
.color-paper [data-paint-region]{cursor:pointer;transition:fill .25s ease}
.color-paper [data-paint-region]:focus-visible{outline:none;stroke:#d43879;stroke-width:7;filter:drop-shadow(0 0 2px #fff)}
.color-actions{flex:none;display:flex;align-items:center;justify-content:center;gap:10px;min-height:24px;font-size:14px;font-weight:900}
.color-finish{border:2px solid #fff;border-radius:999px;background:#ec508a;color:#fff;padding:7px 16px;min-height:44px;font-family:inherit;font-weight:900;box-shadow:0 5px 9px #a5467180}
@media(max-width:600px){
 .color-screen{gap:4px}
 .color-palette{grid-template-columns:repeat(4,minmax(0,1fr));width:min(100%,420px);gap:7px;padding:4px 5px}
 .color-palette button{min-height:61px;padding:4px 1px}
 .color-palette .color-swatch{width:30px;height:30px}
 .color-palette small{font-size:13px}
 .color-screen .at-game-steps{display:flex}
}
@media(max-height:500px) and (min-width:600px){
 .color-screen{display:grid;grid-template-columns:minmax(200px,1fr) minmax(0,2fr);grid-template-rows:auto auto auto minmax(0,1fr) auto;gap:4px 10px}
 .color-screen .game-toolbar,.color-screen .at-game-steps{grid-column:1/-1;width:100%;margin:0}
 .color-intro{grid-column:1;grid-row:3;font-size:16px}
 .color-palette{grid-column:1;grid-row:4;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;padding:4px;align-self:center}
 .color-palette button{min-height:55px;padding:3px 1px}
 .color-palette .color-swatch{width:26px;height:26px}
 .color-palette small{font-size:11px}
 .color-actions{grid-column:1;grid-row:5;font-size:12px}
 .color-paper{grid-column:2;grid-row:3/6;align-self:stretch;width:100%;height:100%;min-height:0}
}
@media(prefers-reduced-motion:reduce){.color-paper [data-paint-region]{transition:none}}
