[hidden] { display: none !important; }
::placeholder { color: #8291BC; }

h1 {
	font-size: 1.75rem;
}
main {
	max-width: 960px;
	margin-bottom: 1.5rem;
}

#subtitleContainer {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
	margin-bottom: 1.5rem;
}
#subtitleContainer p span {
    color: #c1e9eb;
}
.playerTagDisplay {
    width: fit-content;
    padding: 0.5rem 0.75rem;
    overflow: clip;
    color: #b4c4f4;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    background-color: #1d316c;
}
#playerTagDisplayContent {
    cursor: pointer;
    text-decoration: underline;
}

.deck-form > section {
	position: relative;
	margin-bottom: 0.5rem;
	padding: 0.75rem;
	color: #b4c4f4;
	border-radius: 0.5rem;
	background-color: #1d316c;
	box-shadow: 0 2px 10px #081436;
}
.deck-form > section > .optional {
    position: absolute;
    top: 15px;
    right: 10px;
    text-align: right;
}
.deck-form > section h2 {
	margin-bottom: 1rem;
	font-size: 1rem;
	text-transform: uppercase;
}
.deck-form .clash-royale-btn {
	display: block;
	margin-top: 1rem;
}
.deck-form label {
    display: block;
    margin-bottom: 0.5rem;
}
.deck-form input[type="text"] {
    margin-bottom: 1.5rem;
    padding: 7px;
    width: 100%;
    font-weight: 500;
    color: var(--heading-color);
    border: none;
    outline: none;
    border-radius: 0.5rem;
    background: #1d316c;
	box-shadow: 0 1px 6px #081436;
}
.deck-form #deck-import {
	margin-bottom: 1rem;
	background-color: #11245a;
	box-shadow: none;
}

#hideMissingCards {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.375rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    overflow: hidden;
    border-radius: 1rem;
    background-color: #11245a;
}
#hideCardsCheckbox {
    width: 13px;
    height: 13px;
}
#hideMissingCards label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 0.75rem;
    word-wrap: break-word;
    user-select: none;
}
.hide-missing-cards .missing {
    display: none;
}

#deck-cards {
	display: grid;
	grid-gap: 0.5rem;
	grid-template-columns: repeat(4, calc(25% - 0.375rem));
	grid-template-rows: auto auto;
	align-items: center;
	max-width: 550px;
	margin: 0 auto 1rem auto;
}
.card-select-container {
    position: relative;
    cursor: pointer;
}
.card-select-container img {
	display: block;
    width: 100%;
}
.card-select-container[data-elixir]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 26%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
}
.card-select-container[data-elixir="1"]::before { background-image: url("/clash-royale/res/img/elixir/1.webp"); }
.card-select-container[data-elixir="2"]::before { background-image: url("/clash-royale/res/img/elixir/2.webp"); }
.card-select-container[data-elixir="3"]::before { background-image: url("/clash-royale/res/img/elixir/3.webp"); }
.card-select-container[data-elixir="4"]::before { background-image: url("/clash-royale/res/img/elixir/4.webp"); }
.card-select-container[data-elixir="5"]::before { background-image: url("/clash-royale/res/img/elixir/5.webp"); }
.card-select-container[data-elixir="6"]::before { background-image: url("/clash-royale/res/img/elixir/6.webp"); }
.card-select-container[data-elixir="7"]::before { background-image: url("/clash-royale/res/img/elixir/7.webp"); }
.card-select-container[data-elixir="8"]::before { background-image: url("/clash-royale/res/img/elixir/8.webp"); }
.card-select-container[data-elixir="9"]::before { background-image: url("/clash-royale/res/img/elixir/9.webp"); }
.card-select-container[data-elixir="?"]::before { background-image: url("/clash-royale/res/img/elixir/question_mark.webp"); }

