@font-face {
    font-family: "Pokemon";
    src: url("/fonts/pokemon_x_y.ttf");
}
.pokefont {
    font-family: Pokemon;
}

/*
 * Variables
 */

 :root {
    /* light colors */
    --col-bg: #fbfbff;
    --col-header: #61b6e7;

    --col-outline: Grey;
    --col-text: #103;
    --col-text-midkey: #505050;
    --col-text-lowkey: Grey;

    --col-contrast: Gold;
    --col-red: #972a2a;

    --col-sitename: #f0eeff;
    --col-sitename-contrast: #272790;

    --col-widget: #4296f4;
    --col-widget-back: #f5f5ff;
    --col-widget-back-hover: #fff;

    --col-drawer-bg: rgba(250,250,250,0.85);

    --col-row-bg: #fff;
    --col-alt-bg: #e2e2e2;
    
    --col-shadow: #cc00cc;
    --col-shadow-bg: #800080;
    
    --border-radius: 2px;
    --site-width: 900px;
    --site-margin: 10px;
    --header-height: 3rem;
    --ranking-row-height: 30px;
}

.switch {
    --color-handle: #dfdfdf;
    --color-grey: #aaa;
    --color-blue: var(--col-widget);
}

label.togglebutton {
    --col-toggle-bg: var(--col-widget-back);
}

.tooltip {
    --col-tooltip: var(--col-text);
}

/*
 * General Element Styles
 */
html {
    scroll-behavior: smooth;
}

body {
    font-family: Verdana,sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--col-text);
    background-color: var(--col-bg);
    margin: 0;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5;
    width: 100%;
    height: var(--header-height);
    border-bottom: 1px solid var(--col-outline);
    background-color: var(--col-header);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.7);
}

nav {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;

    height: 100%;
}

a {
    color: var(--col-text);
    text-decoration: none;
    cursor: pointer;
}


img {
    display: block;
    margin: 0 auto;
}

table {
    border-collapse: collapse;
}

th, td {
    text-align: center;
    padding: 0.25em 0;
}

button {
    cursor: pointer;
    font-family: inherit;
    color: var(--col-text);
    background-color: var(--col-widget-back);
    border: 1px solid var(--col-outline);
    border-radius: var(--border-radius);
    font-size: 90%;
    padding: 4px;
    box-shadow: 2px 2px 3px 0px rgba(0,0,0,0.5);
}

button:hover {
    background-color: var(--col-widget-back-hover);
    box-shadow: 1px 1px 3px 0px rgba(0,0,0,0.5);
}

button:focus {
    outline: 1px solid var(--col-outline);
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background-color: var(--col-widget-back);
    border: 1px solid var(--col-outline);
    border-radius: var(--border-radius);
}
input:hover, input:focus,
textarea:hover, textarea:focus {
    background-color: var(--col-widget-back-hover);
}

textarea {
    width: 100%;
    box-sizing: border-box;
    resize: none;
}

input[type="number"] {
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}
input[type="button"], button {
    cursor: pointer;
}
input.invalid {
    border: 1px solid var(--col-red) !important;
}

sup { vertical-align: top; }

/* 
 * Broad Site Layout 
 */
.site-size {
    margin: 0 auto;
    width: var(--site-width);
}

#site {
    padding: 5rem 10px 0 10px;
    box-sizing: border-box;
}
#footer {
    margin: 5rem 0 1rem 0;
    text-align: center;
    font-size: 0.6rem;
    color: var(--col-text-lowkey);
    display: none;
}
#footer-links {
    width: min-content;
    gap: 0.5em;
    margin: auto;
}
.page { display: none; }

.column-l, .column-r { flex: 1 0 0; }
*:has(> .column-l, > .column-r) { gap: 1em; }

ul.footnotes {
    text-align: left;
    font-size: 80%;
    font-style: italic;
    padding: 10px 20px;
    margin: 0;
    list-style: none;
}

/* 
 * Site Header
 */
#site-name {
    color: var(--col-sitename);
    margin: 0;
}
#site-name .contrast {
    color: var(--col-sitename-contrast);
}

#header-content {
    display: flex;
    flex-flow: row nowrap;
    align-items: stretch;
    justify-content: space-between;

    height: 100%;
}

#header-content > * {
    flex: 0 1 0;
}

.header-area {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;

    height: 100%;
}

#nav-drawer {
    padding: 0;
    min-width: 200px;
}

ul.menu {
    white-space: nowrap;

    list-style-type: none;
    margin: 0;
    padding: 0;
}

