/*
NOTES

Things that destroy VoiceOver:
- inset borders with box-sizing:border-box. Causes lag frames.
- calc() widths and heights. Causes lag frames.
- transform:translate. Lag and breaks VO cursor. Never use this. NEVER USE THIS.
*/

@import url('https://fonts.googleapis.com/css2?family=Staatliches&display=swap');

/* Overrides */
body, html {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #dbdfd4;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
	/*If we push things like the announcement off screen,
	it can still be grabbed by VoiceOver. This prevents
	scrolling to it.*/
	/*
	margin: 0;
	overflow: hidden;
	*/
}
* {
    margin: 0; padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

:focus {
    outline: solid 5px #FF3939;
    z-index: 100000;
    border-radius: 3px;
}

/* Window dressing */
::-webkit-scrollbar{ /*remove scrollbar*/
    display: none;
}
::-webkit-scrollbar:hover{
    display: inherit;
}

.btn {
    color: #fff;
    border: none;
    border-radius: 24px;
    background-color: #000;
    text-transform: uppercase;
}

#cover {
	position: absolute;
	top: 0;
	display: none;
	width: 100%;
	height: 100%;
	z-index: 10000000;
	pointer-events: none;
	background-color: #000;
}
#cover.on {
	display: block;
}

#loadScreen {
    position: absolute;
    width: 103%;
    height: 103%;
    top: -1.5%;
    left: -1.5%;
    background-color: #eff1e9;
    z-index: 999;
    text-align: center;
    padding: 5rem;
}
#loadScreen p {
    margin: 2rem auto 5rem;
    font-size: 3rem;
}
#loadScreen svg {
    margin: 30rem auto auto;
    display: block;
    shape-rendering: auto;
}

.modal {
	display: flex;
	opacity: 1;
	transform: translateY(0);
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100%;
	background-color: #000000BB;
	z-index: 1000;
	animation: fadeIn 0.25s ease-out;
	animation-fill-mode: both;
}
.modal button {
	animation-fill-mode: both;
}
@keyframes fadeIn {
	0% { opacity: 0; }
	100%{ opacity: 100; }
}
@keyframes transIn {
	0% { opacity: 0; transform: translateY(50px); }
	100%{ opacity: 100; transform: translateY(0); }
}
modalTitle {
    font-family: 'Staatliches', sans-serif;
    font-size: 40px;
	color: #fff;
	text-align: center;
}
modalTitle p {
	font-size: 14px;
	margin-bottom: 5px;
}
.modal .btn {
	font-size: 18px;
	width: 300px;
	margin-top: 1rem;
	padding: 1rem;
	border-radius: 12px;
	z-index: 1000;
}
.hidden {
    display: none;
}

#howToPlayList {
	width: 100%;
	max-width: 500px;
	margin: 0 1rem;
	padding: 1.5rem 2rem 0.5rem 2rem;
	border-radius: 12px;
	background: #fff;
}

#modalHowToPlay .li {
	margin-bottom: 1rem;
}

.li::before {
	content: " ";
    width: 5pt;
    height: 5pt;
    background-color: black;
    margin-right: 5pt;
    overflow: hidden;
    border-radius: 1em;
    display: inline-block;
}

/* Scene */
#safeAreaWrapper { /*Required to prevent white space leakage with transform:scale*/
    width: 0;
    height: 0;
    position: absolute;
}
#safeArea {
	display: grid;
	grid-template-rows: auto 1fr auto auto auto;
    width: 1080px;
    height: 1728px; /* 72*2(logo) + 114(readout) + 1080(board) + 36(gutter) + 72*2(tile rack) + 36(gutter) + 72*2(buttons) */
    position: relative;
    left: -540px; /*half of authored sizing*/
    top: -864px;
    transform-origin: center;
    transform: scale(0);
    font-size: 30px;
	overflow: hidden;
    background-color: #eff1e9;
}
.section {
    width: 100%; height: 144px;
}
.gutter {
    width: 100%; height: 36px;
}
#topContainer {
    display: grid;
	grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-content: center;
	height: 144px;
    user-select: none;
	background-color: #97C949;
}
#gameLogoText {
    font-family: 'Staatliches', sans-serif;
    font-size: 75px;
}
.score-group {
    display: flex;
	align-items: center;
	margin-left: 4rem;
}
.score-group#playerOneInfo, .score-group#playerTwoInfo {
	flex-flow: row wrap;
	margin-left: 3.5rem;
}
#scoresContainer span {
	display: block;
}
#score {
    font-size: 48px;
    line-height: 62px;
}
.strikes {
	display: flex;
	margin-top: 0.75rem;
}
.strike-box {
	display: inline-block;
	width: 48px;
	height: 48px;
	margin-right: 10px;
	border-radius: 12px;
	background-color: #fff;
}
#livesContainer {
	display: flex;
	align-items: center;
    font-size: 48px;
    line-height: 62px;
}
#lives {
	display: flex;
	align-items: center;
	margin-left: 0.75rem;
}
#livesCounter {
	margin-right: 3px;
}
.heart {
	margin: 5px 0 0 5px;
}

