*,
*:before,
*:after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--board-background: #879ba6;
	--active-player-fg: #fff;
	--active-player-bg: lightgreen;
	--inactive-player-fg: #ccc;
	--inactive-player-bg: darkgreen;
	--p1-chip: #0000ff;
	--p2-chip: #00a300;
}

html {
	/* 
	https://css-tricks.com/linearly-scale-font-size-with-css-clamp-based-on-the-viewport/
	Minimum viewport width = 650
	Maximum viewport width = 1350
	Minimum font size = 0.85
	Maximum font size = 1.3
	1 rem = 16
	*/
	/* font-size: clamp(0.85rem, 0.4321rem + 1.0286vw, 1rem); */

	/* 
	https://css-tricks.com/linearly-scale-font-size-with-css-clamp-based-on-the-viewport/
	Minimum viewport width = 350
	Maximum viewport width = 800
	Minimum font size = 1
	Maximum font size = 1.3
	1 rem = 16
	*/
	font-size: clamp(1rem, 0.7667rem + 1.0667vw, 1.3rem);

	/* height: 100dvh; */
}

#document svg {
	fill: currentColor;
}

body {
	font-family: Arial, Helvetica, sans-serif;

	overscroll-behavior-block: none;
	touch-action: pinch-zoom;

	background-color: #000;

	/* display: grid; */
	/* grid-template-rows: 1fr 0px; */
	/* height: -webkit-fill-available; */

	/* min-width: 650px; */
	max-width: 1050px;

	height: 100vh;
	height: 100dvh;
	overflow: hidden;

	/* margin: 0 auto; */
}

/* To correct issue with Firefox not vertically centering text in button */
button {
	font-family: inherit;
}

#app {
	display: grid;
	grid-template-rows: auto 1fr auto;
	height: 100%;
	max-height: 100%;
	overflow: auto;
	/* min-width: 650px; */
	max-width: 800px;
	margin: 0 0 0 auto;
}

header {
	display: grid;
	align-items: center;
	grid-template-columns: 1fr auto 1fr;
	color: white;
	background-color: black;
	font-size: 0.9rem;
}

header .center {
	display: flex;
	align-items: center;
}

header .center .title {
	display: flex;
	padding: 0 0.5rem;
}

header .center .headerIcon {
	height: 1.4rem;
	padding: 0.1rem 0;
}

header .right {
	text-align: end;
	padding: 0 0.5rem;
}

main {
	/* height: 100%; */
	/* max-height: 100%; */
	overflow: hidden;

	/* overflow: auto; */
	display: grid;
	/* grid-template-rows: 6fr 2fr 2fr; */
	grid-template-rows: 7.5fr 2.5fr;
	/* grid-template-rows: auto 1fr; */
}

footer {
	display: grid;
	/* grid-template-columns: 1fr auto 1fr; */
	grid-template-columns: auto 1fr auto;
	color: white;
	background-color: black;
	padding: 0.25rem 0.5rem 0.75rem 0.5rem;
	font-size: 0.9rem;
}