ul.menu > li {
    cursor: pointer;
    padding: 0 1em;
}
ul.menu > li > a {
    display: block;
    width: 100%;
    padding: 0.5em 0.5em 0.5rem 1.5rem;
    box-sizing: border-box;
    border-bottom: 1px solid var(--col-outline);
}
ul.menu > li:last-child > a {
    border-bottom: none;
}
ul.menu > li:hover {
    background-color: rgba(123, 123, 123, 0.1);
}

#logo {
    height: 2.5rem;
    margin: 0 0.5rem;
}

/*
 * Drawer Layout
 */
.drawer {
    display: block;
    position: relative;
    cursor: pointer;
    
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.drawer-icon {
    height: 1.5em;
    margin: 0 0.5em;
}

.drawer.absolute-right .drawer-icon {
    padding-right: 0.5em;
}

.drawer-popup {
    display: none;

    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;

    background-color: var(--col-drawer-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--col-outline);
    border-radius: var(--border-radius);
    box-shadow: 2px 2px 3px 0px rgba(0,0,0,0.5);
    
    padding: 0.25em 0.5em;
    margin: 0;
    white-space: nowrap;
}

@media (hover : hover) and (not (pointer : coarse))  {
    .drawer:hover .drawer-popup, .drawer:focus .drawer-popup {
        display: revert;
    }
    .drawer:hover .drawer-icon, .drawer:focus .drawer-icon {
        filter: brightness(0) saturate(100%) invert(37%) sepia(76%) saturate(3643%) hue-rotate(200deg) brightness(96%) contrast(90%);
    }
}
.drawer-icon-focused {
    filter: brightness(0) saturate(100%) invert(37%) sepia(76%) saturate(3643%) hue-rotate(200deg) brightness(96%) contrast(90%);
}

.card .drawer-popup {
    position: absolute;
    right: 0;
    left: auto;
    border-left: none;
    border-right: none;
    width: calc(var(--site-width) - 2 * var(--site-margin) - 2px);
    transform: none;
    
    box-sizing: border-box;
    box-shadow: none;
}

@media screen and (max-width:1100px) { 
    header .drawer-popup {
        position: fixed;
        top: var(--header-height);
        left: auto;
        right: 0;
        transform: none;
    }
}

/* 
 * Card Layout
 */
.card {
    box-shadow: 0 0 1px 0px var(--col-outline) inset, 0 0 1px 0px var(--col-outline),
        0 0.5rem 1rem rgba(0,0,0,0.7);
    border: 1px solid var(--col-outline);
    box-sizing: border-box;
    margin: 2rem 0;
}

.card-header {
    position: relative;
    background-color: var(--col-header);
    border-bottom: 1px solid var(--col-outline);
}

.card:has(.table-header) .card-header {
    border-bottom: none;
}

.card-title {
    font-weight: bold;
    font-size: 1.25rem;
    text-align: center;
    padding: 0.5rem 1rem;
}

.card-footer {
    background-color: var(--col-header);
    border-top: 1px solid var(--col-outline);
}

/**
 * Form card (with buttons in footer)
 */
.card-footer.buttons {
    display: flex;
    justify-content: center;
    gap: 1em;
}
.card-footer.buttons input[type="number"] {
    width: 50%;
    min-width: 4ch;
    border: 1px solid var(--col-outline);
    padding: 0px 2px 0px 4px;
    box-sizing: border-box;
}

.card-footer.buttons input[type="submit"], .card-footer.buttons input[type="button"] {
    cursor: pointer;
    font-family: inherit;
    font-size: 1.1em;
    font-weight: bold;
    width: 7em;
    margin: 0.5em 0;
    background-color: var(--col-widget-back);
    border: 1px solid var(--col-outline);
    border-radius: var(--border-radius);
    box-shadow: 2px 2px 3px 0px rgba(0,0,0,0.5);
}
.card-footer.buttons input[type="submit"] {
    background-color: var(--col-widget);
}
.card-footer.buttons input[type="button"] {
    color: var(--col-text-midkey);
}
.card-footer.buttons input[type="button"]:hover {
    background-color: var(--col-widget-back-hover);
    color: var(--col-text)
}
.card-footer.buttons input[type="submit"]:hover {
    box-shadow: 2px 2px 3px 0px rgba(0,0,0,0.5),
        inset 0 0 1em 5px rgba(255, 255, 255, 0.25);
}

/* 
 * Summary Cards
 */
details.card summary  { list-style: none; }
details.card summary::-webkit-details-marker { display: none; }

details.card summary.card-header {
    cursor: pointer;
    border-bottom: none;
}
details.card[open] summary.card-header {
    border-bottom: 1px solid var(--col-outline);
}

summary.card-header .card-title {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
}
summary.card-header .card-title::after { content: "+"; }
details.card[open] summary.card-header .card-title::after { content: "—"; }

summary > *:is(h1, h2, h3, h4, h5) {
    display: inline-block;
}
summary { cursor: pointer; }

/* 
 * Dialog Cards
 */
dialog.card {
    position: fixed;
    inset: 4rem auto auto 50%;
    transform: translateX(-50%);
    z-index: 100;

    max-width: calc(var(--site-width) - 2 * var(--site-margin));
    min-width: calc(var(--site-width)/2);
    max-height: 80%;
    padding: 0;
    margin: 0;

    color: var(--col-text);
    background-color: var(--col-alt-bg);
}    

dialog.card .card-body {
    padding: 1em;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(80vh - 8rem);
}

/*
 * Dialog Elements
 */
ul.move-select {
    width: 100%;
    height: 10em;
    overflow-y: auto;
    border: 1px solid var(--col-outline);
    background-color: var(--col-widget-back);

    margin: 0;
    padding: 0.5em;
    list-style-type: none;
    box-sizing: border-box;
}
li.move-select-move {
    margin: 0.1em 0;
    position: relative;
}
:is(ul,textarea,div)::-webkit-scrollbar { 
    width: 0.5em; 
}
:is(ul,textarea,div)::-webkit-scrollbar-track { 
    border: none; 
    background-color: var(--col-widget-back-hover); 
}
:is(ul,textarea,div)::-webkit-scrollbar-thumb { 
    background-color: var(--col-widget); 
    cursor: pointer;
}

.delete-icon {
    color: var(--col-red);
    cursor: pointer;
}

#overlay.active {
    opacity: 1;
    visibility: visible;
}
#overlay {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgb(0 0 0 / .5);
    z-index: 99;
    transition: all 0.3s;
}

