/* --col — ширина колонки, от неё считается весь стол.
   Ограничена и по ширине (10 колонок), и по высоте окна, чтобы
   стопки помещались в ландшафте на телефоне. 100px = исходный размер. */
:root {
	--col: min(100px, calc(100vw / 10), calc(100vh / 6));
	--cw: calc(var(--col) * 0.82);
	--ch: calc(var(--cw) * 1.451);
}

body {
	overflow: hidden;
	background: url(../images/background.png) #065B23;
}

.home-screen {
	background: url('../images/homescreen1.jpg') ;
	/*	display: table;*/
	width: 1366px;
	height: 768px;
}

.home-screen button {
	width: 390px;
	height: 80px;
	padding: 10px;
	font-size: 28px;
	font-weight: 1000;
	text-transform: uppercase;
	top: 390px;
	left: 440px;
	cursor: pointer;
	color: #f6bf5b;
	background: #a66428;
	border-radius: 20px;
	position: absolute;
}

.home-screen button:hover, .home-screen button#high-score-btn:hover {
	background: #774218;
}

.home-screen button label {
	cursor: pointer;
}

.home-screen button#high-score-btn {
	width: 150px;
	height: 40px;
	padding: 10px;
	font-size: 15px;
	font-weight: 1100;
	text-transform: uppercase;
	top: 380px;
	left: 900px;
	position: absolute;
	cursor: pointer;
	color: #f6bf5b;
	background: #a66428;
	border-radius: 20px;
}



.wrapper {
	width: calc(var(--col) * 10);
	margin: -20px auto;
}

.column {
	width: var(--col);
	min-height: var(--ch);
	padding-top: calc(var(--ch) * 0.34);
	float: left;
	/*	border: 1px solid #000;*/
}

.start-form {
	width: 800px;
	height: 520px;
	display: block;
	box-sizing: border-box; /*padding and border included in total height and width*/
	margin-top: 100px;
	padding: 20px 25px;
	background-color: #E7E7E7;
	border: 5px solid #074744;
	font-family: Georgia, serif;
	box-shadow: 0 0 12px 5px rgba(0,0,0,0.6);
	left: 50%;
	top: 50%;
	transform: translate(-50%,-75%);
	position: absolute;
	display: none;
}

input[type=radio] {
	border: 0px;
	width: 25px;
	height: 25px;

}

.start-form .title {
	margin-top: 20px;
	margin-bottom: 50px;
	font-size: 32px;
	text-align: center;
	font-weight: bold;
}

.start-form .game-option{
	display: block;
	margin-bottom: 20px;
	font-size: 30px;
	height: 70px;
	line-height: 70px;
	cursor: pointer;
	margin-left: 40px;
}

.start-form .game-option:hover, .start-form .game-option:active {
	background: #045c58;
	color: #e7e7e7;
}

.start-form input[type="submit"] {
	width: 200px;
	height: 52px;
	margin-top: 5px;
	font-size: 28px;
	cursor: pointer;
	text-align: center;
	margin-left: 50%;
	margin-top: 20px;
	transform: translate(-50%, 0);
	background: #021615;
	color: #E7E7E7;
	border-radius: 5px;
	box-shadow: 0px 13px 24px 6px rgba(0,0,0,0.79);
}

.start-form input[type="submit"]:hover {
	background: #045c58;;
}


.start-form .suit {
	display: inline-block;
	background-image: url('../images/card-shapes.png');
	background-repeat: no-repeat;
	background-position: 170px 50%;
	background-size: 200px 80px;

}

.start-form .suit.one {
	width: 220px;
}


.start-form .suit.two {
	width: 270px;
}


.start-form .suit.four {
	width: 375px;
}

.control-panel {
	position: absolute;
	left: 50%;
	bottom: 10px;
	transform: translate(-50%, 0);
	border: 1px solid #000;
	border-bottom: 0;
	padding: 20px;
	background-color: #E7E7E7;
	opacity: 0.4;
	transition: opacity 0.2s ease 0s;
	text-align: center;
	border-radius: 15px;
	display: none;
}

.control-panel:hover,
.control-panel:active {
	opacity: 1;
}

.opaque {
	opacity: 1;
}

.control-panel button {
	display: inline-block;
	width: 142px;
	height: 40px;
	font-size: 16px;
	outline: 1px solid grey;
	outline-offset: -4px;
	/*
	animation-name: blink;
	animation-duration: 2s;
	animation-iteration-count: infinite;
	*/
	cursor: pointer;
}

.control-panel button:hover{
	background: #074744;
	color: #e7e7e7;
}

.timer{
	font-size: 20px;
	font-weight: bold;
	color: #fff;
	position: absolute;
	right: 14%;
	bottom: 30px;
	border: 1px solid #fff;
	padding: 10px;
	display: none;
}

.score {
	bottom: 30px;
	left: 15%;
	font-size: 20px;
	font-weight: bold;
	color: #fff;
	border: 1px solid #fff;
	padding: 10px;
	position: absolute;
	display: none;
}