footer > * {
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

footer .center {
	text-align: center;
	padding: 0 0.25rem;
}

footer .center.poll {
	text-decoration: underline;
}

footer .right {
	text-align: end;
}

/* ======================================== General ====================================== */
input[type="text"],
input[type="number"],
textarea {
	padding: 0.25rem;
	font-family: inherit;
	font-size: inherit;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Firefox */
input[type="number"] {
	appearance: textfield;
	-moz-appearance: textfield;
	text-align: end;
}

button,
summary {
	cursor: pointer;
}

input[type="checkbox"] {
	appearance: none;
	position: relative;
	display: inline-block;
	background: lightgrey;
	height: 1.65rem;
	width: 2.75rem;
	vertical-align: middle;
	border-radius: 2rem;
	box-shadow: 0px 1px 3px #0003 inset;
	transition: 0.25s linear background;
	border-color: var(--cw-success);
	box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}
input[type="checkbox"]::before {
	content: "";
	display: block;
	width: 1.25rem;
	height: 1.25rem;
	background: #fff;
	border-radius: 1.2rem;
	position: absolute;
	top: 0.2rem;
	left: 0.2rem;
	box-shadow: 0px 1px 3px #0003;
	transition: 0.25s linear transform;
	transform: translateX(0rem);
}
input[type="checkbox"]:checked {
	background: green;
}
input[type="checkbox"]:checked::before {
	transform: translateX(1rem);
}
input[type="checkbox"]:focus {
	outline: 0.1rem solid black;
	outline-offset: -0.1rem;
}
/* input[type="checkbox"]:focus-visible { */
/* outline-color: transparent; */
/* outline: 2px solid dodgerblue; */
/* outline-offset: -0.1rem; */
/* } */

/* ======================================== Board ====================================== */

.boardArea {
	display: flex;
	justify-content: center;
	max-height: 100%;
	overflow: hidden;
	background-color: var(--board-background);
}

.board {
	display: grid;
	grid-template-columns: repeat(10, 1fr);
	grid-template-rows: repeat(10, 1fr);
	align-self: center;
	justify-self: center;
	width: 100%;
	height: 100%;
	overflow: hidden;

	gap: 0.5%;
	padding: 1%;

	/* padding: 0.25rem; */

	caret-color: transparent;
}

.board .cell {
	position: relative;
	/* aspect-ratio: 238 / 333; */
	overflow: hidden;
	background-repeat: no-repeat;
	/* background-size: 300%; */
	background-size: 12vh;
	cursor: pointer;
}

/* Jokers */
.board .cell.wi {
	background-position: center;
	background-size: 200%;
}

.board .cell .chip {
	position: absolute;
	top: 70%;
	left: 65%;
	translate: -50% -50%;
	width: 60%;
	pointer-events: none;
	filter: drop-shadow(-1px -1px 1px rgba(0, 0, 0, 0.5));
	visibility: hidden;
}

.board .cell.p1 .chip,
.board .cell.p2 .chip {
	visibility: visible;
	stroke: black;
	stroke-width: 2%;
}

/* chip */
.board .cell.p1 svg.chip circle {
	fill: var(--p1-chip);
}

.board .cell.p2 svg.chip circle {
	fill: var(--p2-chip);
}

/* Star */
.board .cell svg.chip path {
	fill: transparent;
	stroke: none;
	/* display: none; */
}

.board .cell.p1Sequence svg.chip path,
.board .cell.p2Sequence svg.chip path {
	fill: white;
	/* display: unset; */
}

@keyframes boardCellHighlight {
	0% {
		outline-width: 0.5rem;
	}
	50% {
		outline-width: 0.25rem;
	}
	100% {
		outline-width: 0.5rem;
	}
}

.board .cell.p1LastPlay,
.board .cell.p2LastPlay {
	z-index: 1;
	outline-color: yellow;
	outline-style: groove;
	outline-width: 0.5rem;
	outline-offset: -0.2rem;
	box-shadow: -0.6rem -0.6rem 0.5rem rgba(0, 0, 0, 1), -0.6rem -0.1rem 0.5rem rgba(0, 0, 0, 1), -0.1rem -0.6rem 0.5rem rgba(0, 0, 0, 1);
	animation-name: boardCellHighlight;
	animation-duration: 500ms;
	animation-iteration-count: 10;
}

/* Shown on board for debugging screen shots */
#gameNumber {
	position: absolute;
	font-size: 0.5rem;
	transform-origin: top center;
	rotate: 270deg;
	top: 70%;
	translate: -50% -50%;
}

.board .cell .boardSpaceLabel {
	pointer-events: none;
	display: block;
	position: absolute;
	top: 0.1rem;
	right: 0.1rem;
	font-size: 0.8rem;
	background-color: white;
}

/* ======================================== Player Area ====================================== */
.playerArea {
	/* background-color: blanchedalmond; */
	background-color: var(--inactive-player-bg);
	border: 1px solid;
	display: grid;
	grid-template-columns: 82% 18%;
	grid-template-rows: auto 1fr auto 1fr;
	/* align-items: center; */
	/* justify-content: center; */
}

.playerArea .header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	color: var(--inactive-player-fg);
	padding: 0 0.5rem;
	grid-column: span 2;
	align-items: center;
}

.playerArea .header.p1 {
	background-color: var(--p1-chip);
}

.playerArea .header.p2 {
	background-color: var(--p2-chip);
}

