/* Boop Paint's colours and its own parts; everything else is shared/game/game-ui.css (loaded first). */
:root{
    --bg: #7b5cff;
    --title: #ffd23f;
    --panel: rgba(60, 40, 140, .84);
    --panel-center: rgba(60, 40, 140, .8);
    --panel-edge: rgba(60, 40, 140, .25);
    --dialog: #3d2b8f;
}

/*
 * Coloring is tapping and drawing: no pinch zoom, no iPhone magnifier, no page scroll. Only the lists scroll.
 */
html,
body{
    touch-action: none;
}

.game-canvas{
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.ranks__list,
.missions__list,
.skins__grid,
.whats-new__list,
.pick__grid{
    touch-action: pan-y;
}

.hud__score{
    text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}

/* ---------- Tools and crayons ---------- */
.paintbar{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px max(8px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: rgba(40, 25, 110, .55);
}

.paintbar[hidden]{
    display: none;
}

.paintbar__tools{
    display: flex;
    gap: 6px;
}

.paintbar .tool{
    width: 60px;
    height: 54px;
    font-size: 22px;
}

.paintbar .tool[aria-pressed="true"]{
    background: rgba(255, 255, 255, .32);
    border-color: #fff;
}

.paintbar .tool:disabled{
    opacity: .4;
}

.tool--done{
    color: var(--accent-text);
    background: var(--accent);
    border-color: var(--accent);
}

.palette{
    max-width: 330px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.swatch{
    width: 36px;
    height: 36px;
    padding: 0;
    border: 3px solid rgba(255, 255, 255, .8);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
    transition: transform .1s;
}

.swatch[aria-checked="true"]{
    border-color: #fff;
    outline: 3px solid var(--accent);
    transform: scale(1.15);
}

.swatch:focus-visible{
    outline: 3px solid var(--accent);
}

@container (max-width: 360px){
    .paintbar .tool{
        width: 54px;
        height: 50px;
        font-size: 20px;
    }

    .swatch{
        width: 32px;
        height: 32px;
    }
}

@container (min-width: 700px) and (max-height: 700px){
    .palette{
        max-width: 720px;
    }
}

/* ---------- Pick a picture ---------- */
.panel[data-panel="pick"]{
    justify-content: flex-start;
    padding-top: max(64px, calc(env(safe-area-inset-top) + 54px));
    padding-bottom: 0;
}

.pick__title{
    font-size: 26px;
    font-weight: bold;
    color: var(--title);
    text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}

.pick__grid{
    width: 100%;
    max-width: 760px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    align-content: start;
    gap: 12px;
    padding: 4px 4px max(24px, env(safe-area-inset-bottom));
}

.card{
    position: relative;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #2b2340;
    font: bold 13px/1.1 var(--font);
    background: #fff;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
    transition: transform .1s;
}

.card:active{
    transform: scale(.95);
}

.card__art{
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
}

.card.is-locked .card__art{
    opacity: .35;
}

.card__lock{
    position: absolute;
    left: 6px;
    right: 6px;
    top: 30%;
    font-size: 12px;
    color: #2b2340;
}

.card__lock b{
    display: block;
    font-size: 28px;
}

.card__badge{
    position: absolute;
    top: -6px;
    right: -6px;
    padding: 3px 7px;
    font-size: 11px;
    color: var(--accent-text);
    background: var(--accent);
    border-radius: 999px;
}

.card__badge--done{
    color: #fff;
    background: #38b26b;
}

/* ---------- Done ---------- */
.done__art{
    /* The living sticker: no frame, it stands on the panel. Tap it and it plays again. */
    width: min(240px, 30cqh);
    height: min(240px, 30cqh);
    cursor: pointer;
    touch-action: manipulation;
}

.panel[data-panel="over"] .panel__title{
    font-size: clamp(34px, 10cqmin, 54px);
}

.panel[data-panel="over"]{
    gap: 10px;
}

@keyframes pop-in{
    from{ transform: scale(.6) rotate(-6deg); opacity: 0; }
}

/* ---------- Boop World ---------- */
.worldbar{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px max(8px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: rgba(40, 25, 110, .55);
}

.worldbar[hidden]{
    display: none;
}

.worldbar .round:disabled{
    opacity: .35;
}

/* ---------- Magic crayons ---------- */
.swatch--magic{
    position: relative;
    display: grid;
    place-items: center;
    font-size: 15px;
    line-height: 1;
    border-color: #ffd23f;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .25), 0 0 8px rgba(255, 210, 63, .7);
}

.swatch--magic[aria-pressed="true"]{
    border-color: #fff;
    outline: 3px solid #ff5bd1;
    transform: scale(1.15);
}

.swatch--magic.is-locked{
    background: rgba(255, 255, 255, .25) !important;
    border-color: rgba(255, 255, 255, .5);
    box-shadow: none;
    font-size: 14px;
}

/* ---------- The picture calls: Done glows once it would count ---------- */
.tool--done.is-ready{
    animation: ready-glow 1.1s ease-in-out infinite;
}

@keyframes ready-glow{
    50%{
        transform: scale(1.08);
        box-shadow: 0 0 0 4px rgba(255, 255, 255, .7), 0 0 18px rgba(255, 210, 63, .95);
    }
}

/* The Done panel's smaller buttons go two to a row, even on a narrow phone. */
.panel[data-panel="over"] .panel__row .button{
    min-height: 40px;
    padding: 0 13px;
    font-size: 15px;
}

.panel[data-panel="over"] .panel__row{
    gap: 6px;
}