dialog.card h3, dialog.card h4 {
    margin: 0 0 0.5em 0;
}

.tier-selector {
    display: flex;
    flex-flow: row nowrap;

    border: 1px solid var(--col-outline)
}
.tier-selector > * { 
    flex: 1 1 0;
    box-sizing: border-box;
    padding: 0 0.25em; 

    text-align: center;
    filter: opacity(0.6);

    cursor: pointer;
}
.tier-selector *:has(input[type="radio"]:checked) { 
    filter: opacity(1.0); 
    font-weight: bold;
}
.tier-selector input[type="radio"] {
    display: none;
}

#search-string-popup {
    min-width: calc(var(--site-width) * 0.75);
}

#search-string-result {
    flex: 1 0 0;
    font-size: 12px;
    color: var(--col-text-midkey);
    min-height: 5em;
}

#search-string-issues {
    display: none;
    color: var(--col-red);
    padding-top: 1em;
}
#search-string-issues p {
    margin: 0;
}
#search-string-issues .issue-highlight {
    color: var(--col-red);
    font-weight: bold;
}

.pkm-list {
    display: grid;
    grid-template-columns: min-content min-content;
    grid-auto-rows: min-content;
    column-gap: 1em;
    align-items: baseline;

    width: 100%;
    height: calc(92px + 1em); /* 3*30px rows + 2px border + 1em pad */
    overflow-y: auto;
    border: 1px solid var(--col-outline);
    background-color: var(--col-widget-back);

    margin: 0;
    padding: 0.5em;
    list-style-type: none;
    box-sizing: border-box;

    color: var(--col-text);
}
.pkm-list .strongest-name {
    font-weight: bold;
}

.pkm-list .type-text {
    font-size: 0.9em;
}

#move-edit-type {
    height: 100%;
    width: 9em;
    box-sizing: border-box;
    border: 0;
    border-radius: 5px;
    font-size: 1em;
    text-align: center;
    box-shadow: none;
    cursor: pointer;
}
label[for="move-edit-kind"] {
    width: 5em;
    box-sizing: border-box;
}

.move-form {
    display: grid;
    grid-template-columns: 1fr 2fr;
    column-gap: 1em;
    row-gap: 0.5em;
    height: max-content;
    line-height: 1.6em;
}
.move-form > *:nth-child(odd) {
    justify-self: end;
    text-align: right;
}
.move-form input {
    line-height: 1.6em;
    width: 15em;
    box-sizing: border-box;
    padding-top: 1px;
    padding-bottom: 1px;
}
.move-form div.num-input-group {
    width: 15em;
}
div.num-input-group {
    display: flex;
    flex-flow: row nowrap;
}
div.num-input-group > input[type=number] {
    flex: 1 0 0;
    border-radius: 0;
    width: auto;
    text-align: center;
}
input.minus, input.plus {
    width: 2em;
    font-weight: bold;
    border-radius: 0;
    background-color: var(--col-widget);
}
input.minus:hover, input.plus:hover {
    box-shadow: 2px 2px 3px 0px rgba(0, 0, 0, 0.5), 
        inset 0 0 1em 5px rgba(255, 255, 255, 0.25);
}
input.minus {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    border-right: none;
}
input.plus {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    border-left: none;
}
.move-form .bar-bg {
    display: flex;
    flex-flow: row nowrap;
    gap: 5px;
    width: 15em;
    margin: 0;
    border: 0px;
    background-color: transparent;

    cursor: pointer;
}
.move-form .bar-fg {
    flex: 1 0 0;
    border-radius: 5px;
    height: 1.6em;
    padding: 2px 0;
}