.message {
	display: inline-block;
	position: absolute;
	background-color: #F4F4F4;
	border: 1px solid #000;
	padding: 7px 10px;
	border-radius: 4px;
	font-size: 20px;
}

.faq, .faq-shadow {
	position: absolute;
	top: 0;
	bottom: 0;
}

.faq {
	z-index: 30;
	width: 50%;
	left: -100%;
	box-sizing: border-box;
	padding: 0 2%;
	background-color: #E7E7E7;
	font-family: Georgia, serif;
	font-size: 16px;
	line-height: 1.32;
	text-align: justify;
	box-shadow: 0 0 12px 6px rgba(0,0,0,0.8);
	overflow: scroll;
	transition: width 2s;
}

.faq.open {
	left: 0;
}

.faq-shadow {
	z-index: 35;
	width: 50%;
	left: -50%;
	background-color: transparent;
	transition-delay: 0s;
}

.faq.open + .faq-shadow {
	left: 50%;
	background-color: rgba(0,0,0,0.4);
	transition: background 0.2s linear 0.4s;
}

.faq-close{
	cursor: pointer;
}

.faq-close::after {
	content: '+';
	position: absolute;
	top: 0;
	right: 15px;
	padding: 10px;
	font-family: Arial, sans-serif;
	font-size: 36px;
	transform: rotate(45deg);	
}

.faq h1, 
.faq h2 {
	font-style: italic;
	margin-bottom: 0.25em;
}

.faq h1 {
	font-size: 32px;
}

.faq h2 {
	font-size: 20px;
}


.faq p {
	margin-top: 0;
	text-indent: 1.5em;
}

.faq ol {
	list-style-type: disc;
}

.game-title {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -62%);
	width: 600px;
	height: 500px;
	border: 5px solid #065B23;
	font-family: Georgia, serif;
	color: #E7E7E7;
	text-align: center;
	box-shadow: 0 0 12px 5px rgba(0,0,0,0.6);
	display: none;
}


/*Cards style*/
.card {
	display: block;
	width: var(--cw);
	height: var(--ch);
	margin: 0 auto;
	border: 1px solid #000;
	border-radius: 5px;
}

.card:first-child {
	margin-top: 0 !important;
}

.column .card,
.drag-el .card {
	margin-top: calc(var(--ch) * -0.723);
}

.drag-el {
	z-index: 100;
	position: absolute;
}


.column[data-height="1"] .open {
	margin-top: calc(var(--ch) * -0.756);
}


.column[data-height="2"] .open {
	margin-top: calc(var(--ch) * -0.790);
}

.column[data-height="3"] .open {
	margin-top: calc(var(--ch) * -0.824);
}

.column[data-height="4"] .open {
	margin-top: calc(var(--ch) * -0.857);
}

.column[data-height="5"] .open {
	margin-top: calc(var(--ch) * -0.891);
}

.column .closed,
.column .closed + .open {
	margin-top: calc(var(--ch) * -0.975);
}

.card.closed {
	background-image: 
		linear-gradient(45deg, rgba(0,0,0,0) 48%, rgba(255,255,255,0.30) 60%, rgba(0,0,0,0) 52%),
		linear-gradient(-45deg, rgba(0,0,0,0) 48%, rgba(255,255,255,0.25) 60%, rgba(0,0,0,0) 52%);
	background-size: calc(var(--cw) * 0.16) calc(var(--ch) * 0.143);
	background-color: #a83345;
}

.card.open,
.source .card:last-child {
	cursor: pointer;
	/* see bg style in cards.css */
}


.offside {
	width: inherit;
	position: absolute;
	bottom: var(--ch);
}

.source .card,
.dropout .card {
	position: absolute;
	bottom: 0;
}

.source .card {
	right: 0;
} 


.dropout .card {
	left: 0;
	cursor: default;
}

.source .card:nth-child(n+11) {
	right: calc(var(--cw) * 0.122);
}


.source .card:nth-child(n+21) {
	right: calc(var(--cw) * 0.244);
}

.source .card:nth-child(n+31) {
	right: calc(var(--cw) * 0.366);
}

.source .card:nth-child(n+41) {
	right: calc(var(--cw) * 0.488);
}


.dropout {
	display: table;
	position: relative;
}

/*Elements render in order as they appear in the document flow ==> static*/
.dropout .card:first-child {
	position: static;
}

.dropout::after {
	content: ' ';
	display: block;
	width: calc(100% + 70px);
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
}


.backlight {
	box-shadow: 0 0 20px 5px yellow;
}


.dropout .card:nth-child(n+14) {
	left: calc(var(--cw) * 0.183);
}

.dropout .card:nth-child(n+27) {
	left: calc(var(--cw) * 0.366);
}

.dropout .card:nth-child(n+40) {
	left: calc(var(--cw) * 0.549);
}

.dropout .card:nth-child(n+53) {
	left: calc(var(--cw) * 0.732);
}

