/* ===========================================================================
   desenhar.css — ateliê de desenho e pintura (jogos "Desenhar" e "Pintar")
   Linguagem visual do DESIGN.md: papel-cartão recortado, borda escura grossa,
   sombra dura deslocada, alvos grandes para mão de criança.
   =========================================================================== */

#game-draw, #game-paint {
    --ink: #1B1235;
    --ink-soft: #3B2A6B;
    --night: #241A52;
    --night-2: #150F33;
    --paper: #FFF6E9;
    --mango: #FF8A3D;
    --bubble: #FF5E9C;
    --lime: #B8E62D;
    --teal: #2FD4C6;
    --grape: #8B5CF6;
    --sun: #FFD23F;

    display: none;
    flex-direction: column;
    gap: 6px;
    padding: max(6px, env(safe-area-inset-top, 0px)) 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background:
        radial-gradient(120% 80% at 50% 0%, #35276E 0%, transparent 60%),
        linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
    overflow: hidden;
}
#game-draw.active, #game-paint.active { display: flex !important; }

/* ---------------------------------------------------------------------------
   Zera a geometria do layout antigo de .art-* que continua em css/style.css
   (arquivo de outro dono). Sem isto, em paisagem a paleta recebe width:118px e
   sai da tela, e as cores/espessuras ficam presas em larguras fixas.
   Este bloco vem ANTES das regras de estilo abaixo, que têm a última palavra.
   --------------------------------------------------------------------------- */
#game-draw .art-head, #game-paint .art-head,
#game-draw .art-tools, #game-paint .art-tools,
#game-draw .art-sub, #game-paint .art-sub,
#game-draw .art-colors, #game-paint .art-colors,
#game-draw .art-sizes, #game-paint .art-sizes,
#game-draw .art-shapes, #game-draw .art-stickers, #game-draw .art-papers,
#game-paint .art-picker-bar {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    align-content: normal;
    grid-area: auto;
}
#game-draw .art-color, #game-paint .art-color,
#game-draw .art-size, #game-paint .art-size,
#game-draw .art-shape,
#game-draw .art-tool, #game-paint .art-tool {
    width: auto;
    min-width: 0;
    box-shadow: none;
}
#game-draw .art-canvas-wrap, #game-paint .art-canvas-wrap { margin: 0; }
#game-draw .art-gallery-item img, #game-paint .art-gallery-item img {
    aspect-ratio: auto;
    object-fit: contain;
}

/* ---------- cabeçalho ---------- */
#game-draw .art-head, #game-paint .art-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 56px;
}
#game-draw .art-head-title, #game-paint .art-head-title {
    font-family: 'Baloo 2', 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 19px;
    color: #fff;
    letter-spacing: .3px;
    transform: rotate(-1.5deg);
    text-shadow: 0 2px 0 var(--ink-soft), 0 3px 0 var(--ink);
    padding-right: 2px;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
}
#game-draw .art-actions, #game-paint .art-actions {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
    margin-left: auto;
    align-items: center;
}
#game-draw .art-abtn, #game-paint .art-abtn {
    -webkit-appearance: none; appearance: none;
    width: 44px; height: 44px;
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    border: 2.5px solid var(--ink);
    border-bottom-width: 5px;
    background: linear-gradient(180deg, #6C5CD0 0%, #5142B4 100%);
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: transform .12s, filter .12s;
}
#game-draw .art-abtn.art-back, #game-paint .art-abtn.art-back {
    width: 50px; height: 50px;
    background: linear-gradient(180deg, #FFA66A 0%, var(--mango) 100%);
}
#game-draw .art-abtn:active, #game-paint .art-abtn:active {
    transform: translateY(3px);
    border-bottom-width: 2.5px;
}
#game-draw .art-abtn.disabled, #game-paint .art-abtn.disabled {
    opacity: .35;
    pointer-events: none;
}
#game-draw .art-abtn svg, #game-paint .art-abtn svg { width: 24px; height: 24px; }

@media (max-width: 460px) {
    #game-draw .art-head-title, #game-paint .art-head-title { display: none; }
}

