@font-face {
    font-family: 'pix33regular';
    src: url('font/pix33-webfont.woff2') format('woff2'),
         url('font/pix33-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}
:root {
  --color1: brown;
  --color2: brown;
  --color3: brown;
  --color4: brown;

  /* couleur de survol des options des menus déroulants */
  --select-hover-bg: var(--color2);
  --select-hover-text: var(--color4);

  /* design de la scrollbar */
  --scrollbar-width: 14px;
  --scrollbar-track: var(--color4);
  --scrollbar-thumb: var(--color3);
  --scrollbar-thumb-hover: var(--color2);
  --scrollbar-border: var(--color4);
}
*, *::before, *::after {
	box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  /*font-family: 'pix33regular';*/
  font-family: 'pix33regular', Arial, sans-serif;
  height: 100%;
}
/* CSS de base */
body {
	font-family: Arial,;
    font-size: 12px;
    color: var(--color4);
    background-color: var(--color1);
    margin: 0;
    padding: 0;
    position: relative;
    min-height: 100%;
    width: 100%;
    overflow-x: hidden;
}

/* écran de chargement : couvre toute la page par-dessus le reste
   pendant l'initialisation (p5.js + données de palettes + 1ère image) */
#loading-screen {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #1a1a1a; /* fixe, indépendant de la palette du jeu (qui change via --color1) */
	color: #f0f0f0;
	transition: opacity 0.4s ease;
}
#loading-screen.loading-hidden {
	opacity: 0;
	pointer-events: none;
}
.loading-text {
	font-family: 'pix33regular', Arial, sans-serif;
	font-size: 28px;
	letter-spacing: 0.1rem;
	display: flex;
	align-items: baseline;
}
.loading-dots span {
	opacity: 0.15;
	animation: loading-dot-blink 1.2s infinite;
}
.loading-dots span:nth-child(2) {
	animation-delay: 0.2s;
}
.loading-dots span:nth-child(3) {
	animation-delay: 0.4s;
}
@keyframes loading-dot-blink {
	0%, 80%, 100% { opacity: 0.15; }
	40% { opacity: 1; }
}

section{
	/*    height: 100vh;*/
    /* justify-content: center; */
    /* vertical-align: middle; */
    /* text-align: center; */
    /* margin: 0 auto; */
    position: relative;
    /* height: 100%; */
    /* display: none; */
    margin: 2rem 0;
}
h1, h2, h3, h4, h5, h6, p { /* pour utiliser les H1, H2, etc sur les éléments importants,
	mais pas focément affichés en très gros */
	font-size: 12px;
	font-weight: normal; /* pas gras */
	margin:0;
	padding:0;
}
h1{
    font-size: 34px;
    text-align: center;
    margin: 0.8rem 0 0 0;
	max-width: 100%;
	height: 87px;
	vertical-align: bottom;
}
h2{
	font-size: 34px;
	margin: 34px;
    margin-top: 0px;
}
a { text-decoration:none; color:#F8D878; }
a:hover { text-decoration:underline; } /* liens au survol */

ul { list-style-type: none; padding:0; } /* pas de puces dans mes listes */

#gameName{
}
/*#gameRegion{
	writing-mode: vertical-lr;
    text-orientation: upright;
    text-align: center;
    font-size: 16px;
    opacity: 0.7;
    margin-left: 0.4rem;
}*/
#gameBoy{
	display: none;
    width: 640px;
    height: 576px;
    image-rendering: pixelated;
}
canvas{
	width: 640px !important	;
    height: 576px !important	;
    image-rendering: pixelated;
    height: auto !important;
	aspect-ratio: 640 / 576;
}

#sketch-container {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
}
#export-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	margin-top: 1rem;
}
.batch-options {
    margin: 0.3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-content: center;
    height: stretch;
    width: 300px;
    flex:1;
}