/* 
 * FAQ/About
 */
.card.article {
    margin: 0.5rem 0;
}
.card.article .card-title {
    text-align: left;
}
.card.article .card-body {
    padding: 1em 3em 0em 2em;
}
.card.article h3,.card.article h4 {
    margin: 0;
    padding-bottom: 0.25em;
}
.card.article p, .card.article ul {
    margin: 0;
    padding: 0em 0em 1em 1em;
    color: var(--col-text-midkey);
}
.card.article .sidenote {
    font-size: 90%;
    font-style: italic;
    color: var(--col-text-lowkey);
}
.card.article .card-body {
    background-color: var(--col-alt-bg);
}
.card.article a {
    color: var(--col-sitename-contrast);
    text-decoration: underline;
}

/* 
 * (Strongest) Table Formatting
 */
#strongest-scroller {
    max-height: 750px;
    overflow-y: scroll;
}
#tier-label-container {
    position: relative;
    z-index: 1;
}

.table-bg tr.odd { background-color: var(--col-row-bg); }
.table-bg tr.even { background-color: var(--col-alt-bg); }

#strongest-table {
    width: 100%;
    /*table-layout: fixed;*/
} 
#strongest-table tr { height: var(--ranking-row-height); }
#strongest-table td { 
    padding-top: 0;
    padding-bottom: 0;
}

#strongest-table tr > *:nth-child(1) { width: 5%; }
#strongest-table tr > *:nth-child(2) { width: 5%; 
    text-align: left; 
    padding-left: 1%;
}
#strongest-table tr > *:nth-child(3) { width: 35%; }
#strongest-table tr > *:nth-child(4) { width: 15%; }
#strongest-table tr > *:nth-child(5) { width: 15%; }
#strongest-table tr > *:nth-child(6) { width: 15%; }
#strongest-table tr > *:nth-child(7) { width: 10%; }

#strongest-table tr > *:nth-child(7):last-child { width: 25%; }

#strongest-table td.td-poke-name { 
    font-weight: bold; 
    text-align: left;
    /*padding-left: 5%;*/
    vertical-align: middle;
}
#strongest-table tr.suboptimal td.td-poke-name { 
    font-weight: normal; 
    font-style: italic;
}
#strongest-table tr.suboptimal .pokemon-icon { 
    visibility: hidden;
}

#strongest-table tr.suboptimal.grouped > *:nth-child(-n + 3) { 
    color: transparent;
    user-select: none; 
}

#strongest-table tr.suboptimal.grouped {
    font-size: 90%;
}
#strongest-table tr.suboptimal.grouped td.td-poke-name * { 
    visibility: hidden;
}

#strongest-table span.type-text, 
#pokedex-move-table span.type-text,
#move-data-table span.type-text {
    cursor: pointer;
}

.a-poke-name {
    display: block;
    width: fit-content;
}

.pokemon-icon {
    width: 40px;
    height: 30px;
    display: inline-block;
    vertical-align: middle;
}

span.strongest-name {
    text-decoration: underline;
}

.poke-form-name, .poke-number {
    text-decoration: none;
    font-weight: normal;
    font-size: 80%;
    color: var(--col-text-lowkey);
}

sup.xl { 
    font-size: 60%;
    color: var(--col-text-lowkey);
}

/*
#strongest-table tr.suboptimal td { background-color:rgba(255,0,0,0.05); }
*/

/* 
 * Pokedex Images
 */
.pokemon-containers {
    display: inline-flex;
    width: 240px;
    justify-content: center;
    align-items: center;
}

.img-container {
    display: flex;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
    border: 1px hidden var(--col-outline);
}

.container-selected { 
    border: 1px solid var(--col-outline);
}

.pokemon-img {
    cursor: pointer;
    display: none;
}

.shiny-img-div {
    position: relative;
    left: 100px;
    width: 0px;
    height: 0px;
}

.shiny-img-div img {
    display: none;
    position: absolute;
    width: 20px;
    z-index: -1;
}

.pokemon-form {
    position: relative;
    width: 0px;
    height: 0px;
    left: 5px;
    bottom: 10px;
}

