:root {
    --active: #b0e1ff;
    --border: #ddd;
    --background: #fff;
    --hover: #eee;
    --muted: #999;
    --link-color: #105ed2;
    --font-color: #000;
    --table-header-background: #f5f7f7;
    --table-header-font-color: rgba(0, 0, 0, 0.54);
    --table-border: #d9dcde;
    --player-avatar-background: #000022;
    --player-avatar-font: #fff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --active: #1f6a97;
        --border: #4c4c4c;
        --background: #000;
        --hover: #5c5c5c;
        --muted: #999;
        --link-color: #3a89ff;
        --font-color: #fff;
        --table-header-background: #292929;
        --table-header-font-color: rgba(255, 255, 255, 0.54);
        --table-border: #4b4b4b;
        --player-avatar-background: #010173;
        --player-avatar-font: #fff;
    }
}

* {
    box-sizing: content-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: normal;
  background-color: var(--background);
  color: var(--font-color);
}

a {
    color: var(--link-color);
    text-decoration: underline;
}

a:hover {
    color: var(--link-color);
}

.the-body {
    margin: 20px;
}

#root {
    margin: 0 auto;
    width: 1400px;
    padding: 0 10px;
}

#root.classic {
    margin-bottom: 30px;
}

@media (width <= 1400px) {
    #root {
        margin: 0;
        width: auto;
    }
}