.batch-options li {
	margin: 0.2rem 0;
}
.batch-options label {
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.batch-options input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--color3);
}
.columns {
    position: relative;
    display: flex;
    align-items: center;
    /*height: 100%;*/
    padding-bottom: 0rem;
    margin-bottom: 0;
}
.columns > * {
	display: flex;
}
.columns-3,.columns-1  {
    width: calc(100% / 3);
}
.columns-1{
	display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin: 0.6rem;
}
.columns-3{
	display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0.6rem;
}
.columns-1 .paramsContainer {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.columns-3 .paramsContainer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
#game .subContainer {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    flex-direction: column;
}
#color .subContainer {
    flex-wrap: nowrap;
}
#glitch .select {
    margin-right: 0.3rem;
}
label{
	font-size: 22px;
    /*writing-mode: vertical-lr;
    text-orientation: upright;*/
}
/*.columns-3 .slider{
	display: flex;
    flex-direction: row;
    margin: 1.2rem 1.2rem 0.6rem 1.6rem;
}
*/
#regionText {
	font-family: 'pix33regular', Arial, sans-serif;
	font-size: 16px;
	color: var(--color1);
	background: var(--color3);
	padding: 10px 20px 10px 20px;
	border: solid var(--color4) 4px;
	margin: 0.3rem 0rem;
	display: inline-block;
}

.subContainer{
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
}
#export1col{
	display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 300px;
    /*width: 100%;*/
    margin: 0.3rem 2rem;
    flex:1;
}
.colorBlockContainer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
#glitch .sliderBox{

}
/********custom dropdown*********/

	.visually-hidden-select {
		display: none;
	}

	.custom-select {
		position: relative;
		display: inline-block;
		width: 220px;
		margin: 0.3rem 0rem;
		font-family: 'pix33regular', Arial, sans-serif;
	}
	.custom-select-trigger {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		box-sizing: border-box;
		cursor: pointer;
		padding: 10px 20px;
		border: solid var(--color4) 4px ;
		border-radius: 0px;
		background: var(--color3);
		color: var(--color1);
		font-size: 16px;
		font-family: inherit;
	}
	.custom-select-trigger:hover,
	.custom-select.open .custom-select-trigger {
		background: var(--select-hover-bg);
		color: var(--select-hover-text);
	}
	.custom-select-label {
		overflow: hidden;
		white-space: nowrap;
		flex: 1;
		min-width: 0;
	}
	.custom-select-arrow {
		width: 0px;
		height: 0px;
		margin-left: 10px;
		border: solid currentColor;
		border-width: 0 3px 3px 0;
		padding: 3px;
		transform: rotate(45deg);
		-webkit-transform: rotate(45deg);
		flex-shrink: 0;
		transition: transform 0.1s ease;
	}
	.custom-select.open .custom-select-arrow {
		transform: rotate(225deg);
		-webkit-transform: rotate(225deg);
	}
	.custom-select-options {
		list-style: none;
		margin: 4px 0 0 0;
		padding: 0;
		position: absolute;
		left: 0;
		right: 0;
		z-index: 20;
		max-height: 220px;
		overflow-y: auto;
		background: var(--color3);
		border: solid var(--color4) 4px;
		display: none;
	    font-size: 16px;
	    border-right-width: 0;
	}
	.custom-select.open .custom-select-options {
		display: block;
	}
	.custom-select-option {
		padding: 8px 20px;
		cursor: pointer;
		color: var(--color1);
	}
	.custom-select-option:hover,
	.custom-select-option.selected {
		background: var(--select-hover-bg);
		color: var(--select-hover-text);
	}

	/* défilement du texte tronqué au survol */
	.marquee-wrap {
		display: block;
		overflow: hidden;
		white-space: nowrap;
	}
	.marquee-text {
		display: inline-block;
		white-space: nowrap;
		transform: translateX(0);
		transition: transform 0.3s ease;
		will-change: transform;
	}
	.custom-select-trigger.is-overflowing:hover .marquee-text,
	.custom-select-option.is-overflowing:hover .marquee-text {
		transition: transform linear;
		transition-duration: var(--scroll-duration, 2s);
		transform: translateX(var(--scroll-distance, 0px));
	}