.pokemon-form p {
    position: absolute;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: -1;
}

.pokemon-name {
    display: inline-block;
    width: max-content;
    margin: 0;
    padding: 2px;
    background-color: var(--col-widget-back);
    border: 1px solid var(--col-outline);
    border-radius: var(--border-radius);
    box-shadow: 2px 2px 3px 0px rgba(0,0,0,0.5);
    font-size: 16px;
    transform: translateY(-2px);
    cursor: pointer;
    position: relative;
}

.pokemon-types {
    display: flex;
    margin: 0.5em auto;
    height: 14px;
    justify-content: center;
    align-items: center;
    transform: translateY(-2px);
}

.pokemon-types img {
    margin: 0 2px;
    cursor: pointer;
}

#containers-father {
    display: flex;
    height: 170px;
    justify-content: center;
    align-items: center;
}
#previous-containers { 
    justify-content: right; 
    opacity: 0.6;
}
#next-containers { 
    justify-content: left; 
    opacity: 0.6;
}

#additional-containers {
    margin: 0 auto;
    display: flex;
    justify-content: safe center;
    align-items: stretch;
    overflow-x: auto;
    position: relative;
}

.scroll-portal {
    position: sticky;
    flex-basis: 0%;
    z-index: 2;
    flex-shrink: 0;
    margin: 0;
}
.scroll-portal-left {
    background: linear-gradient(to right, var(--col-bg) 0%, rgba(70, 130, 180, 0.5) 50%, transparent 100%);
    left: 0;
}
.scroll-portal-right {
    background: linear-gradient(to right, transparent 0%, rgba(70, 130, 180, 0.5) 50%, var(--col-bg) 100%);
    right: 0;
}
#additional-containers > div:not(.scroll-portal) {
    margin: 30px 15px 0px 15px;
    scroll-margin: 0;
}

#not-released { display: none; }

/* 
 * PokeDex Stats
 */
#stats-calculator .card-body {
    background-color: var(--col-alt-bg);
}

#stats-calculator .bar-bg {
    margin: 0;
}
#stats-calculator .bar-txt {
    font-size: 1em;
}

#stats-calculator .row-header {
    text-align: right;
}
#stats-calculator .col-header {
    font-weight: bold;
    margin-top: 1em;
}
#stats-calculator .full-row {
    text-align: center;
}


/*
 * PokeDex Layouts
 */
#attack-tiers .tier-label {
    font-size: 1.5em;
    padding: 0 0.25em 0 0.25em;
}

#attack-tier-results .tier-label {
    writing-mode: lr;
    transform: none;
}

#attack-tiers .type-text, #effectiveness .type-text {
    text-align: center;
    vertical-align: middle;
}

.dex-layout-table, .col5-layout {
    width: 100%; 
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    justify-content: center;
}

.dex-layout-tablecell {
    display: flex;
    flex-flow: column nowrap;
}

.dex-layout-table > .dex-layout-tablecell {
    background-color: var(--col-row-bg);
}
.dex-layout-table > .dex-layout-tablecell:nth-child(odd) {
    background-color: var(--col-alt-bg);
}

.dex-layout-header {
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em 0;
}

.dex-layout-content {
    display: flex;
    flex-flow: row wrap;
    gap: 4px;
    justify-content: center;
    padding: 1em;
}

.dex-layout-content > * {
    flex: 0 0 40%;
}

.dex-layout-header img {
    display: inline-block;
    width: 25px;
    margin: 0 -2px;
    vertical-align: top;
}

.secondary-header {
    background-color: var(--col-header);
    /*border-top: 1px solid var(--col-outline);
    border-bottom: 1px solid var(--col-outline);*/
}

.col5-layout > * {
    margin: 5px;
}
.col5-layout .full-row {
    grid-column: span 5;
}
.col5-layout .mid3 {
    grid-column: 2 / 5;
}

/*
 * PokeDex Counters
 */
#counters .card-body {
    background-color: var(--col-alt-bg);
    padding: 1em 0;
}

#counters-table {
    margin: auto;
    width: 90%;
    /*table-layout: fixed;*/
    white-space: nowrap;
}

#counters-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-row-gap: 1em;

    max-width: 100%;
}

#counters-grid > div {
    position: relative;
    min-width: 0;
}

#counters-grid img {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

#counters .align-base {
    height: 100%;
    min-height: 130px;
    display: flex;
    flex-flow: column nowrap;
    justify-content: space-between;
    align-items: stretch;
}

#counters .align-base > * {
    flex: 0;
}

#counters .align-base > .fill-space {
    flex-basis: 100%;
    flex-grow: 1;
}

.counter-ratings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1;
    font-size: 90%;
}