/* ---------- grade de ferramentas (nada escondido: tudo cabe na tela) ---------- */
/* Treze ferramentas em grade de 7 colunas viravam duas fileiras, e vinte cores
   viravam mais duas: sobrava menos de metade da tela para desenhar. Agora cada
   barra e uma faixa unica que rola de lado — nenhuma ferramenta foi removida,
   elas so deixaram de empilhar. */
#game-draw .art-tools, #game-paint .art-tools {
    display: flex;
    flex-wrap: nowrap;
    justify-content: safe center;
    gap: 5px;
    flex: 0 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 1px 0 3px;
    /* as pontas desbotam para mostrar que ha mais coisa de lado */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
#game-draw .art-tools::-webkit-scrollbar, #game-paint .art-tools::-webkit-scrollbar { display: none; }

#game-draw .art-tool, #game-paint .art-tool {
    -webkit-appearance: none; appearance: none;
    flex: 0 0 auto;
    width: 54px;
    scroll-snap-align: center;
    min-height: 56px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 1px;
    padding: 4px 2px;
    border-radius: 14px;
    border: 2.5px solid var(--ink);
    border-bottom-width: 5px;
    background: linear-gradient(180deg, #FFFFFF 0%, #E9E2FF 100%);
    color: #3A2C7A;
    cursor: pointer;
    transition: transform .14s cubic-bezier(.34,1.56,.64,1), background .14s;
}
#game-draw .art-tool small, #game-paint .art-tool small {
    font-family: 'Nunito', sans-serif;
    font-size: 8.5px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: -.1px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#game-draw .art-tool svg, #game-paint .art-tool svg { width: 25px; height: 25px; }
#game-draw .art-tool:active, #game-paint .art-tool:active {
    transform: translateY(3px);
    border-bottom-width: 2.5px;
}
#game-draw .art-tool.active, #game-paint .art-tool.active {
    background: linear-gradient(180deg, var(--sun) 0%, #FFB627 100%);
    color: var(--ink);
    box-shadow: 0 0 0 3px rgba(255, 210, 63, .35);
}

/* ---------- barra de escolha do desenho (Pintar) ---------- */
#game-paint .art-picker-bar {
    display: flex;
    gap: 5px;
    flex: 0 0 auto;
    align-items: stretch;
}
#game-paint .art-nav, #game-paint .art-title {
    -webkit-appearance: none; appearance: none;
    min-height: 52px;
    border-radius: 14px;
    border: 2.5px solid var(--ink);
    border-bottom-width: 5px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink);
    padding: 0 8px;
}
#game-paint .art-nav {
    flex: 0 0 52px;
    background: linear-gradient(180deg, #7FE9DF 0%, var(--teal) 100%);
}
#game-paint .art-title {
    flex: 1 1 auto;
    background: linear-gradient(180deg, #FFFFFF 0%, var(--paper) 100%);
    font-family: 'Baloo 2', 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#game-paint .art-nav:active, #game-paint .art-title:active {
    transform: translateY(3px); border-bottom-width: 2.5px;
}
#game-paint .art-nav svg { width: 24px; height: 24px; }

/* ---------- área do canvas ---------- */
#game-draw .art-canvas-wrap, #game-paint .art-canvas-wrap {
    position: relative;
    flex: 1 1 0;
    min-height: 120px;
    margin: 0;
    border-radius: 18px;
    border: 3px solid var(--ink);
    box-shadow: 0 6px 0 var(--ink-soft);
    background: #fff;
    overflow: hidden;
}
#game-draw .art-canvas-wrap canvas, #game-paint .art-canvas-wrap canvas {
    display: block;
    touch-action: none;
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none;
}

/* nome da ferramenta escolhida, aparece e some */
#game-draw .art-hint {
    position: absolute;
    left: 50%; top: 10px;
    transform: translateX(-50%);
    padding: 5px 14px;
    border-radius: 999px;
    border: 2.5px solid var(--ink);
    background: var(--sun);
    color: var(--ink);
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
}
#game-draw .art-hint.pop { animation: artHintPop 1.1s ease forwards; }
@keyframes artHintPop {
    0%   { opacity: 0; transform: translateX(-50%) scale(.85); }
    18%  { opacity: 1; transform: translateX(-50%) scale(1); }
    75%  { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) scale(.95); }
}