#deck-stats {
	display: grid;
	grid-gap: 0.5rem;
	grid-template-columns: 1fr 1fr;
	margin-bottom: 0.75rem;
}
.stat {
	display: grid;
	grid-gap: 0.35rem;
	grid-template-columns: 32px 1fr;
	grid-template-rows: auto;
	padding: 0.5rem;
	color: #a5b3df;
	border-radius: 0.5rem;
	background-color: #11245a;
}
.stat img {
	width: auto;
	height: 32px;
	margin: 0 auto;
}
.stat-name {
	display: block;
	font-weight: 500;
	font-size: 13px;
	line-height: 13px;
}
.stat-value {
	display: block;
	font-weight: 600;
	font-size: 15px;
	height: 18px;
	color: var(--heading-color);
}
.stats-notice {
    display: block;
    text-align: center;
    font-size: 0.875rem;
    color: #c1e9eb;
}


/***** DECK CHECKER *****/
#dynamicDeckChecker > div:first-of-type {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
#dynamicDeckChecker h2 {
    font-style: italic;
    margin: 0;
}
#deckStrategySelect {
    padding: 0.25rem;
    color: var(--heading-color);
    font-size: 0.875rem;
    border: none;
    border-radius: 0.25rem;
    background: #2c4180;
}
#dynamicDeckChecker h2, #dynamicDeckCheckerPlaceholder {
    font-size: 0.8125rem;
    text-align: center;
}
#dynamicDeckCheckerPlaceholder {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background-color: #11245a;
}
#dynamicDeckCheckerDebug {
	font-size: xx-small;
    display: grid;
    grid-auto-flow: column;

	overflow: auto;
	white-space: nowrap;
}
.deckCheckerSection {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
	padding: 0.5rem 0.5rem 0.75rem;
    font-size: 0.75rem;
	color: #a5b3df;
	background-color: #11245a;
}
.deckCheckerSection:first-of-type {
	margin-top: 0.25rem;
	border-top-left-radius: 0.25rem;
	border-top-right-radius: 0.25rem;
}
.deckCheckerSection:last-of-type {
    margin: 0;
	color: var(--heading-color);
	border-bottom-left-radius: 0.25rem;
	border-bottom-right-radius: 0.25rem;
}
.deckCheckerHeader {
    color: #a5b3df;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
    margin-bottom: 0.5em;
}
#dynamicDeckChecker .deckCheckerHeader {
margin-bottom: 0.75em;
}
.deckCheckerRow {
    display: flex;
	justify-content: space-around;
    text-align: center;
    line-height: 0.75rem;
}
.deckCheckerRow span, .deckCheckerRow a {
	flex: 1;
	padding: 0.25rem 0;
	display: flex;
    flex-direction: column;
	overflow: hidden;
    font-size: 0.75rem;
    color: #a5b3df;
}
.deckCheckerRow.recommended {
	gap: 0.25rem;
}
.deckCheckerRow.recommended .select-mini {
	flex: 1;
	max-width: 77px;
	cursor: pointer;
    overflow: hidden;
}
.deckCheckerWeaknesses {
	gap: 0.25rem;
	justify-content: center;
}
.deckCheckerTextBlue {
	color: var(--ui-font-color);
}
.deckCheckerStrategyCheckBoxFilled {
	width: 1em;
	height: 1em;
	display: inline-block;
	background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg enable-background='new 0 0 64 64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m32 2c-16.569 0-30 13.432-30 30s13.432 30 30 30 30-13.432 30-30-13.432-30-30-30zm-6.975 48-0.02-0.02-0.017 0.02-13.988-14.4 7.029-7.164 6.977 7.184 21-21.619 6.994 7.198-27.975 28.801z' fill='%2335fd35'/%3E%3C/svg%3E");
}
.deckCheckerStrategyCheckBoxLow {
	width: 1em;
	height: 1em;
	display: inline-block;
	background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg enable-background='new 0 0 64 64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m32 2c-16.569 0-30 13.432-30 30s13.432 30 30 30 30-13.432 30-30-13.432-30-30-30zm-6.975 48-0.02-0.02-0.017 0.02-13.988-14.4 7.029-7.164 6.977 7.184 21-21.619 6.994 7.198-27.975 28.801z' fill='%23fdd835'/%3E%3C/svg%3E");
}
.deckCheckerStrategyCheckBoxMissing {
	width: 1em;
	height: 1em;
	display: inline-block;
	background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg version='1.0' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23f00'%3E%3Cpath d='m6.3896 6.4196 87.191 87.191' stroke-width='18.052'/%3E%3Cpath d='m6.3894 93.611 87.441-87.191' stroke-width='17.802'/%3E%3C/g%3E%3C/svg%3E");
}
.deckCheckerRow span > img {
    height: 56px;
    width: auto;
    cursor: pointer;
	object-fit: contain;
}