.counter-ratings table {
    width: min-content;
    margin: auto;
    border-collapse: separate; 
    border-spacing: 0 2px;
}

.counter-ratings tr.counters-rat-row {
    /*background-color: var(--col-widget-back);*/
    text-shadow: 0px 0px 5px white;
    cursor: help;
}

.counter-ratings tr.rat-selected td {
    border-top: 1px solid var(--col-outline);
    border-bottom: 1px solid var(--col-outline);
}

.counter-ratings tr.rat-selected td:first-child {
    border-left: 1px solid var(--col-outline);
}

.counter-ratings tr.rat-selected td:last-child {
    border-right: 1px solid var(--col-outline);
}

.counter-ratings td {
    text-align: right;
    padding: 0;
}

.counter-ratings td.rat-info {
    width: 0;
}

#counters-popup {
    display: none;
    position: absolute;
    width: 200px;
    height: min-content;
    padding: 0 0.25em;
    transform: translateX(-50%);
    border: 1px solid var(--col-outline);
    border-radius: var(--border-radius);
    background-color: var(--col-widget-back);
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#counters-popup p {
    margin-top: 3px;
    margin-bottom: 3px;
}

#counters-popup .counter-name {
    font-weight: bold;
}


/*
 * Move Data Table
 */
 .move-table {
    width: 100%;
    /*table-layout: fixed;*/
    border-spacing: 2px;
}

.move-table .sortable {
    cursor: pointer;
    text-decoration: underline;
    user-select: none;
}

.move-table td, .move-table th {
    white-space: nowrap;
    /*overflow: hidden;*/
    text-overflow: ellipsis;
}

.move-table th {
    padding-left: 2px;
    padding-right: 2px;
}

.table-header {
    background-color: var(--col-header);
    border-bottom: 1px solid var(--col-outline);
}

.th-triangle {
    text-decoration: none;
    display: inline-block;
}

#pokedex-move-table tr > *:nth-child(1) { width: 18%; }
#pokedex-move-table tr > *:nth-child(2) { width: 18%; }

#move-data-table {
    table-layout: fixed;
}

#move-data-table tr > td { /* Pad all */
    height: 37px;
    color: var(--col-text-midkey);
}
#move-data-table tr > *:nth-child(1) { /* Move Name */
    width: auto; 
}
#move-data-table tr > *:nth-child(n+2) { /* Move Data */
    width: 90px; 
    text-align: left;
}
#move-data-table tr > *:last-child { /* Users */
    width: 140px; 
    text-align: left;
}
#move-data-table td.selected {
    color: var(--col-text);
}

#move-data-table .bar-txt {
    visibility: hidden;
}
#move-data-table .bar-bg {
    background-color: transparent;
    border: 0px;
}

/*
 * Type Matrix/Chart
 */
.table-legend {
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    margin: 0.5em 0;
    gap: 15px;
}
.table-legend > * {
    display: flex;
    gap: 5px;
}

.table-with-leftheader {
    display: flex;
    flex-flow: row nowrap;
}

.table-leftheader {
    margin: 0;
    padding: 0 1em 0 0.25em;

    background-color: var(--col-header);
}

#type-matrix .card-header {
    padding: 0.25em 0 0.25em 0;
}
#type-matrix .card-header .table-title {
    padding-top: 0.5em;
}
#type-matrix .table-leftheader  {
    padding: 0 0.5em 0 0.5em;
}

#type-matrix img {
    height: 1lh;
}

#type-matrix-table tr > th {
    height: 7ch;
    line-height: 1.5em;
}

th.vertical a.type-text {
    padding: 0.5em 0.25em;
    display: block;
    text-align: left;
    font-weight: normal;
    text-shadow: -1px 1px 2px black;
    box-shadow: -1px -1px gray;
}

#type-matrix-table {
    background-color: var(--col-header);
}

#type-matrix-table tr > td:nth-child(1) { 
    height: 1.5em; 
    line-height: 1.5em;
    width: 7ch;
    background-color: var(--col-header);
}
#type-matrix-table tr > td:nth-child(1) a.type-text { 
    display: block;
    padding: 0.25em 0.5em;
    text-align: right;
}

#type-matrix .table-leftheader {
    padding-top: 10ch;
}

#type-matrix tbody > tr > *:nth-child(n+3) {
    border-left: 1px solid var(--col-outline);
}

.corner-writing {
    display: flex;
    flex-flow: row nowrap;
    height: 100%;
    align-items: flex-end;
    justify-content: space-between;
    font-weight: normal;
    font-size: 0.75em;
}

.corner-writing > *:nth-child(2) {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    align-self: center;
}

#type-matrix .corner-writing {
    display: none;
}