/* progresso da pintura */
#game-paint .paint-progress-bar {
    position: absolute;
    left: 10px; right: 58px; bottom: 8px;
    height: 12px;
    border-radius: 999px;
    border: 2.5px solid var(--ink);
    background: rgba(255, 255, 255, .85);
    overflow: hidden;
    pointer-events: none;
}
#game-paint .paint-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--bubble), var(--sun), var(--lime));
    transition: width .3s cubic-bezier(.34,1.56,.64,1);
}
#game-paint .paint-progress-label {
    position: absolute;
    right: 8px; bottom: 4px;
    min-width: 44px;
    text-align: center;
    padding: 2px 6px;
    border-radius: 999px;
    border: 2.5px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 12px;
    pointer-events: none;
}
.paint-splash-particle {
    position: absolute;
    width: 9px; height: 9px;
    margin: -4.5px 0 0 -4.5px;
    border-radius: 50%;
    border: 1.5px solid rgba(27, 18, 53, .55);
    pointer-events: none;
    animation: artSplash .7s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes artSplash {
    0%   { transform: translate(0, 0) scale(.4); opacity: 1; }
    100% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(1.1); opacity: 0; }
}

/* ---------- linha de espessuras / formas / papel ---------- */
#game-draw .art-sub, #game-paint .art-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 0;   /* colapsa quando o balde está ativo e não há espessuras */
}
#game-draw .art-sub:not(:empty), #game-paint .art-sub:not(:empty) { margin-top: 0; }
#game-draw .art-sizes, #game-paint .art-sizes {
    display: flex;
    gap: 4px;
    flex: 1 1 auto;
    align-items: center;
}
#game-draw .art-size, #game-paint .art-size {
    -webkit-appearance: none; appearance: none;
    flex: 1 1 0;
    min-width: 0;
    height: 50px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    border: 2.5px solid var(--ink);
    border-bottom-width: 5px;
    background: linear-gradient(180deg, #FFFFFF 0%, #EFE9FF 100%);
    cursor: pointer;
    padding: 0;
}
#game-draw .art-size span, #game-paint .art-size span {
    display: block;
    border-radius: 50%;
    max-width: 30px; max-height: 30px;
    box-shadow: inset 0 0 0 1.5px rgba(27, 18, 53, .5);
}
#game-draw .art-size.active, #game-paint .art-size.active {
    background: linear-gradient(180deg, var(--sun) 0%, #FFB627 100%);
    box-shadow: 0 0 0 3px rgba(255, 210, 63, .35);
}
#game-draw .art-size:active, #game-paint .art-size:active {
    transform: translateY(3px); border-bottom-width: 2.5px;
}

#game-draw .art-shapes {
    display: flex;
    gap: 4px;
    flex: 1 1 auto;
}
#game-draw .art-shape {
    -webkit-appearance: none; appearance: none;
    flex: 1 1 0;
    height: 50px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    border: 2.5px solid var(--ink);
    border-bottom-width: 5px;
    background: linear-gradient(180deg, #FFFFFF 0%, #EFE9FF 100%);
    color: #3A2C7A;
    cursor: pointer;
    padding: 0;
}
#game-draw .art-shape.active {
    background: linear-gradient(180deg, var(--sun) 0%, #FFB627 100%);
    color: var(--ink);
}
#game-draw .art-shape:active { transform: translateY(3px); border-bottom-width: 2.5px; }

#game-draw .art-papers {
    display: flex;
    gap: 3px;
    flex: 0 0 auto;
    margin-left: auto;
    padding-left: 6px;
    border-left: 2px dashed rgba(255, 255, 255, .25);
}
#game-draw .art-paper {
    -webkit-appearance: none; appearance: none;
    width: 26px; height: 50px;
    border-radius: 8px;
    border: 2.5px solid var(--ink);
    cursor: pointer;
    padding: 0;
}
#game-draw .art-paper.active {
    box-shadow: 0 0 0 3px var(--sun);
}

