*
{
    -webkit-tap-highlight-color: transparent;
	text-size-adjust: none;
}

body, .game_wrapper, #battle
{
    background-color: #edeef0;
}
.game
{
    position: fixed; 
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    
    aspect-ratio: 16 / 9;
    width: min(calc(100vh * (16 / 9)), 100vw, 1280px);
    height: auto; 
}
#battle
{
    position: absolute;
    background-color: #fff;
    touch-action: none;

    width: 100%;
    height: 100%;
}

.preloader 
{
    position: absolute;
    background-color: #fff;

    width: 100%;
    height: 100%;
}
.preloader #preloader_bg
{
    position: absolute;
    width: 100%;
    height: 100%;
}
.preloader #progress
{
    font-family: Pangolin, sans-serif;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;

    user-select: none;
    text-align: center;
    pointer-events: none;
}

.settings
{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    display: none;
}
.settings.visible
{
    display: block;
}

.settings_background
{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background-color: rgba(0, 0, 0, .5);
	text-align: right;
    cursor: pointer;
}
.settings_background span
{
	margin-top: 1em;
	margin-right: 1em;
	font-size: 20px;
	opacity: .6;
    user-select: none;
}
.settings_background:hover span
{
	opacity: 1;
}

.settings_container
{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background-color: #fff;
    border-radius: 6px;
    border: 3px solid #000;

    padding: 15px;
    
    display: grid;
    grid-auto-flow: row;
    grid-gap: 15px;
}
.settings_row, .language_picker
{
    display: grid;
    grid-template-columns: 24px auto 1fr;
    grid-gap: 12px;
    align-items: center;
}
.settings_row input[type="range"]
{
    width: 200px;
}
.range
{
    position: relative;
    height: 10px;
}
.range_background
{
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;

    background-color: #aaa;
	border-radius: 6px;
    z-index: -1;

    overflow: hidden;
}
.progress_background
{
    width: 0%;
    height: 100%;
    background-color: #0d85f3;
}

.icon
{
    background: url(../img/settings.png);
    background-repeat: no-repeat;

    width: 24px;
    height: 24px;

    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;

    display: inline-block;
}
.icon.music
{
    background-position: 0px 0px;
}
.icon.sfx
{
    background-position: 0px -24px;
}
.icon.language
{
    background-position: -96px 0px;
}
.icon.shake
{
    background-position: -96px -24px;
}
.icon.close
{
    background-position: -24px 0px;
}
.icon.check
{
    background-position: -24px -24px;
}
.icon.cog
{
    background-position: -48px 0px;
}
button:hover .icon.cog
{
    background-position: -48px -24px;
}
.icon.fullscreen
{
    background-position: -72px 0px;
}
button:hover .icon.fullscreen
{
    background-position: -72px -24px;
}

button
{
    display: flex;
    justify-content: center;
    align-items: center;

    width: 42px;
    height: 42px;

    background-color: #fff;
    border: 3px solid #000;
    border-radius: 6px;
}
button:hover
{
    border-color: #0d85f3;
}

.bottom
{
    position: absolute;

    bottom: 0;
    right: 0;
}
.bottom button
{
    background: none;
    border: none;
}

.language_picker
{
    position: absolute;
    z-index: 1;
    bottom: 0;
    left: 0;

    background-color: #fff;
    padding: 12px;
    box-sizing: border-box;

    border-radius: 0 6px 0 0;
}

input, textarea, select
{
	background-color: #fff;
	color: #000;
	outline: none;
	
	border: 2px solid #666;
	border-radius: 6px;
}
input:focus, textarea:focus, select:focus
{
	border-color: #000;
}

label
{
    user-select: none;
    touch-action: none;

    font-family: Pangolin, sans-serif;

    font-size: 24px;
}
input[type="range"]
{
    display: block;
    margin: 0;

    appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;

	height: 10px;
	width: 100%;
	
	background-color: transparent;
	
	outline: none;
	border: none;
}
input[type="range"]:hover::-webkit-slider-thumb
{
    border-color: #0d85f3 !important;
}
input[type="range"]::-webkit-slider-thumb
{
    appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;

	width: 13px;
	height: 13px;
	border: 3px solid #666;
	border-radius: 50%;
	background-color: #fff;
    cursor: pointer;
}
input[type="range"]:hover::-moz-range-thumb
{
    border-color: #0d85f3 !important;
}
input[type="range"]::-moz-range-thumb
{
    appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;

	width: 7px;
	height: 7px;
	border: 3px solid #666;
	border-radius: 50%;
	background-color: #fff;
    cursor: pointer;
}

input[type="checkbox"]
{
    display: none;
}

input[type="checkbox"]+label
{
    display: inline-flex;
    user-select: none;
    align-items: center;
    grid-gap: 12px;
    gap: 12px;
    margin-left: 3px;

    cursor: pointer;
}
input[type="checkbox"]+label::before
{
    content: '';
    display: inline-block;

    width: 12px;
    height: 12px;

    flex-shrink: 0;
    flex-grow: 0;

    border: 2px solid #666;
    background-color: #fff;
    border-radius: 4px;

    background-size: 75% 75%;
    background-repeat: no-repeat;
    background-position: center center;
}
input[type="checkbox"]:hover+label
{
    color: #0d85f3 !important;
}
input[type="checkbox"]:hover+label::before
{
    border-color: #0d85f3 !important;
}
input[type="checkbox"]:checked+label::before
{
    border-color: #0d85f3;
    background-color: #0d85f3;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
}
input[type="checkbox"]:not(:disabled):not(:checked)+label:hover::before
{
    border-color: #666;
}
input[type="checkbox"]:disabled+label::before
{
    background-color: #000;
}