#type-matrix .card-footer {
    position: relative;
    z-index: 2;
}

/*
 * Type Affinities
 */
#affinity-table {
    table-layout: fixed;
}
#affinity-table td {
    text-align: left;
    padding: 3px 5px;
}
#affinity-table span.type-text {
    width: 100%;
    display: inline-block;
    text-align: center;
}
#type-affinity-link {
    color: var(--col-sitename-contrast);
    font-weight: bold;
}
#type-affinity-tooltip {
    max-width: none;
}

/*
 * Settings Window
 */
.settings-list {
    display: grid;
    grid-template-columns: 2fr 1fr;
    column-gap: 2em;
    row-gap: 0.5em;
    height: max-content;
}

.settings-opt {
    cursor: pointer;
    color: var(--col-text-midkey);
}

.settings-opt-sel {
    font-weight: bold;
    color: var(--col-text);
}

.settings-title {
    font-size: 1.25em;
    font-weight: bold;
    text-align: center;
}
.settings-subtitle {
    margin: 5px 0px 2px 0px;
    grid-column: span 2;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid var(--col-outline);
}
.settings-span {
    grid-column: span 2;
}

.settings-list > *:nth-child(even of :not(.settings-title, .settings-subtitle, .settings-span)):not(.setting-value) {
    justify-self: end;
    text-align: right;
}

.setting-value {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    gap: 1em;

    justify-self: stretch;
}

input.settings-num {
    font-weight: bold;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
    border: none;
    background: none;
    width: 4ch;
    padding: 0;
}

.opt-indent {
    padding-left: 1.25em;
}

#filter-settings {
    display: flex;
    flex-flow: row nowrap;
    gap: 2em;
    padding: 0.25em 1.5em;
}
#filter-settings > * {
    flex: 1 1 0;
}

#counters #settings-tiermethod-header, #counters #settings-tiermethod, 
#counters #settings-rowcount-header, #counters #strongest-count,
#counters #settings-group-header, #counters #settings-group {
    display: none;
}

/* 
 * Dev Note
 */
 #note {
    display: none;
    position: fixed;
    width: 250px;
    top: 10%;
    left: 50%;
    transform: translate(+500px, +75px);
    z-index: 6;
}
@media screen and (max-width: 1520px) {
    #note { display: none; }
}

#note-header {
    margin-bottom: 1em;
}
#note-header * {
    display: inline-block;
    vertical-align: top;
    text-decoration: underline;
    cursor: pointer;
    margin: 0;
}
#note-icon {
    width: 40px;
}
#note-title {
    width: 150px;
}
#note-body {
    border: 1px solid var(--col-outline);
    border-radius: var(--border-radius);
    background: var(--col-alt-bg);
    padding: 0.5em;
}
#note-body p {
    margin: 0;
}

/* 
 * Bar Visuals
 */
.prgr {
    display: inline-flex;
    justify-content: flex-end;
    font-size: 110%;
    height: 1.5em;
    width: 400px;
    background-image: linear-gradient(to right,
            rgb(104, 144, 240), rgb(120, 200, 80), rgb(248, 208, 57));
}

.prgr-val {
    height: 100%;
    width: 100%;
    background: var(--col-widget-back);
}

.prgr-small-label {
    font-size: 90%;
    color: var(--col-text-lowkey);
}

#loading-bar-c {
    position: fixed;
    width: 0;
    height: 0;
    top: 0;
    left: 0;
}

#loading-bar {
    position: fixed;
    background-image: linear-gradient(to right,
            rgb(104, 144, 240), rgb(120, 200, 80), rgb(248, 208, 57));
    width: 0%;
    height: 2px;
}

.bar-bg {
    background-color: var(--col-widget-back);
    margin: 4px;
    border: 1px solid var(--col-outline);
    box-sizing: content-box;
    text-align: left;
}

.bar-fg {
    color: white;
    background-color: var(--col-widget);
    text-align: left;
    box-sizing: content-box;
    display: inline-block;
}

.bar-txt {
    font-size: 0.8em;
    margin: 2px 2px 2px 4px;
    text-shadow: 1px 1px 2px black;
    white-space: nowrap;
}

/* 
 * Pokemon Types (and Move Types)
 */
