@font-face {
    font-family: 'Nunito';
    src: url('./assets/Nunito-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Nunito';
    src: url('./assets/Nunito-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}
html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Nunito', sans-serif;
    background-color: #000000;
    color: #ffffff;
    overflow: hidden;
    touch-action: manipulation;
}
html,
body,
.screen {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}
@supports (-webkit-touch-callout: none) {
    .pixel-grid-container {
        touch-action: none;
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        perspective: 1000;
        will-change: transform;
    }
    .pixel-grid-scale-container {
        transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        will-change: transform;
    }
    .pixel {
        will-change: transform, display;
        transform: translateZ(0);
    }
    body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
    }
}
#gameWrapper {
    width: 1080px;
    height: 1920px;
    background: #181818;
    position: absolute;
    left: var(--viewport-center-x, 50%);
    top: var(--viewport-center-y, 50%);
    transform-origin: center center;
    transform: translate(-50%, -50%) scale(var(--scale-factor, 0.5));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.5s ease;
}
.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
}
.play-button {
    position: absolute;
    width: 600px;
    height: 200px;
    left: 240px;
    top: 1308px;
    background: url('./assets/button.png') no-repeat center center;
    background-size: contain;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
    font-size: 70px;
    color: #FFC647;
    text-shadow: 0 5px 0 #00000080;
    cursor: pointer;
    transition: background-image 0.1s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}