.dropout .card:nth-child(n+66) {
	left: calc(var(--cw) * 0.915);
}

.dropout .card:nth-child(n+79) {
	left: calc(var(--cw) * 1.098);
}

.dropout .card:nth-child(n+92) {
	left: calc(var(--cw) * 1.280);
}

.ghost {
	z-index: 100;
	position: fixed;
	transition-property: top, left;
	transition-duration: 0.3s;
	transition-timing-function: linear;
	transition-delay: 0s;
}

.congratulation {
	width: 100%;
	height: 100%;
	display: none;
}

canvas {
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
}

/**/

/*
.input {
display: none;
position: absolute;
top: 18em;
left: 0;
right: 0;
text-align: center;
}
.input input {
width: 5em;
padding-left: 0.2em;
border: 0.08em solid #333;
background: none;
border-radius: 5px;
font-size: 3em;
}
.input input:focus { outline: none; }
.input input::-webkit-input-placeholder { 
color: #666;
text-shadow: none;
}
.input input:-moz-placeholder {
color: #666;
text-shadow: none;
}

.restart {
position: absolute;
top: 2.5em;
left: 0;
right: 0;
text-align: center;
}
*/

.score-board {
	position: absolute;
	left: 380px;
	top: 30px;
	width: 500px;
	height: 500px;
	color: #074744;
	background: #e7e7e7;
	border-radius: 20px;
	border: 5px solid #074744;
	display: none;
	padding: 20px;
}

.score-board h2 {
	text-align: center;
}


ol#high-scores {
	font-size: 24px;
}

ol li {
	list-style-type: none;
	counter-increment: list;
	position: relative;
	padding-bottom: 30px;
	padding-right: 20px;
	text-align: right;
}

ol li:after {
	content: counter(list) ".";
	position: absolute;
	left: -1.5em;
	width: -80px;
	text-align: right;
	color: blue;
	
	
}







/* ============================================================
   Адаптив. Оригинал был свёрстан под фиксированные 1366×768,
   поэтому ниже переопределены только те блоки, что не влезали.
   ============================================================ */

.home-screen {
	width: 100vw;
	height: 100vh;
	background-size: cover;
	background-position: center;
}

/* кнопки заставки — в долях, а не в пикселях от угла */
.home-screen button {
	width: min(390px, 60vw);
	height: min(80px, 11vh);
	font-size: clamp(16px, 2.4vw, 28px);
	top: 50.8%;
	left: 50%;
	transform: translateX(-50%);
}

.home-screen button#high-score-btn {
	width: min(150px, 30vw);
	height: min(40px, 7vh);
	font-size: clamp(11px, 1.3vw, 15px);
	top: 49.5%;
	left: auto;
	right: 4vw;
	transform: none;
}

.start-form {
	width: min(800px, 92vw);
	height: auto;
	max-height: 90vh;
	overflow-y: auto;
	transform: translate(-50%, -50%);
}

.start-form .title {
	font-size: clamp(20px, 4vw, 32px);
	margin-bottom: clamp(16px, 5vh, 50px);
}

.start-form .game-option {
	font-size: clamp(18px, 3.4vw, 30px);
	height: clamp(44px, 9vh, 70px);
	line-height: clamp(44px, 9vh, 70px);
	margin-left: clamp(8px, 4vw, 40px);
}

.start-form input[type="submit"] {
	width: min(200px, 55vw);
	height: min(52px, 9vh);
	font-size: clamp(18px, 3vw, 28px);
}

.score-board {
	left: 50%;
	top: 5vh;
	transform: translateX(-50%);
	width: min(500px, 92vw);
	height: min(500px, 80vh);
	overflow-y: auto;
}

.faq {
	width: min(50%, 92vw);
	font-size: clamp(13px, 1.4vw, 16px);
}

/* панель управления и счётчики: на узком экране перестраиваются в строку */
.control-panel {
	display: none;
	max-width: 96vw;
	padding: clamp(6px, 1.5vw, 20px);
}

.control-panel button {
	width: clamp(74px, 19vw, 142px);
	height: clamp(32px, 6vh, 40px);
	font-size: clamp(12px, 1.6vw, 16px);
}

.timer, .score {
	font-size: clamp(13px, 1.7vw, 20px);
	padding: clamp(5px, 1vw, 10px);
	pointer-events: none;
}

@media (max-width: 760px) {
	/* счётчики — по нижним углам, панель кнопок остаётся по центру */
	.timer {
		right: 2px;
		bottom: 6px;
		padding: 4px 6px;
	}

	.score {
		left: 2px;
		bottom: 6px;
		padding: 4px 6px;
	}

	.control-panel {
		bottom: 4px;
		padding: 6px;
		opacity: 0.85;
	}

	.start-form .suit {
		background-position: right 50%;
		background-size: min(200px, 42vw) auto;
	}

	.start-form .suit.one,
	.start-form .suit.two,
	.start-form .suit.four {
		width: min(375px, 66vw);
	}
}