h1 {
    font-size: 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.tabs .tab {
    border: 1px solid transparent;
    border-bottom: none;
    padding: 8px 10px;
    text-align: center;
    width: 150px;
    border-radius: 5px 5px 0 0;
    margin-right: 10px;
    cursor: pointer;
    margin-bottom: -1px;
}

.tabs .tab:hover {
    border-color: var(--border);
}

.tabs .tab.active {
    background-color: var(--background);
    border-color: var(--border);
}

.page {
    display: none;
    margin-bottom: 30px;
    overflow: auto;
    height: calc(100vh - 185px);
}

.page.active {
    display: block;
}

@media (width <= 550px) {
    .page {
        height: calc(100vh - 215px);
    }
}

.modal-backdrop {
    position: fixed;
    z-index: 99;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background-color: #00000099;
}

.modal {
    position: fixed;
    z-index: 99;
    top: 100px;
    left: 50%;
    margin-left: -300px;
    width: 600px;
    border: 1px solid var(--border);
    background-color: var(--background);
    padding: 15px;
}

@media (width <= 600px) {
    .modal {
        left: 0;
        right: 0;
        margin-left: 0;
        width: auto;
    }
}

.modal .users-list {
    position: absolute;
    border: 1px solid var(--border);
    background-color: var(--background);
}
.modal .users-list .user-entry {
    padding: 2px 5px;
    cursor: pointer;
    line-height: 30px;
}
.modal .users-list .user-entry:hover {
    background-color: var(--hover);
}
.modal .users-list .user-entry .player-avatar {
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 30px;
    display: inline-block;
    vertical-align: top;
    margin-right: 8px;
}
.modal .users-list .user-entry .player-avatar img {
    width: 30px;
    height: 30px;
    object-fit: cover;
}
.modal .tournaments-list {
    position: absolute;
    border: 1px solid var(--border);
    background-color: var(--background);
}
.modal .tournaments-list .tournament-entry {
    padding: 2px 5px;
    cursor: pointer;
    line-height: 30px;
}
.modal .tournaments-list .tournament-entry:hover {
    background-color: var(--hover);
}

/* ========================= */
/*            NAV            */
/* ========================= */

.nav {
    display: flex;
    margin-bottom: 10px;
}

.nav button {
    background-color: var(--background);
    border-radius: 5px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    font-size: 14px;
    cursor: pointer;
    color: var(--font-color);
}

.nav button[disabled] {
    color: var(--muted);
}

.nav button:first-child {
    margin-right: 15px;
}

.nav button:hover {
    background-color: var(--hover);
}

.nav button[disabled]:hover {
    background-color: var(--background);
}

/* ========================= */
/*            LIST           */
/* ========================= */

.list .entry {
    padding: 5px 10px;
    border: 1px solid var(--border);
    margin: 5px 0;
    cursor: pointer;
    display: block;
    color: var(--font-color);
    text-decoration: none;
}

.list .entry:hover {
    background-color: var(--border);
}

.league-entry {
    margin: 10px 0 20px 0;
}

.league-entry  .league-name {
    font-weight: bold;
}

.player-hash {
    font-size: 70%;
    color: var(--muted);
    font-weight: normal;
}

.player-avatar {
    width: 150px;
    height: 150px;
    border-radius: 150px;
    overflow: hidden;
    background-color: var(--player-avatar-background);
    text-align: center;
    color: var(--player-avatar-font);
    font-size: 60px;
    line-height: 140px;
}

.player-avatar img {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

.player-avatar.small {
    width: 40px;
    height: 40px;
    font-size: 20px;
    line-height: 40px;
}
.player-avatar.small img {
    width: 40px;
    height: 40px;
}

/* ========================= */
/*           TABLE           */
/* ========================= */

#table.page {
    overflow: visible;
    height: auto;
}

.table-container {
    display: none;
}

.table-container.active {
    display: block;
}

.table-container .nav {
    width: 550px;
    justify-content: space-between;
}

.table-container .nav button {
    margin: 0;
}

.table-container .nav .round-header {
    font-size: 20px;
    font-weight: bold;
}

@media (width <= 550px) {
    .table-container .nav {
        width: 100%;
    }
}

.table-cnt {
    overflow: auto;
    height: calc(100vh - 215px);
}

@media (width <= 550px) {
    .table-cnt {
        height: calc(100vh - 245px);
    }
}

.the-table {
    table-layout: fixed;
    border-collapse: separate;
    font-size: 18px;
    white-space: nowrap;
    border-spacing: 0;
}

.the-table th {
    padding: 0 8px;
    color: var(--table-header-font-color);
    background-color: var(--table-header-background);
    text-align: center;
    line-height: 32px;
    font-weight: 600;
    border: 1px solid var(--table-border);
}

.sticky-header-table th,
.result-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.result-table th:nth-child(1) {
    min-width: 19px;
}

.result-table th:nth-child(1),
.result-table th:nth-child(2) {
    left: 0;
    z-index: 2;
}

.result-table td:nth-child(1),
.result-table td:nth-child(2) {
    position: sticky;
    left: 0;
    z-index: 1;
}

.result-table th:nth-child(2),
.result-table td:nth-child(2) {
    left: 36px;
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.the-table td {
    background-color: var(--background);
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid var(--table-border);
}

.result-table td {
    cursor: pointer;
}

.result-table td:nth-child(1) {
    border-left: 1px solid var(--table-border);
}

.result-table td:nth-child(2),
.result-table td:nth-child(3),
.result-table td:nth-child(4) {
    border-right: 1px solid var(--table-border);
}

.result-table td:last-child {
    border-right: 1px solid var(--table-border);
}

.the-table tr.active td {
    background-color: var(--active);
}

.no-playtomic {
    padding-left: 5px;
    color: #ff0000;
    font-weight: bold;
}

/* ========================= */
/*          ROUNDS           */
/* ========================= */

.round {
    margin-bottom: 40px;
}

.passing {
    margin: 0 0 20px 0;
}

span.passing {
    cursor: pointer;
    border-radius: 8px;
}

.match {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.match .team {
    width: 200px;
}

.match .team-a {
    text-align: right;
}

.match .player {
    display: block;
    white-space: nowrap;
    max-width: 35vw;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 8px;
    cursor: pointer;
}

.match .player.active {
    background-color: var(--active);
}

.passing.active {
    background-color: var(--active);
}

/*.match .team-a .player:last-child {
    padding-left: 10px;
}

.match .team-b .player:first-child {
    padding-right: 10px;
}*/

.match .score-value {
    width: 20px;
    display: inline-block;
    text-align: center;
}

.match .score {
    margin: 0 20px;
    white-space: nowrap;
}

.team-a-win .team-a, .team-a-win .score-value-a {
    font-weight: bold;
}

.team-b-win .team-b, .team-b-win .score-value-b {
    font-weight: bold;
}

/* ========================= */
/*        PROPERTIES         */
/* ========================= */

.props div {
    margin: 5px 0;
}

.props b {
    margin-left: 5px;
}

#qr-code {
    margin: 10px 0 30px 0;
}

/* ========================= */
/*           PLAYER          */
/* ========================= */

.player-page {
    display: none;
}

.player-page.active {
    display: block;
}

.player-page .header {
    display: flex;
    line-height: 1;
    margin-bottom: 50px;
}

.player-page .placement {
    font-size: 100px;
    text-align: center;
    min-width: 170px;
}

.player-page .info {
    width: 100%;
    margin-left: 20px;
}

.player-page .player-name {
    font-size: 40px;
    margin: 10px 0 20px 0;
}

.player-page .wlp {
    display: flex;
}

.player-page .wlp-entry {
    display: flex;
    align-items: end;
    margin-right: 15px;
}

.player-page .wlp-entry .label {
    font-size: 12px;
    padding-bottom: 5px;
    margin-right: 5px;
}

.player-page .wlp-entry .value {
    font-size: 40px;
}

.player-page .stats {
    margin: 40px 0;
}

.player-page .stat-entry {
    display: flex;
    align-items: end;
    margin: 10px 0;
}

.player-page .stat-entry .label {
    margin-right: 5px;
    font-size: 12px;
    padding-bottom: 2px;
}

.player-page .stat-entry .value {
    font-weight: bold;
    font-size: 20px;
}

.player-page .round-pause {
    max-width: 495px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    line-height: 42px;
    margin: 10px 0;
}

.player-page h3 {
    margin-bottom: 2px;
}

.player-page .round-info {
    margin-bottom: 20px;
    color: var(--muted);
    font-style: italic;
}

.player-page .round-info .label {
    font-size: 80%;
}

.player-page .round-info .value {
    margin-right: 7px;
}

.player-page .img {
    width: 150px;
    height: 150px;
    border-radius: 150px;
    overflow: hidden;
    background-color: var(--player-avatar-background);
    text-align: center;
    color: var(--player-avatar-font);
    font-size: 60px;
    line-height: 140px;
}

.player-page .img img {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

@media (width <= 550px) {
    .player-page .nav {
        justify-content: space-between;
        margin-bottom: -30px;
    }
    .player-page .header {
        display: block;
    }
    .player-page .info {
        margin-left: 0;
        text-align: center;
    }
    .player-page .wlp {
        justify-content: center;
    }
}
.page-switchers-container {
    text-align: center;
    margin: 20px 0 20px 0;
}

.page-switchers-container .active {
    font-weight: bold;
}

/* =========================== */

.player2 {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--font-color);
    padding: 5px;
}
.player2:hover {
    background-color: var(--hover);
    color: var(--font-color);
}
.player2 .player-name {
    padding: 0 20px;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-info {
    text-align: center;
    color: #999;
    font-style: italic;
}

.info-popup {
    cursor: pointer;
    border-radius: 99px;
    display: inline-block;
    width: 20px;
    text-align: center;
    background-color: #999;
    color: #fff;
}

.flex {
    display: flex !important;
}

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

.points-table td, .points-table th {
    border: 1px solid var(--table-border);
    padding: 2px 5px;
    /* position: unset !important; */
}

.td-choosen {
    font-weight: bold;
}

.td-secondary {
    color: #999;
}

.td-place {
    font-size: 85%;
}