.play-button:hover {
    background-image: url('./assets/button_hover.png');
    color: #000000;
    text-shadow: 0 5px 0 #FFCC0080;
}
.play-button:active {
    background-image: url('./assets/button_hover.png');
    color: #000000;
    text-shadow: 0 5px 0 #FFCC0080;
    transform: translateY(5px);
}
.achievements-button {
    position: absolute;
    width: 200px;
    height: 200px;
    left: 160px;
    top: 1570px;
    background: url('./assets/button_achievement.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: background-image 0.1s ease;
}
.achievements-button:hover {
    background-image: url('./assets/button_achievement_hover.png');
}
.achievements-button:active {
    transform: translateY(5px);
}
.help-button {
    position: absolute;
    width: 200px;
    height: 200px;
    left: 440px;
    top: 1570px;
    background: url('./assets/button_help.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: background-image 0.1s ease;
}
.help-button:hover {
    background-image: url('./assets/button_help_hover.png');
}
.help-button:active {
    transform: translateY(5px);
}
.properties-button-main {
    position: absolute;
    width: 200px;
    height: 200px;
    left: 720px;
    top: 1570px;
    background: url('./assets/button_properties.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: background-image 0.1s ease;
}
.properties-button-main:hover {
    background-image: url('./assets/button_properties_hover.png');
}
.properties-button-main:active {
    transform: translateY(5px);
}
.game-heading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
}
#start-menu {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: url('assets/back_mainmenu.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}
.curtain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}
.curtain {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    transition: none;
    z-index: 3001;
}
.curtain-left {
    left: 0;
    background-image: url('./assets/curtain.png');
    background-position: right;
    transform: translateX(-100%);
}
.curtain-right {
    right: 0;
    background-image: url('./assets/curtain.png');
    background-position: left;
    transform: translateX(100%);
}
@keyframes curtain-close-left {
    0% {
        transform: translateX(-540px);
        opacity: 0;
    }
    40% {
        transform: translateX(-5px);
        opacity: 1;
    }
    60% {
        transform: translateX(-50px);
    }
    80% {
        transform: translateX(0px);
    }
    100% {
        transform: translateX(0);
    }
}
@keyframes curtain-close-right {
    0% {
        transform: translateX(540px);
        opacity: 0;
    }
    40% {
        transform: translateX(5px);
        opacity: 1;
    }
    60% {
        transform: translateX(50px);
    }
    80% {
        transform: translateX(0px);
    }
    100% {
        transform: translateX(0);
    }
}
@keyframes curtain-open-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}
@keyframes curtain-open-right {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}
.curtains-closing .curtain-left {
    transform: translateX(0);
    animation: curtain-close-left 0.6s ease-out both;
    will-change: transform;
}
.curtains-closing .curtain-right {
    transform: translateX(0);
    animation: curtain-close-right 0.6s ease-out both;
    will-change: transform;
}
/* The initial state on load: the curtains are closed with no animation */
.curtains-closed .curtain-left,
.curtains-closed .curtain-right {
    transform: translateX(0);
}
#boot-loader {
    position: absolute;
    left: 240px;
    top: 946px;
    width: 600px;
    height: 28px;
    box-sizing: content-box;
    border: 5px solid #FFB700;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.6);
    overflow: hidden;
    z-index: 10000;
    transition: opacity 0.3s ease;
}
#boot-loader.done {
    opacity: 0;
}
.boot-loader-bar {
    width: 0;
    height: 100%;
    background: #FFB700;
    transition: width 0.2s linear;
}
.curtains-opening .curtain-left {
    animation: curtain-open-left 0.6s cubic-bezier(0.85, 0, 0.15, 1) forwards;
    will-change: transform;
}
.curtains-opening .curtain-right {
    animation: curtain-open-right 0.6s cubic-bezier(0.85, 0, 0.15, 1) forwards;
    will-change: transform;
}
#game-screen {
    position: relative;
    background-image: url('assets/back_game.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}
.game-background {
    position: absolute;
    top: 200px;
    left: 50%;
    transform: translateX(-50%);
    width: 1080px;
    height: 1440px;
    background-color: #111111;
    z-index: 1;
}
.game-back-button {
    position: absolute;
    width: 160px;
    height: 160px;
    left: 20px;
    top: 20px;
    background: url('./assets/button_back.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: background-image 0.1s ease;
    z-index: 10;
}
.game-back-button:hover {
    background-image: url('./assets/button_back_hover.png');
}
.game-back-button:active {
    transform: translateY(5px);
}
.game-properties-button {
    position: absolute;
    width: 160px;
    height: 160px;
    left: 205px;
    top: 20px;
    background: url('./assets/button_properties2.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: background-image 0.1s ease;
    z-index: 10;
}
.game-properties-button:hover {
    background-image: url('./assets/button_properties2_hover.png');
}
.game-properties-button:active {
    transform: translateY(5px);
}
.game-paintbucket-button {
    position: absolute;
    width: 160px;
    height: 160px;
    right: 20px;
    top: 20px;
    background: url('./assets/button_paintbucket_off.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    z-index: 10;
}
.game-paintbucket-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/button_paintbucket_border.png') no-repeat center center;
    background-size: contain;
    opacity: 0;
    transition: opacity 0.1s ease;
    pointer-events: none;
    z-index: 2;
}
.game-paintbucket-button.active::before {
    opacity: 1;
}
.game-paintbucket-button:not(.active):active::before {
    opacity: 1;
}
.game-paintbucket-button.active:active::before {
    opacity: 0;
}
.game-paintbucket-button:hover {
    background-image: url('./assets/button_paintbucket_hover.png');
}
.game-paintbucket-button.active {
    background-image: url('./assets/button_paintbucket_on.png');
}
.game-paintbucket-button.active:hover {
    background-image: url('./assets/button_paintbucket_hover.png');
}
.game-paintbucket-button:active {
    transform: translateY(5px);
}
.game-paintbucket-button:active::before {
    transform: translateY(0);
}
.game-heading-container {
    position: absolute;
    top: 30px;
    width: 550px;
    left: calc(365px + (900px - 365px) / 2);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-align: center;
    border: none;
}
.game-image-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 55px;
    color: #D35F00;
    text-align: center;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}
.game-progress-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 12px;
}
.game-completed {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 42px;
    color: #FFFFFF;
    line-height: 1;
    margin: 0;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}
.game-separator {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 42px;
    color: #FFB700;
    line-height: 1;
    margin: 0 8px;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}
.game-total {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 42px;
    color: #FFB700;
    line-height: 1;
    margin: 0;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}
.pixel-canvas {
    position: absolute;
    z-index: 10;
}
.pixel-grid-container {
    position: relative;
    z-index: 5;
    top: 200px;
    left: 50%;
    transform: translateX(-50%);
    cursor: grab;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    transform-origin: 0 0;
    touch-action: none;
    -webkit-touch-callout: none;
}
.pixel-grid-container:active {
    cursor: grabbing;
}
.pixel-grid-scale-container {
    position: relative;
    margin: 0 auto;
    cursor: inherit;
}
.pixel {
    position: absolute;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pixel-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: bold;
    user-select: none;
    pointer-events: none;
}
.pixel.highlighted {
    cursor: pointer;
}
.pixel.activated {
    background-color: #111111;
    border: none;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    contain: strict;
}
.pixel-cross {
    pointer-events: none;
    position: absolute;
    z-index: 1;
}
.pixel-cross.animating {
    animation: cross-appear 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.pixel:not(.highlighted):not(.activated) {
    cursor: grab;
}
@keyframes cross-appear {
    0% {
        transform: scale(0.5);
        opacity: 0.2;
    }
    70% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
@keyframes cross-appear-fixed {
    0% {
        transform: scale(0.5);
        opacity: 0.2;
    }
    70% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.pixel-cross-anim {
    pointer-events: none;
    z-index: 1000;
}
.color-palette {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.palette-container {
    position: relative;
    width: 950px;
    height: 235px;
}
.palette-pages-wrapper {
    position: relative;
    display: flex;
    width: 950px;
    height: 100%;
    transition: transform 0.3s ease-out;
    will-change: transform;
}
.palette-page {
    display: grid;
    grid-template-columns: repeat(5, 180px);
    grid-template-rows: repeat(2, 110px);
    gap: 15px;
    justify-content: center;
    align-content: center;
    flex-shrink: 0;
    width: 950px;
    margin-right: 25px;
}
.color-button {
    position: relative;
    width: 180px;
    height: 110px;
    border: none;
    cursor: pointer;
    background: url('./assets/colorpicker0.png') no-repeat center center;
    background-size: 180px 110px;
    transition: background-image 0.1s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}
.color-button:hover {
    background-image: url('./assets/colorpicker1.png');
}
.color-button.active {
    background-image: url('./assets/colorpicker1.png');
}
.color-button:active {
    transform: translateY(5px);
    background-image: url('./assets/colorpicker1.png');
}
.color-button.active:active {
    transform: translateY(5px);
    background-image: url('./assets/colorpicker1.png');
}
.color-button.completed:active {
    transform: translateY(5px);
    background-image: url('./assets/colorpicker1.png');
}
.color-button.completed.active:active {
    transform: translateY(5px);
    background-image: url('./assets/colorpicker1.png');
}
.button-content {
    position: relative;
    width: 148px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0;
}
.color-button .button-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: inherit;
    z-index: 1;
}
.color-number {
    position: relative;
    z-index: 3;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 36px;
    pointer-events: none;
    transform: translateY(-5px);
    opacity: 0.5;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}
.progress-container {
    position: absolute;
    bottom: 5px;
    left: 5px;
    right: 5px;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0;
    z-index: 2;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 0;
}
.color-button.completed {
    opacity: 0.5;
    filter: grayscale(100%);
    transition: opacity 0.2s ease, filter 0.2s ease, transform 0.1s ease;
}
.color-button.completed:active {
    transform: translateY(5px);
}
.color-button.completed .button-content {
    filter: none !important;
}
.color-button.completed .color-number {
    color: #000000 !important;
    opacity: 0.5;
}
.color-button.completed .progress-fill {
    background-color: #666666 !important;
    opacity: 0.5 !important;
}
.color-button.completed.active .button-content {
    opacity: 1;
    box-sizing: border-box;
}
.properties-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}
.properties-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 48px;
    color: #D35F00;
    margin: 40px 0;
    text-align: center;
}
.settings-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 24px;
}
.theme-container {
    flex-direction: column;
    align-items: flex-start;
}
.theme-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
}
.radio-option {
    display: flex;
    align-items: center;
    margin: 8px 0;
}
.radio-option input[type="radio"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}
.switch-container {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked+.slider {
    background-color: #4CAF50;
}
input:focus+.slider {
    box-shadow: 0 0 1px #4CAF50;
}
input:checked+.slider:before {
    transform: translateX(26px);
}
#properties-screen {
    background-image: url('assets/back_properties.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
    position: relative;
}
.properties-heading {
    position: absolute;
    top: 55px;
    left: 600px;
    transform: translateX(-50%);
    font-size: 75px;
    color: #D35F00;
    margin: 0;
    line-height: 1.2;
    font-weight: 900;
    text-align: center;
    width: auto;
}
.property-switch-container {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 500px;
    left: 50%;
    transform: translateX(-50%);
}
.property-switch-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 55px;
    color: #D35F00;
}
.property-switch {
    width: 120px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
}
.property-switch.on {
    background-image: url('assets/switch_on.png');
}
.property-switch.off {
    background-image: url('assets/switch_off.png');
}
.marker-type-container {
    position: absolute;
    top: 770px;
    width: 500px;
    left: 50%;
    transform: translateX(-50%);
}
.marker-type-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 55px;
    color: #D18B4B;
    margin-bottom: 30px;
}
.marker-option {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    cursor: pointer;
}
.marker-image-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-right: 30px;
}
.marker-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}
.marker-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/marker_border.png');
    background-size: contain;
    background-repeat: no-repeat;
    display: none;
}
.marker-option.selected .marker-border {
    display: block;
}
.marker-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 55px;
    color: #8C5726;
}