.playerArea[data-active="p1"] .p1.header {
	color: var(--active-player-fg);
}

.playerArea[data-active="p2"] .p2.header {
	color: var(--active-player-fg);
}

.playerArea .header .right {
	display: flex;
	align-items: center;
	justify-content: right;
	font-size: 0.9rem;
}

.playerArea .header .center {
	display: flex;
	align-items: center;
}

.playerArea .header .center .playerName {
	font-weight: bold;
	white-space: nowrap;
	font-size: 0.9rem;
}

.playerArea .header .center .tossPip {
	margin-right: 0.5rem;
	font-size: 0.6rem;
}

.playerArea .header .center .winPip {
	margin-left: 0.5rem;
	font-size: 0.8rem;
}

/* ======================================== Discard ====================================== */
.playerArea .discard {
	width: 100%;
	height: 100%;
	/* border: 1px solid; */
	/* border-left: 0.2rem inset forestgreen; */
}

.playerArea[data-active="p1"] .p1.discard {
	background-color: var(--active-player-bg);
}

.playerArea[data-active="p2"] .p2.discard {
	background-color: var(--active-player-bg);
}

.playerArea .discard {
	/* padding: 1vh 1vh 0 1vh; */
	padding: 0.75vh 0.75vh 0 0.75vh;
}

/* ======================================== Hand ====================================== */

.playerArea .hand {
	display: flex;
	height: 100%;
	max-height: 100%;
	/* border: 1px solid; */
	/* padding: 3% 2% 0 2%; */
	/* padding: 1vh 1vh 0 1vh; */
	padding: 0.75vh 0.75vh 0 0.75vh;
	overflow: visible;
	justify-content: space-around;

	/* max-width: 300px; */
	/* position: relative; */
	/* top: 50%; */
	/* left: 50%; */
	/* translate: -50% -50%; */
}

.playerArea[data-active="p1"] .p1.hand {
	background-color: var(--active-player-bg);
}

.playerArea[data-active="p2"] .p2.hand {
	background-color: var(--active-player-bg);
}

.playerArea .hand .cell {
	width: 25%;
	height: 100%;
	overflow: visible;
	margin-left: -10%;
	max-width: 85px;

	background-color: transparent;
	border: none;

	background-size: cover;
	/* background-size: 100%; */
	background-position-y: 1vh;
	background-repeat: no-repeat;
	filter: drop-shadow(-2px -2px 3px black);
	/* filter: drop-shadow(0px 0px 2px black) drop-shadow(0px 0px 2px black); */
	cursor: pointer;
	caret-color: transparent;
	touch-action: pinch-zoom;
}

/* .playerArea .hand .cell:hover, */
.playerArea .hand .cell[data-selected] {
	/* filter: drop-shadow(0px 0px 4px black) drop-shadow(0px 0px 4px black); */
	filter: drop-shadow(-4px -4px 5px black);
	background-position-y: 0;
	z-index: 1;
	max-width: unset;
}

/* .playerArea .hand .cell[data-selected] {
	filter: drop-shadow(-4px -4px 5px black);
} */

.playerArea .hand .cell:first-child {
	margin-left: 0;
	/* translate: 0 0; */
}

.playerArea .hand .cell .cardWrapper {
	width: 100%;
	height: 100%;
	/* overflow: hidden; */
}

.playerArea .hand .cell .card {
	width: 100%;
	max-width: 100%;
	object-fit: cover;
	object-position: 0 0;
	display: inline-block;
}

.playerArea .discard .cell {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background-size: 200%;
	background-repeat: no-repeat;
	background-size: 130%;
	background-repeat: no-repeat;
	filter: drop-shadow(-2px -2px 2px black);
	background-color: transparent;
	border: none;
	cursor: pointer;
	overflow: visible;
}

/* ================================= Stopwatch ======================================================= */

.stopwatch {
	/* opacity: 1; */
	/* background-color: inherit; */
	transition: all 50ms ease-in-out;
}

.stopwatch.blinkOff {
	/* opacity: 0.3; */
	/* background-color: yellow; */
	color: black;
}

/* ================================= Slide Menu ======================================================= */