.type-text {
    padding: 0 0.25em;
    color: rgb(248, 248, 248);
    border-radius: var(--border-radius);
    text-shadow: 1px 1px gray;
    box-shadow: 1px 1px gray;
    white-space: nowrap;
}
.bg-Normal { background-color: rgb(168, 168, 120); }
.bg-Fire { background-color: rgb(240, 128, 48); }
.bg-Water { background-color: rgb(104, 144, 240); }
.bg-Grass { background-color: rgb(120, 200, 80); }
.bg-Electric { background-color: rgb(248, 208, 57); }
.bg-Ice { background-color: rgb(152, 216, 216); }
.bg-Fighting { background-color: rgb(192, 48, 40); }
.bg-Poison { background-color: rgb(160, 64, 160); }
.bg-Ground { background-color: rgb(224, 192, 104); }
.bg-Flying { background-color: rgb(168, 144, 240); }
.bg-Psychic { background-color: rgb(238, 86, 135); }
.bg-Bug { background-color: rgb(168, 184, 46); }
.bg-Rock { background-color: rgb(184, 160, 56); }
.bg-Ghost { background-color: rgb(112, 88, 152); }
.bg-Dragon { background-color: rgb(115, 79, 248); }
.bg-Dark { background-color: rgb(112, 88, 72); }
.bg-Steel { background-color: rgb(184, 184, 208); }
.bg-Fairy { background-color: rgb(241, 162, 231); }
.bg-any-type {
    background-image: linear-gradient(to right,
        rgb(240, 128, 48), rgb(104, 144, 240), rgb(120, 200, 80));
}

.type-links {
    margin: 0 auto;
    width: 50%;
}

.type-links a {
    display: block;
    text-align: center;
}

.type-links ul {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.4em;
    justify-content: center;
    justify-items: stretch;

    margin: 0 auto;
    padding: 0;
    list-style-type: none;
}
#any-type-strongest-link, #each-type-strongest-link, #any-type-move-link {
    grid-column: span 2;
    margin-bottom: 0.8em;
    background-color: var(--col-widget);
}

/* 
 * Ranking Tiers
 */
.tier-label {
    text-shadow: 1px 1px 2px black;
    color: white;
}
.tier-label.floating-label {
    position: absolute;
    left: 0;
    width: 100%;
    height: var(--ranking-row-height);
    line-height: var(--ranking-row-height);
    text-align: center;
}

.tier-MRay {
    background-color: #64a882;
    color: #f9da5f;
}
.tier-SSSSS { background-color: #290847; }
.tier-SSSS { background-color: #3a125f; }
.tier-SSS { background-color: #15125f; }
.tier-SS { background-color: #2521ab; }
.tier-S { background-color: #5854de; }
.tier-A { background-color: #38ab21; }
.tier-B { background-color: #a2ab21; }
.tier-C { background-color: #ab8621; }
.tier-D { background-color: #ab5f21; }
.tier-F { background-color: #ab2121; }

/* 
 * Icons and Shadow Effects
 */
.shadow-text {
    color: var(--col-shadow);
}
#pokedex-move-table .shadow-text {
    font-size: 0.8em;
    text-shadow: 1px 1px black;
}
.shadow-bg {
    background-color: var(--col-shadow-bg);
}
.shadow-icon {
    width: 20px;
    position: absolute;
    left: 100%;
    top: 0;
}
.filter-shadow {
    filter: invert(75%) sepia(35%) saturate(2706%) hue-rotate(208deg) brightness(93%) contrast(102%);
}
.filter-noshadow {
    filter: invert(37%) sepia(9%) saturate(2773%) hue-rotate(231deg) brightness(100%) contrast(91%);
}

.shield-icon {
    filter: brightness(0.6);
}
.tripleshield-icon {
    filter: brightness(0) saturate(100%) invert(25%) sepia(100%) saturate(2737%) hue-rotate(271deg) brightness(84%) contrast(122%);
}
.sword-icon {
    filter: brightness(0) saturate(100%) invert(37%) sepia(76%) saturate(3643%) hue-rotate(200deg) brightness(96%) contrast(90%);
}

/* 
 * Helpers
 */
 .unselectable {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.invisible { display: none; }
.mobile { display: none; }

.no-top-m { margin-top: 0; }
.no-bottom-m { margin-bottom: 0; }

.small-text { font-size: 90%; }
.off { color: var(--col-text-lowkey); }
.contrast {
    color: var(--col-contrast);
}

.left { text-align: left; }
.right { text-align: right; }
.center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
.float-right { float: right; }
.float-left { float: left; }
.v-middle {
    height: 100%;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
}

.col {
    display: flex; 
    flex-flow: column nowrap;
}
.row { 
    display: flex; 
    flex-flow: row nowrap;
}

.selected { font-weight: bold; }
.vertical {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
}

.circle {
    border-radius: 50%;
    overflow: clip;
}

.inlaid-icon {
    position: absolute;
    left: 0.5em;
    height: 1em;
    top: 50%;
    transform: translateY(-50%);
}
.absolute-right {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    z-index: 2;
}

.flex-grow {
    flex: 1 0 0;
}