/* Progress reset: the button has to be held until the bar above it fills up.
   The bar hides behind the button and slides up, as in Ploppio. */
.reset-progress-zone {
    position: absolute;
    top: 1510px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 290px;
    user-select: none;
    -webkit-user-select: none;
}
.reset-progress-hint {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    /* The same size as the Marker type: heading */
    font-size: 55px;
    line-height: 66px;
    color: #8C5726;
    text-align: center;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}
.reset-progress-zone.holding .reset-progress-hint,
.reset-progress-zone.done .reset-progress-hint {
    opacity: 0;
}
.reset-progress-bar {
    position: absolute;
    top: 30px;
    left: 50%;
    width: 300px;
    height: 40px;
    padding: 5px;
    box-sizing: border-box;
    border-radius: 20px;
    background: #1C0E0E;
    border: 3px solid #8C5726;
    overflow: hidden;
    z-index: 1;
    /* Hidden behind the centre of the button */
    transform: translate(-50%, 140px);
    transition: transform 0.26s ease-in;
}
.reset-progress-zone.holding .reset-progress-bar,
.reset-progress-zone.done .reset-progress-bar {
    transform: translate(-50%, 0);
    /* Slides out with a slight overshoot (the equivalent of Back.easeOut) */
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reset-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(to bottom, #FF6A4D, #D32F1E);
}
.reset-progress-button {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 347px;
    height: 180px;
    z-index: 2;
    background: url('assets/button2.png') no-repeat center center;
    background-size: contain;
    border: none;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
    font-size: 50px;
    line-height: 52px;
    text-wrap: balance;
    color: #FFC647;
    text-shadow: 0 5px 0 rgba(0, 0, 0, 0.5);
    cursor: pointer;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.reset-progress-button:hover {
    background-image: url('assets/button2_hover.png');
    color: #000000;
    text-shadow: 0 5px 0 rgba(255, 204, 0, 0.5);
}
.reset-progress-zone.holding .reset-progress-button {
    transform: translateX(-50%) translateY(5px);
}
#sections-screen {
    background-image: url('assets/back_category.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}
.header-panel {
    display: flex;
    align-items: center;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}
.sections-back-button {
    position: absolute;
    width: 160px;
    height: 160px;
    left: 35px;
    top: 20px;
    background: url('./assets/button_back.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: background-image 0.1s ease;
}
.sections-back-button:hover {
    background-image: url('./assets/button_back_hover.png');
}
.sections-back-button:active {
    transform: translateY(5px);
}
.sections-heading {
    position: absolute;
    top: 63px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 60px;
    color: #D35F00;
    margin: 0;
    line-height: 1.2;
    font-weight: 900;
    text-align: center;
    width: auto;
}
.sections-container {
    position: relative;
    width: 950px;
    height: 1350px;
    margin: 0 auto;
    margin-top: 278px;
    box-sizing: border-box;
    overflow: hidden;
    cursor: grab;
}
.sections-container:active {
    cursor: grabbing;
}
.sections-pages-wrapper {
    position: relative;
    display: flex;
    width: 950px;
    height: 100%;
    transition: transform 0.3s ease-out;
    will-change: transform;
}
.sections-page {
    position: relative;
    width: 950px;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px !important;
    padding: 20px;
    box-sizing: border-box;
    flex-shrink: 0;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}
.sections-page.slide-left {
    transform: translateX(-100%);
    opacity: 0;
}
.sections-page.slide-right {
    transform: translateX(100%);
    opacity: 0;
}
.sections-page.slide-from-left {
    transform: translateX(-100%);
    opacity: 0;
}
.section-button {
    width: 431px;
    height: 652px;
    background: url('./assets/button_category.png') no-repeat center center;
    background-size: contain;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    box-sizing: border-box;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-self: center;
    align-self: center;
}
.section-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/button_category_hover.png') no-repeat center center;
    background-size: contain;
    opacity: 0;
    transition: opacity 0.1s ease;
    pointer-events: none;
    z-index: 1;
}
.section-button:hover::before {
    opacity: 1;
}
.section-button:active {
    transform: translateY(5px);
}
.section-title-container,
.section-image-container,
.section-progress-container {
    position: relative;
    z-index: 2;
}
.section-title-container {
    width: 100%;
    height: 118px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    /* The dark plate under the title on button_category.png — x 60…372:
       a long translation is shrunk to its width, not to the width of the whole card */
    padding: 10px 72px;
}
.section-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 32px;
    color: #F6CA66;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    /* A long translation (Fantastic creatures) wraps onto a second line — the
       plate has room for two; data-fit shrinks the font only when a single word
       does not fit */
    white-space: normal;
    line-height: 34px;
    max-height: 68px;
    text-wrap: balance;
    overflow-wrap: normal;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.8);
    margin-top: 22px;
}
.section-image-container {
    width: 100%;
    height: 416px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 8px;
}
.section-image {
    width: 300px;
    height: 400px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 8px;
}
.section-progress-container {
    width: 100%;
    height: 118px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    gap: 0;
    margin-top: -18px;
}
.section-completed {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 36px;
    color: #FFFFFF;
    line-height: 1;
    margin: 0;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.8);
}
.section-separator {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 36px;
    color: #FFB700;
    line-height: 1;
    margin: 0 8px;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.8);
}
.section-total {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 36px;
    color: #FFB700;
    line-height: 1;
    margin: 0;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.8);
}
.sections-paginator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 112px;
}
.paginator-arrow {
    width: 126px;
    height: 126px;
    border: none;
    cursor: pointer;
    transition: background-image 0.1s ease;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent !important;
    outline: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.paginator-arrow.left {
    background-image: url('./assets/button_arrow_left.png');
}
.paginator-arrow.left:hover {
    background-image: url('./assets/button_arrow_left_hover.png');
}
.paginator-arrow.right {
    background-image: url('./assets/button_arrow_right.png');
}
.paginator-arrow.right:hover {
    background-image: url('./assets/button_arrow_right_hover.png');
}
.paginator-arrow:active {
    transform: translateY(3px);
}
.paginator-info {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 48px;
    color: #F6CA66;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}
#pictures-screen {
    background-image: url('assets/back_category.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}
.gallery-container {
    position: relative;
    width: 950px;
    height: 1350px;
    margin: 0 auto;
    margin-top: 300px;
    box-sizing: border-box;
    overflow: hidden;
    cursor: grab;
}
.gallery-container:active {
    cursor: grabbing;
}
.gallery-pages-wrapper {
    position: relative;
    display: flex;
    transition: transform 0.3s ease-out;
}
.gallery-page {
    position: relative;
    width: 950px;
    height: 100%;
    flex-shrink: 0;
    opacity: 1;
    box-sizing: border-box;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 40px;
    padding: 20px 60px;
    width: 100%;
    height: 100%;
    justify-items: center;
    align-items: center;
    box-sizing: border-box;
}
.picture-preview {
    width: 250px;
    height: 400px;
    background: url('./assets/button_frame.png') no-repeat center center;
    background-size: contain;
    border: none;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    transition: transform 0.1s ease;
}
.picture-preview:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/button_frame_hover.png') no-repeat center center;
    background-size: contain;
    z-index: 1;
    pointer-events: none;
}
.picture-preview:active {
    transform: translateY(5px);
}
.image-preview {
    width: 207px;
    height: 276px;
    margin: 18px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
}
.image-content {
    max-width: 100%;
    max-height: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
    transform: translateZ(0);
}
.image-title {
    width: 100%;
    height: 100px;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transform: translateY(-12px);
    gap: 4px;
}
.image-description {
    width: 100%;
    color: #D35F00;
    font-size: 27px;
    overflow: hidden;
    /* A long title wraps onto a second line within the dark plate of the frame
       (button_frame.png, x 16…234) */
    white-space: normal;
    text-wrap: balance;
    padding: 0 24px;
    box-sizing: border-box;
    max-height: 50px;
    line-height: 25px;
}
.image-details {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 24px;
    line-height: 1;
}
.image-size {
    color: #FFFFFF;
    white-space: nowrap;
}
.image-colors {
    color: #D18B4B;
    white-space: nowrap;
}
.paginator-container {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 112px;
}
.pictures-back-button {
    position: absolute;
    width: 160px;
    height: 160px;
    left: 35px;
    top: 20px;
    background: url('./assets/button_back.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: background-image 0.1s ease;
}
.pictures-back-button:hover {
    background-image: url('./assets/button_back_hover.png');
}
.pictures-back-button:active {
    transform: translateY(5px);
}
.pictures-progress-container {
    position: absolute;
    top: 75px;
    right: 50px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.pictures-completed {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 60px;
    color: #FFFFFF;
    line-height: 1;
    margin: 0;
}
.pictures-separator {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 60px;
    color: #FFB700;
    line-height: 1;
    margin: 0 8px;
}
.pictures-total {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 60px;
    color: #FFB700;
    line-height: 1;
    margin: 0;
}
.picture-preview:not(.completed) .image-content {
    filter: grayscale(100%) brightness(0.3);
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.picture-preview.completed .image-content {
    filter: none;
    opacity: 1;
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.image-preview {
    position: relative;
    overflow: hidden;
}
.flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease-in;
}
.flash-overlay.appearing {
    opacity: 1;
}
.flash-overlay.fading {
    opacity: 0;
    transition: opacity 1.5s ease-out;
}
.victory-transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
    transition: opacity 1.6s ease-in-out;
}
.victory-transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
#victory-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    background-image: url('assets/back_victory.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* z-index: 1000; */
    display: none;
    align-items: center;
    justify-content: center;
}
#victory-screen.active {
    display: flex;
}
.pixel-replay-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: transparent;
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform;
}
.victory-pixel {
    position: absolute;
    background-color: transparent;
    transition: background-color 0.1s ease-in;
    box-sizing: border-box;
    border: none;
    opacity: 0;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, opacity;
}
.victory-pixel-marker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease-out;
}
.victory-pixel.pixel-animated .victory-pixel-marker {
    opacity: 1;
    transform: scale(1);
}
@keyframes victory-pixel-appear {
    0% {
        transform: scale(0.5);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.victory-pixel.pixel-animated {
    animation: victory-pixel-appear 0.3s ease-out forwards;
    animation-play-state: running;
    animation-fill-mode: forwards;
    z-index: 5;
    opacity: 1;
    background-color: transparent !important;
}
.victory-pixel.animation-completed {
    animation: none !important;
    transform: scale(1);
    opacity: 1;
}
.victory-pixel.pixel-animated.sparkling {
    animation: pixel-sparkle 1s ease-in-out !important;
    transform: scale(1);
    opacity: 1;
}
@keyframes pixel-sparkle {
    0% {
        filter: brightness(1);
    }
    10% {
        filter: brightness(2.5);
    }
    40% {
        filter: brightness(2);
    }
    70% {
        filter: brightness(1.5);
    }
    100% {
        filter: brightness(1);
    }
}
.victory-pixel.sparkling {
    animation: pixel-sparkle 1s ease-out;
    animation-fill-mode: forwards;
    will-change: filter;
}
.victory-heading-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}
.victory-main-heading {
    font-size: 65px;
    color: #870000;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 85px;
    width: 100%;
    text-align: center;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
}
.victory-sub-heading {
    font-size: 45px;
    color: #F6CA66;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 170px;
    width: 100%;
    text-align: center;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
}
.victory-image-title {
    font-size: 60px;
    color: #0D0803;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 270px;
    width: 100%;
    text-align: center;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
}
.victory-gallery-button {
    position: absolute;
    width: 600px;
    height: 200px;
    left: 50%;
    bottom: 150px;
    transform: translateX(-50%);
    background: url('./assets/button.png') no-repeat center center;
    background-size: contain;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
    font-size: 60px;
    color: #FFC647;
    text-shadow: 0 5px 0 #00000080;
    cursor: pointer;
    transition: background-image 0.1s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    z-index: 101;
}
.victory-gallery-button:hover {
    background-image: url('./assets/button_hover.png');
    color: #000000;
    text-shadow: 0 5px 0 #FFCC0080;
}
.victory-gallery-button:active {
    background-image: url('./assets/button_hover.png');
    color: #000000;
    text-shadow: 0 5px 0 #FFCC0080;
    transform: translateX(-50%) translateY(5px);
}
#sections-screen,
#pictures-screen,
#properties-screen,
#replay-screen,
#victory-screen,
#achievements-screen,
#help-screen,
.properties-button-main,
.help-button,
.achievements-button,
.sections-page,
.gallery-page,
.section-button,
.section-title,
.section-title-container,
.section-progress-container,
.picture-preview,
.image-title,
.image-description,
.image-details,
.paginator-info,
.pictures-progress-container,
.property-switch-container,
.property-switch-label,
.property-switch,
.marker-type-container,
.marker-type-heading,
.marker-option,
.marker-image-container,
.marker-border,
.victory-main-heading,
.victory-sub-heading,
.victory-image-title,
.replay-button,
.replay-back-button,
.save-button,
.marker-label,
.help-text-block {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}
@media (hover: none) {
    .play-button {
        background-image: url('./assets/button.png') !important;
        color: #FFC647 !important;
        text-shadow: 0 5px 0 #00000080 !important;
        transform: none !important;
    }
    .play-button:active {
        background-image: url('./assets/button_hover.png') !important;
        color: #000000 !important;
        text-shadow: 0 5px 0 #FFCC0080 !important;
        transform: translateY(5px) !important;
    }
    .achievements-button {
        background-image: url('./assets/button_achievement.png') !important;
        transform: none !important;
    }
    .achievements-button:active {
        background-image: url('./assets/button_achievement_hover.png') !important;
        transform: translateY(5px) !important;
    }
    .help-button {
        background-image: url('./assets/button_help.png') !important;
        transform: none !important;
    }
    .help-button:active {
        background-image: url('./assets/button_help_hover.png') !important;
        transform: translateY(5px) !important;
    }
    .properties-button-main {
        background-image: url('./assets/button_properties.png') !important;
        transform: none !important;
    }
    .properties-button-main:active {
        background-image: url('./assets/button_properties_hover.png') !important;
        transform: translateY(5px) !important;
    }
    .paginator-arrow.left {
        background-image: url('./assets/button_arrow_left.png') !important;
        transform: none !important;
    }
    .paginator-arrow.left:active {
        background-image: url('./assets/button_arrow_left_hover.png') !important;
        transform: translateY(3px) !important;
    }
    .paginator-arrow.right {
        background-image: url('./assets/button_arrow_right.png') !important;
        transform: none !important;
    }
    .paginator-arrow.right:active {
        background-image: url('./assets/button_arrow_right_hover.png') !important;
        transform: translateY(3px) !important;
    }
    .section-button::before {
        opacity: 0 !important;
    }
    .section-button:active::before {
        opacity: 1 !important;
    }
    .section-button:active {
        transform: translateY(5px) !important;
    }
    .picture-preview::before {
        opacity: 0 !important;
    }
    .picture-preview:active::before {
        opacity: 1 !important;
    }
    .picture-preview:active {
        transform: translateY(5px) !important;
    }
    .color-button {
        background-image: url('./assets/colorpicker0.png') !important;
    }
    .color-button:not(.active):active {
        background-image: url('./assets/colorpicker1.png') !important;
        transform: translateY(5px) !important;
    }
    .color-button.active {
        background-image: url('./assets/colorpicker1.png') !important;
    }
    .color-button.active:active {
        background-image: url('./assets/colorpicker0.png') !important;
        transform: translateY(5px) !important;
    }
    .color-button.completed {
        opacity: 0.5 !important;
        filter: grayscale(100%) !important;
    }
    .color-button.completed:active {
        transform: translateY(5px) !important;
    }
    .game-paintbucket-button {
        background-image: url('./assets/button_paintbucket_off.png') !important;
        transform: none !important;
    }
    .game-paintbucket-button::before {
        opacity: 0 !important;
    }
    .game-paintbucket-button.active {
        background-image: url('./assets/button_paintbucket_on.png') !important;
    }
    .game-paintbucket-button.active::before {
        opacity: 1 !important;
    }
    .game-paintbucket-button:not(.active):active {
        background-image: url('./assets/button_paintbucket_hover.png') !important;
        transform: translateY(5px) !important;
    }
    .game-paintbucket-button:not(.active):active::before {
        opacity: 1 !important;
    }
    .game-paintbucket-button.active:active {
        background-image: url('./assets/button_paintbucket_hover.png') !important;
        transform: translateY(5px) !important;
    }
    .game-paintbucket-button.active:active::before {
        opacity: 0 !important;
    }
    .play-button,
    .achievements-button,
    .help-button,
    .properties-button-main,
    .game-back-button,
    .game-properties-button,
    .game-paintbucket-button,
    .sections-back-button,
    .pictures-back-button,
    .section-button,
    .paginator-arrow,
    .picture-preview,
    .victory-gallery-button,
    .color-button,
    .property-switch,
    .marker-option {
        -webkit-tap-highlight-color: transparent;
    }
}

.pixel-replay-canvas {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    z-index: 10;
    box-shadow: none;
    border: none;
    outline: none;
    pointer-events: none;
}

.replay-button-row {
    position: relative;
    width: 100%;
    height: 200px; /* the height of the row that holds the buttons */
    margin-top: 0;  /* drop the extra margin */
    display: block; /* so that absolute positioning works */
}

.replay-button {
    width: 386px;
    height: 200px;
    position: absolute;
    left: 50%;
    top: 1572px;
    transform: translateX(-50%);
    background: url('assets/button2.png') no-repeat center center;
    background-size: contain;
    border: none;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
    font-size: 56px;
    color: #FFC647;
    text-shadow: 0 5px 0 #00000080;
    cursor: pointer;
    transition: background-image 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}
.replay-button:hover,
.replay-button:focus {
    background-image: url('assets/button2_hover.png');
    color: #000000;
    text-shadow: 0 5px 0 #FFCC0080;
}
.replay-button:active {
    background-image: url('assets/button2_hover.png');
    color: #000000;
    text-shadow: 0 5px 0 #FFCC0080;
    transform: translateX(-50%) translateY(5px);
}

.save-button {
    width: 160px;
    height: 160px;
    position: absolute;
    right: 147px;
    top: 1592px;
    background: url('assets/button_save.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: background-image 0.1s ease;
}
.save-button:hover,
.save-button:focus {
    background-image: url('assets/button_save_hover.png');
}
.save-button:active {
    background-image: url('assets/button_save_hover.png');
    transform: translateY(5px);
}

.replay-back-button {
    position: absolute;
    width: 160px;
    height: 160px;
    left: 147px;
    top: 1592px;
    background: url('assets/button_back.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: background-image 0.1s ease;
    z-index: 10;
}
.replay-back-button:hover {
    background-image: url('./assets/button_back_hover.png');
}
.replay-back-button:active {
    transform: translateY(5px);
}

#victory-screen .replay-button {
    top: 712px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
}
#victory-screen .replay-back-button {
    top: 732px !important;
    left: 147px !important;
    right: auto !important;
}
#victory-screen .save-button {
    top: 732px !important;
    left: auto !important;
    right: 147px !important;
}