/***** WINDOW *****/
.select-window-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    width: 100%;
    height: 100%;
    background-color: #0000006b;
}
.select-window {
    display: flex;
    flex-direction: column;
    z-index: 5;
    width: 100%;
    max-width: 500px;
    max-height: 500px;
    margin: 1rem;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #1d316c;
    position: relative;
}
.select-window-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: #293f81;
}
.select-window-title > span {
	color: var(--heading-color);
	font-weight: 600;
	font-size: 1rem;
	text-transform: uppercase;
}
.select-window-title > button {
    width: 28px;
    height: 28px;
    padding: 5px;
	cursor: pointer;
	border: none;
    border-radius: 0.5rem;
    background: #435ba3;
}
.select-window-title > button > svg {
    pointer-events: none;
    fill: none;
    stroke: #b4c4f4;
    stroke-miterlimit: 10;
    stroke-width: 4px;
	transform: rotate(45deg);
}
.select-window-content {
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}
.select-window-content .search-box {
    display: flex;
    margin-top: 1rem;
    background: none;
}
.select-window-content .search-box input {
    margin: auto auto 0.5rem;
    padding: 7px;
    width: 95%;
    font-weight: 500;
    color: var(--heading-color);
    border: none;
    outline: none;
    border-radius: 0.5rem;
    background: #11245a;
}
.select-window-content .search-box input::placeholder {
    color: #7181AC;
}
.window-quick-links {
    display: flex;
    justify-content: space-around;
    margin-top: 0.5rem;
}
.scroll-to-top-container {
    position: absolute;
    bottom: 15px;
    right: 15px;
	display: flex;
	justify-content: center;
	align-items: center;
    border-radius: 5px;
    box-shadow: 0 0 5px black;
    border: 1px solid #00000040;
    cursor: pointer;
    transition-duration: .1s;
}
.scroll-to-top-container:hover {
    background: #D2DCF3;
}
.scroll-to-top-container polygon {
    fill: #b4c4f4;
}
.select-window-container .card-container {
    margin-bottom: 75px;
}

.card-list {
    display: grid;
    grid-gap: 0.75rem 0.5rem;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
}
.select-window .card-list {
    margin: 1rem 0.5rem;
}
.card {
	position: relative;
    cursor: pointer;
}
.card-img {
	display: block;
	width: 100%;
	height: auto;
}
.elixir-img {
    position: absolute;
    top: 0;
    left: 0;
	width: 26%;
	height: auto;
}
.rarity-legendary .elixir-img {
	top: 3%;
	left: 2%;
}
.rarity-champion .elixir-img {
    top: 8%;
}
.card span {
    font-size: .75rem;
    white-space: nowrap;
}
.cards > h3 {
    margin: 0.5rem 0.5rem 0 0.5rem;
}


.tippy-box {
	padding: 0.25rem;
	color: #0F1A32;
	border-radius: 0.25rem;
	background: #c0cce7;
	box-shadow: 0 1px 4px rgb(11 24 62 / 60%);
}
.tippy-box[data-placement^='top'] > .tippy-arrow::before {
	border-top-color: #c0cce7;
}
.tippy-box[data-placement^='bottom'] > .tippy-arrow::before {
	border-bottom-color: #c0cce7;
}
.tippy-box[data-placement^='left'] > .tippy-arrow::before {
	border-left-color: #c0cce7;
}
.tippy-box[data-placement^='right'] > .tippy-arrow::before {
	border-right-color: #c0cce7;
}


/* ADVANCED DECK STATS */
#deckRatings h4 {
	width: fit-content;
    font-size: 0.875rem;
}

