body, html {
    margin: 0;
    padding: 0;
    height: 100%;
}

#app {
    margin-left: 13%;
    margin-right: 13%;
    height: 100%;	
}


#app .game-container {
    height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #E1E2B7
}

#game-context {
    width: 8%;
    height: 100%;
    display:flex;
    flex-direction: column;
    justify-content: space-evenly;
    border-right: solid black;    
}

.deal-op-bar {
    display:flex;
    flex-direction: column;
    justify-content: space-evenly;
    
    width: auto;
    height: 35%;
    align-items: center;
}

.game-table {
    height: 100%;
    width: 92%;
    flex: 9;
    display: flex;
    flex-direction: column;
}

.top {
    height: 31%;    
}

.middle {
    height: 38%;
}

.bottom {
    height: 31%;
}

.left {
    width: 33%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.right {
    width: 33%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.player {
    font-size: xx-large;
}
/* @media (min-aspect-ratio: 1.3) {}*/
:root {
    /* at most 6 cards per suit*/
    --side-card-raw-width: calc(35vw / 6);
    --side-card-height: calc(95vh * 0.35 / 4);
    --side-card-width: min(var(--side-card-raw-width), var(--side-card-height) /1.7);
    
    --side-card-font-size: 100%;
	
    --card-width: calc(74vw * 0.92 / 13);
}

.board-num {
    border: solid thick #1CC32C;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio:1;
    font-size: 180%;
}

.vuln-0 {}
.vuln-1 {
    border-bottom: solid thick #DD1818;
    border-top: solid thick #DD1818;
}
.vuln-2 {
    border-left: solid thick #DD1818;
    border-right: solid thick #DD1818;
}
.vuln-3 {
    border: solid thick #DD1818;
}

.modal {
    --bs-border-color: #111010 !important;
}
.modal-content {
    background-color: #F0F0F0 !important;
}

.bid-info {
    font-size: large;
}
.contract {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 180%;
}

.tricks {
    font-size: x-large;
    
    aspect-ratio: 1;
    display: grid;
    grid-template-rows: repeat(2,50%);
    grid-template-columns: repeat(2,50%);

    .our-wins {
	grid-row: 1/3;
	grid-column: 1;
	display: flex;
	align-items: start;
	justify-content: center;
	z-index: 9;
	background-color: #1226E0 !important;
	color: #F0F0F0;
    }

    .their-wins {
	grid-row: 2;
	grid-column: 1/3;
	display: flex;
	align-items: center;
	justify-content: end;
	background-color: #111010 !important;
	color: #F0F0F0;
    }    
}

#table-center {
    min-width: 20vw;
    margin-left: 10px;
    margin-right: 10px;    
    height: 100%;
    display: grid;
    grid-template-rows: 34% 33% 33%;
    grid-template-columns: 34% 33% 33%;
    grid-template-areas:
	".   top   ."
	"left . right"
	".  bottom .";

    .visible-card {
	margin-left: 20%;
	width: var(--side-card-width);
	font-size: 130%;
    }

    .top-p {
	/*grid-area: top;*/
	grid-row: 1;
	grid-column: 2;
    }
    .left-p {
	/*grid-area: left;*/
	grid-row: 2;
	grid-column: 1;
    }

    .right-p {
	grid-row: 2;
	grid-column: 3;
    }
    .bottom-p {
	grid-row: 3;
	grid-column: 2;
    }
}

/* @media (min-aspect-ratio: 1.3) {} END*/

@media (min-aspect-ratio: 1.1) and (max-aspect-ratio: 1.3) {
    :root {
	--card-width: calc(82vw * 0.92 / 13);
    }
    
    #app {
	margin-left: 9%;
	margin-right: 9%;
	height: 100%;	
    }
}

@media (max-aspect-ratio: 1.1) {
    #app {
	margin-left: 1.5%;
	margin-right: 1.5%;
	height: 100%;	
    }

    #app .game-container {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
    }
    
    :root {
	/*minus player name height */
	--side-card-height: calc(85vh * 0.50 / 5);
	
	--table-center-width: 30vw;
	--played-card-width: calc(30vw / 3);
        
	--card-width: calc(95vw / 13);
    }

    #game-context {
	width: 100%;
	padding-top: 7px;
	padding-bottom: 6px;
	
	height: 10%;
	display: flex;
	flex-direction: row;
	justify-content: space-evenly;

	border-right: none;
	border-bottom: solid black;
    }
    
    .game-table {
	height:90%;
	width:100%;
    }
    .top {
	height: 25%;
    }

    .middle {
	height: 50%;
    }

    .bottom {
	height: 25%;
    }

    .player {
	font-size: x-large;
    }
    .left .player {
	font-size: large;
    }
    .right .player {
	font-size: large;
    }
    
    .deal-op-bar {
	display:flex;
	flex-direction: row;
	justify-content: space-evenly;
	width: 35%;
	height: auto;
	align-items: center;
    }
    
    .board-num {
	height: 100%;
	font-size: 150%;
    }

    .contract {
	font-size: 150%;
	border: solid black;
	padding-left: 8px;
	padding-right: 8px;
    }

    .tricks {
	font-size: x-large;
    }
}