.slideMenu {
	position: fixed;
	top: 0;
	left: 0;
	font-size: 1.25rem;
	background-color: #fdfdfd;
	transition: translate 300ms ease-in-out;
	translate: -100%;
	border-right: 0.1rem solid black;
	border-bottom: 0.1rem solid black;
	border-bottom-right-radius: 5px;
	box-shadow: 4px 6px 6px rgba(0, 0, 0, 0.2);
	z-index: 2;
}

.slideMenu.open {
	translate: 0 0%;
}

.slideMenu .menuBody {
	overflow: auto;
	max-height: 100dvh;
	border-bottom-right-radius: 5px;
	background-color: inherit;
}

.slideMenu .pullTab {
	position: absolute;
	top: 0;
	right: 0;
	transform: translateX(100%);
	line-height: 0;
	background-color: inherit;
	padding: 0.5rem;
	box-shadow: 4px 6px 6px rgba(0, 0, 0, 0.2);
	border-right: 0.1rem solid black;
	border-bottom: 0.1rem solid black;
	border-bottom-right-radius: 0.5rem;
	cursor: pointer;
}

.slideMenu .pullTab .bi-arrow-left-right {
	width: 1.5rem;
	height: 1.5rem;
	pointer-events: none;
}

.slideMenu .header {
	color: #258cdb;
	font-weight: bold;
	text-align: center;
	padding: 0.15rem 0.5rem;
}

.slideMenu .subHeader {
	color: #363636;
	background-color: #beddf4;
	padding: 0.25rem 0.5rem;
	text-align: center;
	font-weight: bold;
	/* color: white;
	background-color: black; */
}

.slideMenu ul li {
	/* color: #363636; */
	/* padding: 0.25rem 0.75rem; */
	/* cursor: pointer; */
	list-style-type: none;
}

.slideMenu ul li label {
	cursor: inherit;
}

/* .slideMenu ul li:hover {
	background: #f2f2f2;
} */

.slideMenu .navImgBox .opacity label {
	display: block;
	text-align: center;
	font-size: 1rem;
}

.slideMenu .navImgBox .opacity [type="range"] {
	width: 100%;
}

.slideMenu [type="checkbox"] {
	/* height: 1.2rem; */
	/* width: 1.2rem; */
	vertical-align: middle;
	/* margin: 0 0 0 0.5rem; */
	margin: 0 auto;
	cursor: inherit;
}

.slideMenu [type="radio"] {
	height: 1rem;
	width: 1rem;
	cursor: inherit;
}

.slideMenu .appVersion {
	text-align: end;
	border-top: 0.25rem solid;
	padding: 0 0.25rem;
}

.slideMenu .navBtnGroup {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.25rem;
	padding: 0.25rem;
}

.slideMenu .navBtn {
	display: grid;
	align-items: center;
	border: 0.1rem solid;
	border-radius: 0.25rem;
	padding: 0.1rem 0.25rem;
	/* aspect-ratio: 1 / 1; */
	background-color: inherit;
	min-width: 10ch;
}

.slideMenu .navBtn:focus {
	outline: 0.1rem solid;
}

.slideMenu .navBtn:hover {
	background-color: #f2f2f2;
}

.slideMenu .navBtn .icon {
	line-height: 0;
	pointer-events: none;
}

.slideMenu .navBtn .icon svg {
	height: 2rem;
	width: auto;
}

.slideMenu .navBtn .text {
	pointer-events: none;
}

.slideMenu.btnOptText .navBtn .icon {
	display: none;
}