.deck-rating-label {
    font-weight: 500;
    font-size: 0.875rem;
}
.deck-rating-label[data-rating="bad"] { color: rgb(255 118 115); }
.deck-rating-label[data-rating="poor"] { color: rgb(255 165 107); }
.deck-rating-label[data-rating="average"] { color: rgb(255 223 119); }
.deck-rating-label[data-rating="good"] { color: rgb(189 231 114); }
.deck-rating-label[data-rating="great"] { color: rgb(119, 235, 121); }
.deck-rating-label[data-rating="excellent"] { color: rgb(105 255 161); }

.deck-rating-description {
	height: 0;
	visibility: hidden;
	margin: 0.25rem 0 0.25rem;
	font-size: 0.75rem;
}
.deck-rating-description:last-of-type {
	margin-bottom: 0;
}

#deckRatings .statbar {
	position: relative;
    display: flex;
	height: 8px;
    margin: 0.25rem auto 0 auto;
	overflow: clip;
	background: rgb(255,118,115);
	background: linear-gradient(90deg, rgb(255 118 115) 0%, rgb(255 165 107) 25%, rgb(255 223 119) 50%, rgb(189 231 114) 75%, rgb(119, 235, 121) 100%);
}
#deckRatings .statbar div {
	width: 100%;
    background-color: #2b3b6c;
    background-color: #22366d;
    background-color: hsla(224, 68%, 21%, 0.9);
    background-color: #1d316c;
}
#deckRatings .statbar div {
	transition: transform 0.75s cubic-bezier(0.25, 0.45, 0.25, 0.95);
}

#deckRatings div:has(h4) {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#deckRatings div:has(h4):nth-child(odd) {
    margin-top: 1rem;
}
#deckRatings div:has(h4):first-of-type {
    margin: 0;
}

#showTraitStatDescriptions {
	padding: 0.25rem 0.125rem;
	font-size: 0.875rem;
	color: inherit;
	cursor: pointer;
	border: none;
	background: none;
}

.advanced-stats-container {
	min-height: 117px;
	padding: 0.75rem;
	border-radius: 0.375rem;
	background-color: #11245a;
}

#weakAgainst {
	margin-bottom: 0.5rem;
}
#weakTraits, #strongTraits {
	display: flex;
	gap: 0.5rem;
	justify-content: space-between;
	margin-bottom: 0.75rem;
	padding-bottom: 0.5rem;
	overflow-x: clip;
	border-bottom: 1px solid #1d316c;
}
#weakTraits span, #strongTraits span {
	text-align: center;
	display: flex;
	flex-flow: row wrap;
	flex-direction: column;
	justify-content: center;
	line-height: 0.875rem;
	font-size: 0.75rem;
}

.advanced-stats-container .card-list {
	display: grid;
    grid-gap: 0.25rem;
    grid-template-columns: repeat(4, auto);
}
.advanced-stats-container .card-list a {
	grid-row: auto;
	min-width: 36px;
	border: var(--ui-border);
}
.advanced-stats-container .card-img {
    width: auto;
    height: 56px;
    object-fit: contain;
}
@media (min-width: 420px) {
	.advanced-stats-container .card-list {
		grid-template-columns: repeat(8, auto);
	}
}

.card-list a.super-hard-counter {
	border-bottom-color: #F877C2;
}
.card-list a.hard-counter {
	border-bottom-color: #ff7673;
}
.card-list a.soft-counter {
	border-bottom-color: #ffa56b;
}
.card-list a.neutral {
	border-bottom-color: #ffdf77;
}
#strongAgainst .card-list a.super-hard-counter {
	border-bottom-color: #76efc0;
}
#strongAgainst .card-list a.hard-counter {
	border-bottom-color: #79e57a;
}
#strongAgainst .card-list a.soft-counter {
	border-bottom-color: #bde772;
}

#buttonsContainer {
    display: flex;
    gap: 0.75rem;
    flex-flow: wrap;
    margin: 1rem 0 1.5rem;
}
#copyDeckLink {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: fit-content;
}
#saveDeckToBuilder:disabled, #copyDeckLink[aria-disabled="true"] {
    opacity: 0.3;
    pointer-events: none;
}

/* BREAKPOINTS */
@media (min-width: 768px) {
    #deck-stats {
		grid-template-columns: repeat(4, 1fr);
	}

	#deckAdvancedStats {
		display: grid;
		gap: 0.75rem;
		grid-template-columns: 1fr 1fr;
	}
}