/* ---------- carimbos ---------- */
#game-draw .art-stickers {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
    overflow-x: auto;
    padding: 2px 0 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
#game-draw .art-stickers::-webkit-scrollbar { display: none; }
#game-draw .art-sticker {
    -webkit-appearance: none; appearance: none;
    flex: 0 0 auto;
    width: 52px; height: 52px;
    font-size: 26px;
    line-height: 1;
    border-radius: 14px;
    border: 2.5px solid var(--ink);
    border-bottom-width: 5px;
    background: linear-gradient(180deg, #FFFFFF 0%, var(--paper) 100%);
    cursor: pointer;
    padding: 0;
}
#game-draw .art-sticker.active {
    background: linear-gradient(180deg, var(--sun) 0%, #FFB627 100%);
    box-shadow: 0 0 0 3px rgba(255, 210, 63, .4);
}

/* ---------- paleta de cores ---------- */
#game-draw .art-colors, #game-paint .art-colors {
    display: flex;
    flex-wrap: nowrap;
    justify-content: safe center;
    gap: 5px;
    flex: 0 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 3px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
#game-draw .art-colors::-webkit-scrollbar, #game-paint .art-colors::-webkit-scrollbar { display: none; }
#game-draw .art-color, #game-paint .art-color {
    -webkit-appearance: none; appearance: none;
    flex: 0 0 auto;
    width: 42px;
    scroll-snap-align: center;
    height: 44px;
    min-width: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    border: 2.5px solid var(--ink);
    border-bottom-width: 4px;
    background: rgba(255, 255, 255, .12);
    cursor: pointer;
    padding: 0;
    color: #fff;
    transition: transform .14s cubic-bezier(.34,1.56,.64,1);
}
#game-draw .art-color i, #game-paint .art-color i {
    display: block;
    width: 100%; height: 100%;
    border-radius: 9px;
    background: var(--sw, #fff);
}
#game-draw .art-color-rainbow i, #game-paint .art-color-rainbow i {
    background: conic-gradient(#FF4D4D, #FFA61F, #FFD23F, #B8E62D, #2FD4C6, #2FA8F0, #8B5CF6, #FF5E9C, #FF4D4D);
}
#game-draw .art-color.active, #game-paint .art-color.active {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 0 0 3px var(--sun), 0 5px 0 var(--ink-soft);
}
#game-draw .art-color:active, #game-paint .art-color:active { transform: translateY(2px); }
#game-draw .art-color-random, #game-paint .art-color-random {
    background: linear-gradient(180deg, #6C5CD0 0%, #5142B4 100%);
}
#game-draw .art-color-random svg, #game-paint .art-color-random svg { width: 22px; height: 22px; }

/* ---------- diálogos e galeria ---------- */
#game-draw .art-overlay, #game-paint .art-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: rgba(21, 15, 51, .72);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    animation: artFadeIn .18s ease;
}
@keyframes artFadeIn { from { opacity: 0 } to { opacity: 1 } }

#game-draw .art-dialog, #game-paint .art-dialog {
    width: 100%;
    max-width: 330px;
    padding: 18px 16px 16px;
    border-radius: 22px;
    border: 3px solid var(--ink);
    box-shadow: 0 8px 0 var(--ink-soft);
    background: var(--paper);
    text-align: center;
    animation: artPopIn .24s cubic-bezier(.34,1.56,.64,1);
}
@keyframes artPopIn { from { transform: scale(.9); opacity: 0 } to { transform: scale(1); opacity: 1 } }
#game-draw .art-dialog-icon, #game-paint .art-dialog-icon {
    display: flex; justify-content: center;
    color: var(--ink);
    margin-bottom: 6px;
}
#game-draw .art-dialog-title, #game-paint .art-dialog-title {
    font-family: 'Baloo 2', 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 19px;
    color: var(--ink);
    margin-bottom: 14px;
}
#game-draw .art-dialog-btns, #game-paint .art-dialog-btns { display: flex; gap: 8px; }
#game-draw .art-dialog-btn, #game-paint .art-dialog-btn {
    -webkit-appearance: none; appearance: none;
    flex: 1 1 0;
    min-height: 56px;
    border-radius: 16px;
    border: 3px solid var(--ink);
    border-bottom-width: 6px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: var(--ink);
    cursor: pointer;
}
#game-draw .art-dialog-no, #game-paint .art-dialog-no { background: linear-gradient(180deg, #B4F0EA 0%, var(--teal) 100%); }
#game-draw .art-dialog-yes, #game-paint .art-dialog-yes { background: linear-gradient(180deg, #FFA66A 0%, var(--mango) 100%); }
#game-draw .art-dialog-btn:active, #game-paint .art-dialog-btn:active { transform: translateY(3px); border-bottom-width: 3px; }