.none{
	display: none !important;
}

#colorBlock{
	display: inline-flex;
	background: var(--color3);
  	/*padding: 10px 20px 10px 20px;*/
  	border: solid var(--color4) 4px;
  	margin: 0.3rem 0rem;
}
#colorBlock div{
	height: 20px;
  	width: 20px;
}
.colorBlock1{
	background: var(--color1);
}.colorBlock2{
	background: var(--color2);
}.colorBlock3{
	background: var(--color3);
}.colorBlock4{
	background: var(--color4);
}


input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}
.vert{
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding:1.3rem;
}
.vert input[type="range"]{
    writing-mode: vertical-lr;
    margin: 0 1.4rem;
    transform: rotateZ(5deg) /*translate(4px, -6px)*/;
}
.vert label{
    writing-mode: vertical-lr;
    text-orientation: upright;
    transform: translateZ(0);
    backface-visibility: hidden;
}
.horiz {
    display: flex;
    align-items: center;
    flex-direction: column-reverse;
    padding: 1.3rem 0;
    /*width: 100%;
    max-width: 230px;*/
}
.horiz input[type="range"]{
    /*writing-mode: vertical-lr;*/
    margin: 1.4rem 0;
    transform: rotateZ(-3deg) /*translate(4px, -6px)*/;
    width: 5rem;
}



/*********** Baseline, reset styles ***********/
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  /*width: 25rem;*/
}

/* Removes default focus */
input[type="range"]:focus {
  outline: none;
}

/******** Chrome, Safari, Opera and Edge Chromium styles ********/
	/* slider track */
		input[type="range"]::-webkit-slider-runnable-track {
		  background-color: var(--color4);
		  border-radius: 0rem;
		  height: 0.5rem;
		  width: 0.5rem;
		}

	/* slider thumb */
		input[type="range"]::-webkit-slider-thumb {
		  -webkit-appearance: none; /* Override default look */
		  appearance: none;
		  margin-top: -12px;
		  /*margin-left: -12px;*/ /* Centers thumb on the track */
		  background-color: var(--color3);
		  border-radius: 0rem;
		  height: 2rem;
		  width: 1rem;
		}
		.vert input[type="range"]::-webkit-slider-thumb {
		    margin-left: -12px;
		    height: 1rem;
		    width: 2rem;
		}

		input[type="range"]:focus::-webkit-slider-thumb {
		  outline: 3px solid var(--color2);
		  outline-offset: 0.125rem;
		}

/*********** Firefox styles ***********/
/* slider track */
	input[type="range"]::-moz-range-track {
	  background-color: var(--color4);
	  border-radius: 0rem;
	  height: 100%;
	  width: 0.5rem;
	}

	/* slider thumb */
	input[type="range"]::-moz-range-thumb {
	  background-color: var(--color3);
	  border: none; /*Removes extra border that FF applies*/
	  border-radius: 0rem;
	  height: 1rem;
	  width: 2rem;
	}

	input[type="range"]:focus::-moz-range-thumb{
	  outline: 3px solid var(--color2);
	  outline-offset: 0.125rem;
	}


/****btn*****/

	.btn {
	  -webkit-border-radius: 0;
	  -moz-border-radius: 0;
	  border-radius: 0px;
	  font-family: 'pix33regular', Arial, sans-serif;
	  color: var(--color1);
	  font-size: 16px;
	  background: var(--color3);
	  padding: 10px 20px 10px 20px;
	  border: solid var(--color4) 4px;
	  text-decoration: none;
	  margin: 0.3rem 0rem;
	}


	.btn:hover {
	  background: var(--color2);
	  text-decoration: none;
	}