/* The highlight under the cursor is for the mouse only: on a phone :hover sticks
   after a touch. After a language is chosen the screen is rebuilt right under the
   cursor, and the highlight looked like a second selected marker — so until the
   mouse really moves it is off (hover-paused, see properties.js) */
@media (hover: hover) {
    #properties-screen:not(.hover-paused) .marker-option:not(.selected):hover .marker-image-container::after {
        content: "";
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100%;
        height: 100%;
        background: url('assets/marker_border.png') no-repeat center center;
        background-size: contain;
        pointer-events: none;
        z-index: 2;
        opacity: 0.35;
    }
}





#achievements-screen {
    overflow-y: auto;
    background-image: url('assets/back_achievements.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ach-categories-container {
    margin-top: 55px; /* pick the value your layout needs */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Achievements screen styles */
.ach-category {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* margin-bottom: 150px; */
}

.ach-category-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 50px;
    color: #F6CA66; /* Headings change from #870000 to #F6CA66 */
    margin-bottom: 32px;
    text-align: center;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 rgba(0,0,0,0.5);
    user-select: none;
}

.ach-row {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    margin-bottom: 0;
}
.ach-row-single {
    margin-top: 40px;
}
.ach-badge {
    display: block;
    object-fit: contain;
    pointer-events: auto;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-select: none;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.ach-category-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.ach-category-title-value {
    color: #FFBB00; /* Counters change from #ff9900 to #FFBB00 */
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 45px;
    text-shadow: 0 3px 0 rgba(0,0,0,0.5);
}


/* Styles for the help screen */
#help-screen {
    background-image: url('./assets/back_help.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}

.help-instructions-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.help-text-block {
    position: absolute;
    width: 100%;
    text-align: center;
    color: #82592C;
    font-size: 50px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    line-height: 1.1;
    white-space: pre-line;
}

/* Styles for the achievements panel */
.achievement-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 652px;
    height: 681px;
    background-image: url('./assets/back_ach.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 80px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
    opacity: 0;
    z-index: 1000;
    pointer-events: none;
}

.achievement-panel.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.achievement-panel.hide {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
}

.achievement-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 55px;
    color: #D35F00;
    text-shadow: 0 3px 0 rgba(0,0,0,1);
    margin: 60px 0 20px 0;
    text-align: center;
}

.achievement-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 42px;
    color: #870000;
    text-shadow: 0 3px 0 rgba(0,0,0,1);
    margin: -20px 0 40px 0;
    text-align: center;
}