#game-draw .art-gallery-panel, #game-paint .art-gallery-panel {
    width: 100%;
    max-width: 380px;
    max-height: 88%;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    border: 3px solid var(--ink);
    box-shadow: 0 8px 0 var(--ink-soft);
    background: var(--paper);
    overflow: hidden;
    animation: artPopIn .24s cubic-bezier(.34,1.56,.64,1);
}
#game-draw .art-gallery-head, #game-paint .art-gallery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 10px 14px;
    background: linear-gradient(180deg, #6C5CD0 0%, #5142B4 100%);
    border-bottom: 3px solid var(--ink);
    color: #fff;
    font-family: 'Baloo 2', 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 17px;
}
#game-draw .art-gallery-head span, #game-paint .art-gallery-head span {
    display: flex; align-items: center; gap: 7px;
}
#game-draw .art-gallery-close, #game-paint .art-gallery-close {
    -webkit-appearance: none; appearance: none;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    border: 2.5px solid var(--ink);
    background: var(--bubble);
    color: #fff;
    cursor: pointer;
    padding: 0;
}
#game-draw .art-gallery-grid, #game-paint .art-gallery-grid,
#game-paint .art-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
    gap: 8px;
    padding: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#game-draw .art-gallery-item, #game-paint .art-gallery-item {
    border-radius: 14px;
    border: 2.5px solid var(--ink);
    background: #fff;
    overflow: hidden;
}
#game-draw .art-gallery-item img, #game-paint .art-gallery-item img {
    display: block; width: 100%; height: auto;
}
#game-draw .art-gallery-btns, #game-paint .art-gallery-btns {
    display: flex; gap: 2px; padding: 3px;
    border-top: 2px solid var(--ink);
}
#game-draw .art-gbtn, #game-paint .art-gbtn {
    -webkit-appearance: none; appearance: none;
    flex: 1 1 0;
    min-height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 9px;
    border: 2px solid var(--ink);
    background: #EFE9FF;
    color: var(--ink);
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}
#game-draw .art-gbtn svg, #game-paint .art-gbtn svg { width: 18px; height: 18px; }
#game-draw .art-gbtn-del, #game-paint .art-gbtn-del { background: #FFD5D5; }
#game-draw .art-gallery-empty, #game-paint .art-gallery-empty {
    grid-column: 1 / -1;
    padding: 30px 12px;
    text-align: center;
    color: var(--ink);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.5;
    opacity: .8;
}
#game-paint .art-picker-item {
    -webkit-appearance: none; appearance: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 4px 4px 5px;
    border-radius: 14px;
    border: 2.5px solid var(--ink);
    border-bottom-width: 5px;
    background: #fff;
    cursor: pointer;
}
#game-paint .art-picker-item.active {
    background: linear-gradient(180deg, #FFF0BE 0%, var(--sun) 100%);
    box-shadow: 0 0 0 3px rgba(255, 210, 63, .5);
}
#game-paint .art-picker-item canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 9px;
}
#game-paint .art-picker-item span {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 12px;
    color: var(--ink);
    line-height: 1.15;
}
#game-paint .art-picker-lvl {
    font-family: 'Nunito', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--ink-soft);
    opacity: .75;
}