/********select*********/

	.select {
	    position: relative;
	    display: inline-block;
	    /*margin-bottom: 15px;*/
	    width: 100px;
	}    
	.select select {
	    /*font-family: 'Arial';*/
	    display: inline-block;
	    width: 100%;
	    cursor: pointer;
	    padding: 10px 20px 10px 20px;
	    outline: 0;
	    border: solid var(--color4) 4px;
	    border-radius: 0px;
	    background: var(--color3);
	    color: var(--color1);
	    appearance: none;
	    -webkit-appearance: none;
	    -moz-appearance: none;
	    font-size: 16px;
	    font-family: 'pix33regular', Arial, sans-serif;
	    margin: 0.3rem 0rem;
	}
	    .select select::-ms-expand {
	        display: none;
	    }
	    .select select:hover,
	    .select select:focus {
	        color: var(--select-hover-text);
	        background: var(--select-hover-bg);
	    }
	    .select select:disabled {
	        opacity: 1;
	        pointer-events: none;
	    }
	.select_arrow {
	    position: absolute;
	    top: 20px;
	    right: 15px;
	    width: 0px;
	    height: 0px;
	    border: solid var(--color2);
	    border-width: 0 3px 3px 0;
	    display: inline-block;
	    padding: 3px;
	    transform: rotate(45deg);
	    -webkit-transform: rotate(45deg);
	}
	.select select:hover ~ .select_arrow,
	.select select:focus ~ .select_arrow {
	    border-color: var(--color1);
	}
	.select select:disabled ~ .select_arrow {
	    border-top-color: var(--color2);
	}
	.select select option:hover {
	    /*box-shadow: 0 0 10px 100px var(--color2) inset;*/
	    background-color: var(--select-hover-bg);
	    color: var(--select-hover-text);
	}
	.select select option:focus,
	.select select option:checked {
		background-color: var(--select-hover-bg);
		color: var(--select-hover-text);
	}

/********scrollbar*********/
/* Firefox */
* {
    scrollbar-width: auto;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Chrome, Edge, Safari (navigateurs basés Chromium) */
::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-width);

}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border: solid var(--scrollbar-border) 2px;
    overflow: visible !important;
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border: solid var(--scrollbar-border) 2px;
    border-radius: 0; /* coins carrés, esprit pixel-art */
    width: 100px;
    height:100px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}
::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

/*gallery*/
.gal{
	display: flex;
	flex-wrap: wrap;
}
.gal img {
    aspect-ratio: 1 / 1;
    width: 25%;
}
.bottomed {
    text-align: right;
}
/********responsive*********/

/* Tablette / petit écran : la mise en page 3 colonnes devient une colonne unique */
@media (max-width: 1080px) {
	.columns {
		flex-direction: column;
		height: auto;
		min-height: 100vh;
		padding: 1.5rem 0;
		padding-bottom: 0rem;
    	margin-bottom: 0;
	}
	.columns-1, .columns-2, .columns-3 {
		width: 100%;
		justify-content: center;
	}
	.columns-1 {
        order: 2;
        justify-content: center;
        align-items: flex-start;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }
	.columns-2 {
		order: 1;
		justify-content: center;
	}
	.columns-3 {
		order: 3;
		align-items: center;
		width: 100%;
		margin: 0.6rem 0;
	}

	h1 {
		writing-mode: horizontal-tb;
		text-orientation: mixed;
		height: auto;
		font-size: 34px;
		text-align: center;
		margin-bottom: 0.5rem;
	}

	#gameBoy, canvas {
		/*width: 70vw !important;*/
		width: 480px !important;
		height: 432px !important;
	}

	.custom-select {
		/*width: 90vw;*/
		max-width: 320px;
	}

	.custom-select-options {
		max-height: 45vh;
	}
	/*.subContainer{
		display: flex;
        align-items: center;
        justify-content: center;
        align-content: space-between;
        flex-wrap: wrap;
        width: 100%;
        flex-direction: row;
	}*/
	.subContainer button,.custom-select{
		margin: 0.4rem;
	}
	.columns-1 .paramsContainer {
	    text-align: right;
	    display: flex;
	    flex-direction: column;
	    align-items: center;
	}
	#glitch .sliderBox {
	    display: flex;
	}
	#glitch .sliderBox div{
	    margin: 0.4rem;
	}
	/*.vert{
		display: flex;
	    align-items: center;
	    flex-direction: column-reverse;
	    padding: 1.3rem 0;
	    width: 100%;
	    max-width: 230px;
	}
	.vert input[type="range"] {
	    //writing-mode: vertical-lr; 
	    margin: 1.4rem 0;
	    transform: rotateZ(-3deg);
	    width: 12rem;
	    writing-mode: horizontal-tb;
	}
	.vert input[type="range"]::-webkit-slider-thumb {
	    margin-left: 0;
	    margin-top: -12px;
	    height: 2rem;
	    width: 1rem;
	}
	.vert input[type="range"]::-moz-range-thumb {
	    height: 2rem;
	    width: 1rem;
	}
	.vert label {
		writing-mode: horizontal-tb;
    	text-orientation: initial;
	    transform: translateZ(0);
	    backface-visibility: hidden;
	}*/
	/*gallery*/
	.gal img {
	    width: 50%;
	}