.achievement-image {
    width: 170px;
    height: 240px;
    margin: 20px 0;
    user-select: none;
}

/* Styles for showing the version */
.version-info {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: rgba(255, 191, 0);
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
    pointer-events: none; /* So that clicks are not intercepted */
    z-index: 10;
}

.sections-container.transition-active {
    z-index: 20; /* Higher than the other elements */
    position: relative;
    transition: none !important;
    background-color: transparent !important;
}

/* Styles that prevent the black overlay - for every page */
.sections-transition-active {
    z-index: 2500 !important;
    position: relative !important;
    background-color: transparent !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.button-pressed {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2501 !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.sections-page {
    background-color: transparent !important;
}






/* The continue-or-start-over dialog when an unfinished picture is opened */
.game-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 3000;
}

.game-dialog-overlay.visible {
    opacity: 1;
}

.game-dialog-panel {
    width: 860px;
    padding: 70px 60px 50px;
    box-sizing: border-box;
    background: #241D1D;
    border: 6px solid #FFB700;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.game-dialog-text {
    margin: 0 0 40px;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
    font-size: 44px;
    line-height: 1.3;
    color: #FFFFFF;
}

.game-dialog-buttons {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
}

.game-dialog-button {
    width: 340px;
    height: 176px;
    background: url('assets/button2.png') no-repeat center center;
    background-size: contain;
    border: none;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
    font-size: 52px;
    color: #FFC647;
    text-shadow: 0 5px 0 rgba(0, 0, 0, 0.5);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-dialog-button:hover {
    background-image: url('assets/button2_hover.png');
    color: #000000;
    text-shadow: 0 5px 0 rgba(255, 204, 0, 0.5);
}

.game-dialog-button:active {
    transform: translateY(5px);
}

/* The tutorial (js/tutorial.js): the hint over the field and the pointing hand */
.tutorial-hint {
    position: absolute;
    /* Centred on the 1080-wide screen — no translate, so the animation only needs scale */
    left: 60px;
    width: 960px;
    padding: 48px 50px;
    box-sizing: border-box;
    background: #000000;
    border: 6px solid #FFB700;
    border-radius: 40px;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.5);
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
    font-size: 48px;
    line-height: 1.3;
    color: #BE9F4D;
    text-align: center;
    z-index: 2400;
    pointer-events: none;
    opacity: 0;
}

/* Appearance with a springy bounce: overshoot, undershoot and a fading wobble */
.tutorial-hint.visible {
    animation: tutorial-pop-in 0.65s ease-out both;
}

.tutorial-hint.hiding {
    animation: tutorial-pop-out 0.2s ease-in both;
}

/* The same hint moving to a new place (the last step) */
.tutorial-hint.moving {
    transition: top 0.35s ease-in-out;
}

@keyframes tutorial-pop-in {
    0% { opacity: 0; transform: scale(0.5); }
    35% { opacity: 1; transform: scale(1.08); }
    55% { transform: scale(0.95); }
    75% { transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes tutorial-pop-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

/* The final tutorial dialog — in the same style as the hints. The dialog itself is
   shared with continue / start over, so the differences live under its own class. */
.tutorial-final-panel {
    padding-top: 90px;
    background: #000000;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.5);
}

.tutorial-final.visible .tutorial-final-panel {
    animation: tutorial-pop-in 0.65s ease-out both;
}

.tutorial-final-panel .game-dialog-text {
    margin-bottom: 60px;
    font-size: 48px;
    color: #BE9F4D;
}

.tutorial-key {
    display: inline-block;
    min-width: 1em;
    padding: 0 0.25em;
    border: 4px solid #FFB700;
    border-radius: 12px;
    color: #FFB700;
    line-height: 1.1;
}

/* The .tutorial-hand point is the fingertip: on the image it is about (20, 20) from the corner */
.tutorial-hand {
    position: absolute;
    width: 0;
    height: 0;
    z-index: 2450;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

.tutorial-hand.visible {
    opacity: 1;
}

/* The wobble of PointerHand in Ploppio: 700 ms there and back, Sine.easeInOut */
.tutorial-hand-nudge {
    animation: tutorial-hand-nudge 0.7s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.tutorial-hand.flip .tutorial-hand-nudge {
    animation-name: tutorial-hand-nudge-flip;
}

.tutorial-hand img {
    position: absolute;
    left: -20px;
    top: -20px;
    width: 294px;
    height: 281px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.tutorial-hand.flip img {
    left: -274px;
    transform: scaleX(-1);
}

@keyframes tutorial-hand-nudge {
    from { transform: translate(0, 0); }
    to { transform: translate(-20px, -30px); }
}

@keyframes tutorial-hand-nudge-flip {
    from { transform: translate(0, 0); }
    to { transform: translate(20px, -30px); }
}

/* Whatever a tutorial step makes unavailable is dimmed: palette colours, top bar buttons */
.color-button.tutorial-locked,
.game-properties-button.tutorial-locked,
.game-paintbucket-button.tutorial-locked {
    opacity: 0.35;
    pointer-events: none;
}

/* Fitting the translations (js/i18n.js). An element with data-fit shrinks its font
   until the text fits its width — which is why such elements have a set width. */
[data-fit="line"] {
    white-space: nowrap;
}
/* Help captions wrap only where the text itself has a break,
   and stay within the frame of the screen */
/* Two-line captions: the font is shrunk only when a single word does not fit
   or the text does not fit on two lines */
[data-fit="wrap"] {
    white-space: normal;
}
.help-text-block[data-fit] {
    white-space: pre;
    left: 60px;
    width: 960px;
}
.sections-heading {
    width: 680px;
}
.properties-heading {
    width: 760px;
}
.victory-main-heading,
.victory-sub-heading,
.victory-image-title {
    left: 60px;
    width: 960px;
}
/* The caption stays within the red ribbon on the screen background */
.ach-category-title {
    width: 700px;
    margin-left: auto;
    margin-right: auto;
}
/* A long hint (French, German) wraps onto two lines instead of being shrunk to
   the screen frame. It grows upwards so it does not run into the button */
.reset-progress-hint {
    width: 900px;
    top: auto;
    bottom: calc(100% - 58px);
    line-height: 60px;
    text-wrap: balance;
}
/* On two lines — slightly lower, closer to the button */
.reset-progress-hint[data-lines="2"] {
    bottom: calc(100% - 68px);
}
/* The title column shrinks its child to the text — we stretch it to the full
   width, with padding, so a long title does not touch the settings button */
.game-image-title {
    width: 100%;
    box-sizing: border-box;
    padding: 0 14px;
}
/* Image buttons have a thick frame: the text has to fit inside it */
.play-button,
.replay-button,
.reset-progress-button,
.game-dialog-button {
    box-sizing: border-box;
}
.play-button {
    padding: 0 50px;
}
.replay-button,
.reset-progress-button,
.game-dialog-button {
    padding: 0 34px;
}
/* In settings rows the caption gives way to the switch */
.property-switch-container {
    gap: 16px;
}
.property-switch-label,
.marker-label {
    min-width: 0;
    overflow: hidden;
}
.property-switch-label {
    flex: 0 1 auto;
}
.marker-label {
    max-width: 380px;
}

/* Language selection in settings */
.language-select {
    position: relative;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 300px;
    height: 68px;
    padding: 0 44px 0 18px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.35);
    border: 4px solid #FFB700;
    border-radius: 20px;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
    font-size: 40px;
    color: #FFB700;
    cursor: pointer;
    overflow: hidden;
}
/* The expand-list triangle */
.language-select::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    margin-top: -5px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid #FFB700;
}
.language-select:active {
    transform: translateY(3px);
}
.language-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-height: 1200px;
    overflow-y: auto;
}
.language-option {
    width: 100%;
    height: 96px;
    padding: 0 30px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.05);
    border: 4px solid transparent;
    border-radius: 24px;
    font-family: 'Nunito', Arial, sans-serif;
    font-weight: 900;
    font-size: 48px;
    color: #BE9F4D;
    cursor: pointer;
    overflow: hidden;
}
.language-option:hover {
    color: #FFC647;
}
.language-option.selected {
    border-color: #FFB700;
    color: #FFB700;
}