/* ---------- telas largas / paisagem ---------- */
@media (min-width: 620px) {
    #game-draw .art-tools { grid-template-columns: repeat(13, 1fr); }
    #game-draw .art-colors, #game-paint .art-colors { grid-template-columns: repeat(20, 1fr); }
}
@media (orientation: landscape) and (max-height: 500px) {
    #game-draw .art-tools { grid-template-columns: repeat(13, 1fr); }
    #game-draw .art-tool, #game-paint .art-tool { min-height: 46px; }
    #game-draw .art-tool small, #game-paint .art-tool small { display: none; }
    #game-draw .art-sub, #game-paint .art-sub { min-height: 44px; }
    #game-draw .art-size, #game-paint .art-size,
    #game-draw .art-shape, #game-draw .art-paper { height: 42px; }
    #game-draw .art-color, #game-paint .art-color { height: 34px; }
    #game-draw .art-colors, #game-paint .art-colors { grid-template-columns: repeat(20, 1fr); }
    #game-draw .art-head, #game-paint .art-head { min-height: 46px; }
    #game-draw .art-abtn, #game-paint .art-abtn { width: 40px; height: 40px; }
    #game-draw .art-abtn.art-back, #game-paint .art-abtn.art-back { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    #game-draw *, #game-paint * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- zoom da folha ----------
   Fica flutuando sobre o canto do canvas: a pinca de dois dedos e o caminho
   natural, mas quem usa mouse (ou nao descobre a pinca) precisa de botao. */
#game-draw .art-zoom, #game-paint .art-zoom {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .88);
    border: 2px solid var(--ink);
    box-shadow: 0 3px 0 var(--ink-soft);
    z-index: 4;
}
#game-draw .art-zbtn, #game-paint .art-zbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font: 700 13px/1 inherit;
    cursor: pointer;
}
#game-draw .art-zbtn:active, #game-paint .art-zbtn:active { background: rgba(0, 0, 0, .08); }
/* Realca o "ver a folha inteira" so quando ha zoom para desfazer. */
#game-draw .art-zfit.active, #game-paint .art-zfit.active {
    background: var(--accent, #FF9800);
    color: #fff;
}

/* ---------- Ateliê Avançado (editor externo em iframe) ---------- */
#game-atelieplus { display: none; flex-direction: column; }
#game-atelieplus.active { display: flex; }
#game-atelieplus .atelie-plus-wrap {
    position: relative;
    flex: 1 1 0;
    min-height: 120px;
    overflow: hidden;
    background: #f2f4f7;
}
#game-atelieplus iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
#game-atelieplus .atelie-plus-aviso {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    background: #fff;
    font-size: 15px;
    line-height: 1.45;
}

/* ---------- carimbos (figuras 3D) ---------- */
#game-draw .art-stickers, #game-stampart .art-stickers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}
.art-sticker-cats {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
}
.art-sticker-cats::-webkit-scrollbar { display: none; }
.art-sticker-cat {
    flex: 0 0 auto;
    padding: 4px 11px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    background: #fff;
    color: var(--ink);
    font: 800 12px/1.5 'Nunito', sans-serif;
    cursor: pointer;
}
.art-sticker-cat.active { background: var(--sun, #FFD23F); }
.art-sticker-list {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.art-sticker-list::-webkit-scrollbar { display: none; }
.art-sticker-list .art-sticker {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    padding: 3px;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 2.5px solid var(--ink);
    border-bottom-width: 4px;
    background: #fff;
    cursor: pointer;
}
.art-sticker-list .art-sticker img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.art-sticker-list .art-sticker.active { background: var(--sun, #FFD23F); box-shadow: 0 0 0 3px rgba(255, 210, 63, .35); }
.art-sticker-vazio { font: 700 13px 'Nunito', sans-serif; opacity: .7; padding: 6px; }

/* Celular deitado: o layout global vira barras laterais em coluna. A faixa que
   rola de lado nao faz sentido ali, entao as regras de rolagem sao desfeitas. */
@media (orientation: landscape) and (max-height: 540px) {
    #game-draw .art-tools, #game-paint .art-tools,
    #game-draw .art-colors, #game-paint .art-colors {
        flex-wrap: wrap;
        overflow-x: hidden;
        -webkit-mask-image: none;
        mask-image: none;
    }
    #game-draw .art-tool, #game-paint .art-tool { width: auto; }
    #game-draw .art-color, #game-paint .art-color { width: 30px; }
}