/*input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    //width: 25rem; 
}*/
}

/* Mobile */
@media (max-width: 600px) {
	h1 {
		font-size: 24px;
	}

	/*#gameBoy, canvas {
		width: 320px;
		height: auto !important;
		aspect-ratio: 640 / 576;
	}*/

	.columns-3 {
		padding: 0 1rem;
	}

	.btn,
	.custom-select-trigger,
	.custom-select-options,
	#regionText {
		font-size: 15px;
	}
	.vert{
		display: flex;
	    align-items: center;
	    flex-direction: column-reverse;
	    padding: 1.3rem 0;
	    width: 100%;
	    max-width: 230px;
	}
	.vert input[type="range"] {
	    //writing-mode: vertical-lr; 
	    margin: 1.4rem 0;
	    transform: rotateZ(-3deg);
	    width: 8rem;
	    writing-mode: horizontal-tb;
	}
	.vert input[type="range"]::-webkit-slider-thumb {
	    margin-left: 0;
	    margin-top: -12px;
	    height: 2rem;
	    width: 1rem;
	}
	.vert input[type="range"]::-moz-range-thumb {
	    height: 2rem;
	    width: 1rem;
	}
	.vert label {
		writing-mode: horizontal-tb;
    	text-orientation: initial;
	    transform: translateZ(0);
	    backface-visibility: hidden;
	}
	#color .subContainer {
	    flex-wrap: nowrap;
	    display: flex;
	    flex-direction: column-reverse;
	    align-items: flex-end;
	}
	/*.vert {
		flex-direction: row;
	}
	.vert label {
		writing-mode: horizontal-tb;
		text-orientation: mixed;
		font-size: 16px;
	}
	.vert input[type="range"] {
		writing-mode: horizontal-tb;
		width: 8rem;
		margin: 0 0.6rem;
		transform: none;
	}
	.vert input[type="range"]::-webkit-slider-thumb {
		margin-top: 0;
		margin-left: -12px;
		height: 1rem;
		width: 2rem;
	}*/

	.horiz input[type="range"] {
		width: 8rem;
	}
	/*gallery*/
	.gal img {
	    width: 100%;
	}
	div#batchExport-panel {
	    display: flex;
	    flex-direction: column-reverse;
	    align-items: center;
	    align-content: center;
	    justify-content: center;
	}
	#export1col {
	    align-items: center;
	}
}
@media (max-width: 550px) {
	#gameBoy, canvas {
		width: 320px !important;
		height: 288px !important;
	}

}

@media (max-width: 360px) {
	#gameBoy, canvas {
		width: 160px !important;
		height: 144px !important;
	}
}