.sse-conn-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

div.cards {
    display: flex;
    flex-direction: column;
    align-items:center;    
}

.concealed-card {
    /*min-width: calc(var(--card-width) * 0.7);*/
    width: var(--card-width);
    aspect-ratio: 1/1.7;
    
    text-align: center;
    border: solid 1px blue;    
    background-color: #099DBD;
    transform: rotate(1deg);
}

.concealed-card:not(:first-child) {
    margin-left: calc(var(--card-width) * -0.7); /*simple overlay*/
}

.visible-card {
    width: var(--card-width); /* 2em; */
    aspect-ratio: 1/1.7;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    text-align: center;
    font-size: xx-large;
    background-color: #F0F0F0 !important;
}

.left .visible-card {
    width: var(--side-card-width);
    height: var(--side-card-height);
    font-size: var(--side-card-font-size);
}
.right .visible-card {
    width: var(--side-card-width);
    height: var(--side-card-height);
    font-size: var(--side-card-font-size);
}

.overlay-v-cards .visible-card {
    text-align: left;
    padding-left: 3%;
}

@media (max-width: 400px) {
    .visible-card {
	font-size: x-large;
    }
}

.overlay-v-cards .visible-card:not(:first-child) {
    margin-left: calc(var(--side-card-width) * -0.37); /*simple overlay*/
}

.suit-red {
    color: #DD1818;
}

div.playable-card {
    transform: translateY(calc(var(--card-width) * 0.15));
}

.player {
    /*border: solid 3px black;*/
}

.pos-occupied {
    background-color: lightyellow;
}

.your-turn {
    border: solid 3px blue !important;
    /*background-color: lightblue;    */
}

#form {
    height: 90%;

    display: flex;
    flex-direction: column;    
    align-items: center;
    justify-content: center;
}

#inForm {
    display: flex;
    flex-direction: column;    
    justify-content: center;
}

#inForm input {    
    height: 30%;
    margin-top: 3%;
    font-size: 5vmin;
}

#inForm h3 {
    font-size: 5vmin;    
    margin-bottom: 3%;
}

#form-err {
    font-size: 5vmin;
    color: red;
}

#app .loading-user {
    height: 90%;
    font-size: 10vmin;    
    display: flex;
    flex-direction: column;    
    justify-content: center;
    text-align: center;
}

.tbl-area {
    margin-left: 10px;
    margin-right: 10px;    
    width: 100%;
    height: 100%;
}

.pub-tables {
    width: 100%;

    display: grid;
    row-gap: 3%;
    grid-template-columns: 34% 33% 33%;    
    /*grid-template-rows: 34% 33% 33%;
    grid-template-columns: 34% 33% 33%;*/
}

.pub-table {
    width: calc(33vw * 0.76);
    height: calc(33vw * 0.76);
    
    border: solid 3px black;

    display: grid;
    grid-template-rows: repeat(5,20%);
    grid-template-columns: repeat(5,20%);
    .center {
	grid-row: 3;
	grid-column: 3;
	
	display: flex;
	align-items: center;
	justify-content: center;

	border: solid 1px black;	
	font-size: 3vmax;
    }
    
    .N {
	grid-row: 1;
	grid-column: 2/5;
    }
    .W {
	grid-row: 2/5;
	grid-column: 1;
	writing-mode: vertical-lr
    }

    .E {
	grid-row: 2/5;
	grid-column: 5;
	writing-mode: vertical-rl	
    }
    .S {
	grid-row: 5;
	grid-column: 2/5;
    }
    
}

.pub-table button {
    background-color: lightgreen;
}

.pub-table div {
    background-color: yellow;
    display: flex;
    align-items: center;
    justify-content: center;
    border: solid 1px black;	
}

.pub-table .center {
    background-color: white;
}