.slideMenu.btnOptText .navBtn .text {
	min-height: 1.5rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.slideMenu.btnOptIcon .navBtn .text {
	display: none;
}

.slideMenu .navBtn .text .subTitle {
	font-size: 0.5rem;
}

.slideMenu .navBtn .text .title {
	font-size: 0.65rem;
}

/* ======================================== msgBox ====================================== */
.msgBox .winBitmoji {
	width: 100%;
}

.msgBox img.singleCard {
	display: block;
	margin: 0 auto;
	width: 10rem;
	padding-top: 0.5rem;
}

.msgBox .statistic .statTable {
	display: grid;
	grid-template-columns: auto auto;
	margin-bottom: 0.25rem;
}

.msgBox .statistic .statTable ol {
	list-style: none;
}

.msgBox .statistic .statTable ol {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: subgrid;
}

.msgBox .statistic .statTable li {
	--t-border-color: #000;
	box-shadow: 0.05rem 0 0 0 var(--t-border-color), 0 0.05rem 0 0 var(--t-border-color), 0.05rem 0.05rem 0 0 var(--t-border-color), 0.05rem 0 0 0 var(--t-border-color) inset, 0 0.05rem 0 0 var(--t-border-color) inset;
	padding: 0.25rem;
}

.msgBox .statistic .statTable li.value {
	text-align: center;
}

.msgBox .statistic .statTable li.tableTitle {
	grid-column: 1 / -1;
	font-weight: bold;
	text-align: center;
	box-shadow: none;
}

.msgBox .statistic .statTable li.tableSubTitle {
	grid-column: 1 / -1;
	font-size: 0.7rem;
	text-align: center;
	box-shadow: none;
	padding-top: 0;
}

.msgBox .msgComposeBody {
	display: grid;
	grid-template-rows: 1fr auto;
	height: 100%;
}

.msgBox .msgComposeBody #msgComposeForm {
	display: flex;
}

.msgBox .msgComposeBody #msgText {
	width: 100%;
}

.msgBox .msgComposeBody .sendBtn {
	font-size: inherit;
	padding: 0.25rem;
	line-height: 0;
}

.msgBox .msgComposeBody .sendBtn .bi-send {
	width: 1.75rem;
}

.msgBox .msgComposeBody .history {
	margin-bottom: 0.25rem;
	font-size: 0.9rem;
	overflow-y: auto;
	/* min-height: 10vh; */
	max-height: 50dvh;
}

.msgBox .msgComposeBody .history .thisPlayer,
.msgBox .msgComposeBody .history .otherPlayer {
	max-width: 90%;
	width: fit-content;
	padding: 0.5rem;
	border-radius: 1.25rem;
	margin-bottom: 0.5rem;
}

.msgBox .msgComposeBody .history .thisPlayer {
	background-color: lightblue;
	margin-left: auto;
}

.msgBox .msgComposeBody .history .otherPlayer {
	background-color: papayawhip;
}

.msgBox .msgComposeBody .history .playerName {
	margin-left: 0.5rem;
	font-weight: bold;
	font-size: 0.7rem;
}

.msgBox .msgComposeBody .history .game {
	font-size: 0.7rem;
}

.msgBox .msgComposeBody .history .dateTime {
	font-size: 0.7rem;
}

/* ======================================== MsgBox New Game ====================================== */

.msgBox #newGameForm #turnTimeLimit {
	width: 4ch;
}

.msgBox #newGameForm .playerColorSelectArea {
	display: flex;
	align-items: center;
	justify-content: space-around;
	text-align: center;
	margin-top: 0.5rem;
}

.msgBox #newGameForm .playerColorSelectArea .chip {
	width: 2rem;
}

.msgBox #newGameForm .playerColorSelectArea svg.chip path {
	fill: white;
}

.msgBox #newGameForm .playerColorSelectArea .p1 svg.chip circle {
	fill: var(--p1-chip);
}

.msgBox #newGameForm .playerColorSelectArea .p2 svg.chip circle {
	fill: var(--p2-chip);
}

/* ======================================== Toast (dead card) ====================================== */
.toastContainer img.singleCard {
	display: block;
	margin: 0 auto;
	width: 8rem;
	padding-top: 0.5rem;
}

.toastContainer .msgShowBody .title {
	font-weight: bold;
	font-size: 1.1rem;
}

.toastContainer .msgShowBody .msgText {
	margin-left: 1rem;
}
/* ======================================== Document ====================================== */
.msgBox .whatsNew ul > li {
	font-weight: bold;
}

.msgBox .whatsNew > ul {
	margin-left: 1rem;
}

.msgBox .whatsNew > ul ol {
	margin-left: 1rem;
}

.msgBox .sequenceInstructions ol {
	margin-left: 1rem;
}

/* ======================================== Utility ====================================== */
.d-none {
	display: none !important;
}

.g-col-span-2 {
	grid-column: span 2 !important;
}

.g-col-span-3 {
	grid-column: span 3 !important;
}

.g-col-span-all {
	grid-column: 1 / -1 !important;
}