#screenReaderOnly {
    position: fixed;
    height: 1px;
    width: 1px;
    overflow: hidden;
    opacity: 0;
    user-select: none;
	z-index: -1000;
}


/* Game Scene */
#gameScene {
	position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
#gameBG {
	width: 100%;
	height: auto;
}
.game-land {
	position: absolute;
	bottom: -180px;
}
#gameLandLeft {
	left: 0;
	transform: scaleX(-1);
}
#gameLandRight {
	right: 0;
}
#gameWater {
	position: absolute;
	bottom: -150px;
	width: 80%;
	/*height: 150px;*/
	height: 215px;
	background-color: #00a388;
}
#gameWater img {
	width: 100%;
	height: auto;
	transform: translateY(-75px);
}
#stickman {
	position: absolute;
	top: 30px;
	width: 300px;
	z-index: 1;
	transition: transform 0.5s ease-out;
}
#stickman img {
	position: absolute;
	top: 0;
}
#stickman.won {
	animation-name: stickmanWon;
	animation-duration: 2s;
	animation-fill-mode: forwards;
	animation-timing-function: linear;
	/*transform: translateX(420px);
	transition: transform 1.5s;*/
}
@keyframes stickmanWon {
	75% { transform: translateX(420px); }
	100% { transform: translateX(420px) translateY(65px); }
}
#stickman.lost {
	animation-name: stickmanLost;
	/*animation-duration: 1.5s;*/
	animation-duration: 1.25s;
	animation-fill-mode: forwards;
	animation-timing-function: linear;
}
@keyframes stickmanLost {
	/*20% { transform: translateY(400px); }*/
	100% { transform: translateY(700px); }
}

#gameStatusReadout {
	font-size: 35px;
	padding: 15px;
	display: flex;
	align-items: center;
	margin: 0 auto 1rem auto;
	width: 80%;
	height: 114px;
	background-color: white;
	border-radius: 24px;
	z-index: 50;
	justify-content: center;
	user-select: none;
	box-shadow: 0 3px 6px rgb(0 0 0 / 25%);
}

#answerSpaces {
    display: flex;
    justify-content: center;
	z-index: 3;
    padding: 0.5rem 0 2rem 0;
    font-family: 'Staatliches', sans-serif;
    background-color: #B9DD6B;
	box-shadow: 0 3px 4px rgba(0, 0, 0, 0.25);
}
.answer-space {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 0.5rem;
    font-size: 84px;
    text-align: center;
}
.answer-space span {
    display: block;
}
.answer-space::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background-color: #000;
}

#keysContainer {
	z-index: 2;
    padding: 2rem 0;
    background-color: #97C949;
    /*background-color: #caf175;*/
}
#letterKeys, #actionButtons {
    display: grid;
    grid-gap: 1rem;
    grid-template-columns: repeat(9, 96px);
    justify-content: center;
}
#letterKeys {
    font-family: 'Staatliches', sans-serif;
    padding-bottom: 2rem;
}
.letter-key {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 96px;
    font-size: 84px;
    user-select: none;
    border-radius: 24px;
    background-color: #fff;
    box-shadow: 0 3px 4px rgba(0,0,0,0.25);
}
.letter-key.correct {
    color: #111c00;
    color: rgb(255 255 255 / 85%);
    color: #000;
    box-shadow: none;
    background-color: #599103;
    background-color: #d6ff7d;
    border: 4px solid #629d08;
}
.letter-key.incorrect {
    color: #511100;
    color: rgb(255 255 255 / 90%);
    color: #000;
    box-shadow: none;
    background-color: #F95B30;
    border: 4px solid #c13f1c;
}
#actionButtons .btn {
    height: 96px;
	font-size: 48px;
	background-size: auto 70%;
	background-position: center;
	background-repeat: no-repeat;
}
#btnPlay {
    grid-column: 1 / 6;
}
#btnActions, #btnCover {
    grid-column: 6 / 8;
}
#btnSettings {
    grid-column: 8 / 10;
	background-image: url("../img/btn_settings.svg");
}

.screen {
	background: #eff1e9;
    max-width: 500px;
    width: 100%;
	margin: 0 1rem;
	padding: 1.5rem 2rem 2.5rem 2rem;
	border-radius: 12px;
	text-align: center;
}

.screen > p {
	margin: 1rem 0;
}

.screen modalTitle {
	color: #000;
}