@font-face {
    src: url("./hun2.ttf");
    font-family: "HUN"
}

@font-face {
    font-family: 'C';
    font-weight: 500;
    src: url('./cr.ttf');
}

@font-face {
    font-family: "C";
    font-weight: 900;
    src: url("./ccb.ttf");
}

:root {
    --panel: #172316;
    --panel2: #1d2c1a;
    --border: #2e4129;
    --text: #DCEFD3;
    --dim: #698F5B;
    --accent: #A3D391;
    --good: #4be05a;
    --bad: #e5534b;
    --footer: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAAyAQMAAADcGHRpAAAABGdBTUEAALGPC/xhBQAAAAZQTFRFCg8JAAAA+6RC8gAAAAJ0Uk5T/wDltzBKAAAASElEQVR42u3KsQnAMAwF0QMP4JG0ukfSAIIfcIIhuFb3r7jqod2a+lcQOiVmrQym9I0hIoe0ACJ5LWHWzULF1WHMwqydOed2D1SqHYdHJQwuAAAAAElFTkSuQmCC);
    --header-overlay: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAADCAYAAACEeL/nAAAAAXNSR0IB2cksfwAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAC5JREFUeNpjIAaIKQr/B2E0YaL14pVE58Mwgo/A6PoQNKYavHxCloBocjA+BwMACx851s4oAmYAAAAASUVORK5CYII=);
}

body {
    background: bottom left/300px 50px repeat-x var(--footer), #0f160d;
    padding: 5em 11vw 7.5em;
    margin: 0;
    font-family: "C", sans-serif;
    min-height: calc(100vh - 12.5em)
}

body::after {
    content: "not affiliated with TETR.IO";
    display: block;
    text-align: center;
    color: #384C33;
    padding: 10px 0;
}

header {
    position: relative;
    margin: -5em -11vw 0;
    height: 102px;
    background: top left/cover no-repeat url("./header.png");
    overflow: hidden
}

header p {
    color: var(--text);
    margin: 5px;
    pointer-events: none;
}

header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    transform-origin: left bottom;
    scale: 10;
    bottom: 0;
    image-rendering: pixelated;
    background: var(--header-overlay);
    pointer-events: none
}

#header_sub {
    position: sticky;
    margin: 0 -11vw 2.5em;
    height: 48px;
    background-color: #162113;
    padding: 0 11vw;
    overflow: hidden;
    top: -6px;
    box-shadow: 0 2px 4px #0004;
    z-index: 10000
}

#header_sub > .sub_item {
    display: inline-block;
    font-family: "HUN", sans-serif;
    padding: 0 1.5em;
    line-height: 56px;
    height: 46px;
    color: #A3D391;
    font-weight: 900;
    font-size: 1.05em;
    border-bottom: 2px solid #0000;
    cursor: pointer;
    text-decoration: none;
    transition: 0.1s border-bottom, 0.1s color;
    margin-right: -2px
}

#header_sub > .sub_item:hover {
    border-bottom: 2px solid #698F5B;
    color: #A3D391
}

#header_sub > .sub_item.active {
    border-bottom: 2px solid #A3D391;
    color: #A3D391
}

#header_sub > .sub_item:active {
    border-bottom: 2px solid #FFF;
    color: #FFF;
    transition: 0.05s border-top, 0.05s color
}

#header_sub > #username_search {
    float: right;
    font-family: "C", sans-serif;
    border: none;
    outline: none;
    background: none;
    color: #A3D391;
    text-align: right;
    font-size: 1.1em;
    width: calc(100% - 20em);
    max-width: 20em;
    border-bottom: 2px solid #0000;
    padding: 0.9em 0 0.6em;
    transition: 0.1s border-bottom
}

#header_sub > #username_search:focus {
    border-bottom: 2px solid #A3D391
}

#header_sub > #username_search::placeholder {
    color: #A3D391;
    opacity: 0.25
}

.flag_crumb {
    display: inline-block;
    height: 0.6em;
    vertical-align: middle;
    margin-left: 0.15em;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    color: var(--accent)
}

.chips {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 24px;
}

.chip {
    font-family: "C", sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 5px 5px 5px;
    background: var(--panel);
    font-size: 28px;
    color: white;
}

.chip .lb-count {
    color: var(--accent);
    font-weight: 900;
}

.chip img {
    width: 40px;
    height: 40px;
}

.chip .loading {
    width: 40px;
    height: 40px;
    animation: chip-pulse-colors 1s infinite;
}

.chip .error {
    width: 40px;
    height: 40px;
    background: #ff0000;
}

@keyframes chip-pulse-colors {
    0%   { background: var(--good); }
    50%  { background: var(--bad); }
    100% { background: var(--good); }
}

.chip button {
    background: none;
    border: none;
    color: var(--dim);
    cursor: pointer;
    font-size: 30px;
    font-family: "C", sans-serif;
}

.chip button:hover {
    color: var(--bad);
}

.table-wrap {
    overflow-x: clip;
}

table {
    border: 1px solid var(--border);
    background: var(--panel);
    border-collapse: collapse;
    width: 100%;
    min-width: 980px;
    font-size: 13px;
}

tbody tr {
    border-bottom: 1px solid var(--border);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--panel2);
}

th, td {
    padding: 10px 12px;
    text-align: right;
    white-space: nowrap;
}

th:first-child, td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
}

th {
    color: var(--dim);
    font-weight: 900;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: sticky;
    top: 42px; background: var(--panel); z-index: 1;
}

th:hover {
    color: var(--text);
}

th .arrow {
    opacity: .6;
    margin-left: 3px;
}

td.best {
    color: var(--accent);
    font-weight: 900;
}

.rank {
    width: 40px;
    height: 40px;
}

.playercell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.playercell img {
    width: 32px;
    height: 32px;
}

.ach-cell {
    vertical-align: middle;
}

.ach-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ach-badge {
    position: relative;
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.ach-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    background-size: 800% 800%;
    opacity: .8;
    filter: invert(1);
    pointer-events: none;
}

.ach-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

.ach-controls input, .ach-controls select {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    font-family: "C", sans-serif;
}

.ach-controls .stat {
    color: var(--dim);
    font-size: 12.5px;
    margin-left: auto;
}

.ach-table th, .ach-table td {
    text-align: center;
    min-width: 78px;
}

.ach-table th:first-child, .ach-table td:first-child {
    text-align: left;
    min-width: 200px;
}

.ach-name-cell .name {
    font-family: "HUN", sans-serif;
    font-weight: 900;
    color: var(--text);
    font-size: 13px;
    cursor: help;
}

.ach-name-cell .count {
    font-size: 11px;
}

.col-hover {
    background: var(--panel2) !important;
}
