body{
    background: url(./images/background-body.png) top center/cover no-repeat fixed;
    margin: 0;
    color: #ffffff;
    font-family: "Inter", sans-serif;
}

header{
    background: #010103 url(./images/background-header.png) center/contain no-repeat;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1{
    margin: 0;
    font-family: "Kanit", sans-serif;
    line-height: 1;
    font-size: 46px;
    font-style: italic;
}

header h1 span{
    display: block;
    font-family: "Teko", sans-serif;
    font-weight: 700;
    font-size: 40px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #cfa548;
}

header .logo{
    height: 130px;
    padding-left: 130px;
    background: url(./images/icon-heading.png) 40px center/contain no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

header .logo p{
    font-size: 14px;
    line-height: 14px;
    margin: 0;
    text-align: center;
    position: relative;
}

header .logo p::before,
header .logo p::after{
    content: '';
    position: absolute;
    bottom: calc( 50% - 2px );
    height: 2px;
    background: #cfa548;
    display: block;
    width: 20px;
}

header .logo p::before{
    left: 0;
}
header .logo p::after{
    right: 0;
}

.twitch-button,
header .cta{
    padding-right: 40px;
}

.twitch-button,
header .cta a{
    display: block;
    text-align: center;
    text-transform: uppercase;
    padding: 15px 30px 15px 50px;
    border-radius: 10px;
    background: #6332cc url(./images/twitch.svg) 20px center/1.3em no-repeat;
    color: white;
    font-weight: bold;
    text-decoration: none;
    margin-bottom: .5em;
    border: 1px solid #8557e4;
}

.twitch-button,
header .cta a:hover{
    background-color: #4d26a7;
}

header .cta span{
    font-size: 11px;
    display: block;
    text-align: center;
}

.fake-form .twitch-button{
    max-width: 300px;
    font-size: 20px;
    margin: auto;
}

.go-back{
    color: yellow;
    text-decoration: none;
    display: block;
    text-align: center;
    margin: 20px;
}

h3,
h2{
    font-family: "Noto Kufi Arabic", sans-serif;
}


main{
    padding: 25px 15px;
    display: flex;
    gap: 10px;
    font-size: 13px;
}

main section,
main aside{
    border: 1px solid white;
    border-radius: 10px;
    padding: 15px 20px;
}

main section{
    flex: 1;
}

main aside{
    width: 250px;
}

main h2, main h3{
    margin: 0 0 .3em;
}

main h2{
    text-transform: uppercase;
}

#fixture.phase3{
    overflow: hidden;
}

#fixture.gallery ul,
#fixture.phase2 ul,
#fixture.phase1 ul{
    display: grid;
    list-style: none;
    margin: 20px 0 0 0;
    padding: 0;
    grid-template-columns: repeat( 4, 1fr );
    gap: 10px;
}

aside > div,
#fixture > div > ul > li,
#fixture > ul > li{
    padding: 10px;
    border: 1px solid #1f272b;
    border-radius: 10px;
    background: #06151588;
}
#fixture ul li h3{
    text-transform: uppercase;
}

#fixture ul li table{
    border-collapse: collapse;
}

#fixture ul li table td{
    padding: 5px 2px;
    border-bottom: 1px solid #182930;
}

#fixture ul li table tr:last-child td{
    border-bottom: none;
}


#fixture ul li table td.date{
    width: 35px;
}

#fixture ul li table td.goals{
    width: 2ch;
    text-align: center;
    color: #d9b344;
}

#fixture ul li table td.country{
    width: 50%
}

#fixture ul li table td.country ~ td.country{
    text-align: right;
}


#fixture.phase3{
    display: flex;
    gap: 45px;
}

#fixture.phase3 h2{
    text-align: center;
}

#fixture.phase3 ul{
    margin: 0;
    padding: 0;
    list-style: none;
}

#fixture.phase3 > div{
    flex: 1;
    display: flex;
    flex-direction: column;
}
#fixture.phase3 > div > ul{
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

#fixture.phase3 > div.final{
    width: 270px;
    flex: none;
    position: relative;
}

#fixture.phase3 > div.final .terceros{
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 300%);
    width: 200px;
}

#fixture.phase3 > div.final .terceros::after{
    display: none;
}

#fixture.phase3 li:not(.podio) ul.tie li{
    color: orange;
}

#fixture.phase3 li:not(.podio) ul.win1 li:first-of-type span,
#fixture.phase3 li:not(.podio) ul.win2 li:last-of-type span{
    color: lime;
}

#fixture.phase3 li:not(.podio) ul.win1 li:last-of-type span,
#fixture.phase3 li:not(.podio) ul.win2 li:first-of-type span{
    color: #E8959D;
}

#fixture.phase3 li:not(.podio) li.with-flag .country{
    position: relative;
    display: inline-block;
}

#fixture.phase3 li:not(.podio) li.with-flag .country::after{
    content: '';
    height: 1em;
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    background: lime;
    display: block;
    background: var(--flag) center/contain no-repeat;
}


#fixture.phase3 li:not(.podio) ul.win2 li.with-flag:first-of-type .country::after,
#fixture.phase3 li:not(.podio) ul.win1 li.with-flag:last-of-type .country::after{
    filter: grayscale(1) opacity(.5);
}

#fixture > div > ul{
    position: relative;
}

#fixture.phase2 ul li,
#fixture > div > ul > li{
    text-align: center;
}

#fixture.phase2 ul li ul,
#fixture > div > ul ul{
    display: flex;
    justify-content: center;
    gap: 10px;
}

#fixture.phase2 ul ul li,
#fixture > div > ul ul li{
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

#fixture.phase3 > div > ul > li{
    padding-top: 15px;
    padding-bottom: 15px;
}

#fixture.gallery ul ul li:first-child::after,
#fixture.phase2 ul ul li:first-child::after,
#fixture > div > ul ul li:first-child::after{
    content: '-';
    width: 10px;
    position: absolute;
    right: -10px;
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #d9b344;
}

#fixture.phase2 ul ul li:nth-child(2),
#fixture > div > ul ul li:nth-child(2){
    flex-direction: row-reverse;
}

#fixture.phase2 ul ul li .score,
#fixture > div > ul ul li .score{
    font-size: 1.25em;
    color: #d9b344;
    font-weight: bold;
}


#fixture > div{
    --offset: 0px;
}


#fixture > div ul li div{
    position: relative;
}

#fixture > div:not(.octavos) ul li div ul::after,
#fixture > div:not(.octavos) ul li div ul::before{
    content: '';
    position: absolute;
    display: block;
    width: 15px;
    height: 80%;
    border: 2px solid white;
    left: -40px;
    border-right: none;
}

#fixture > div:not(.octavos) ul li div::after{
    content: '➤';
    position: absolute;
    display: block;
    left: -30px;
    font-size: 15px;
    line-height: 15px;
    bottom: 50%;
    transform: translateY(50%);
}

#fixture > div:not(.octavos) ul li div ul::after{
    bottom: calc( 50% - 1px );
    border-top: none;
    border-radius: 0 0 0 5px;
}

#fixture > div:not(.octavos) ul li div ul::before{
    top: calc( 50% - 1px );
    border-bottom: none;
    border-radius: 5px 0 0 0;
}

#fixture > div ul li.podio{
    border-color: #e6ae26;
}

#fixture > div ul li.podio ul{
    gap: 40px;
}

#fixture > div ul li.podio ul li:first-child::after{
    content: 'vs';
    width: 40px;
    right: -40px;
    color: yellow;
    font-size: 25px;
}

#fixture > div ul li.podio li{
    display: flex;
    flex-direction: column;
}

#fixture > div ul li.podio li::before{
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    background: var(--flag) center bottom/contain no-repeat;
}

#fixture > div ul li.podio li .score{
    font-size: 25px;
}


aside > div:not(:last-child){
    margin-bottom: 30px;
}

aside h2{
    font-size: 18px;
    padding-bottom: 6px;
    border-bottom: 1px solid #171d1b;
}
aside p{
    font-size: 13px;
    text-transform: uppercase;
}

footer{
    margin: 20px 20px 0;
    padding: 20px;
    display: flex;
    align-items: top;
    gap: 20px;
    border-radius: 10px;
    background: url(./images/background-footer.png) center bottom/cover no-repeat;
    justify-content: space-between;
}

footer > *{
    width: 350px;
}

footer h2,
footer h3,
footer p{
    margin: 0;
}

footer .status{
    position: relative;
    padding-left: 70px;
}
footer .status::before{
    content: '';
    display: block;
    position: absolute;
    left: 0;
    width: 55px;
    height: 55px;
    background: url(./images/copa-1-gold.svg) center/35px no-repeat;
    border: 1px solid #fadf89;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

footer > .vote{
    max-width: 200px;
    font-size: 13px;
    text-align: center;
}

footer .vote a{
    padding: 10px 30px;
    font-size: 18px;
    color: black;
    text-decoration: none;
    display: block;
    font-weight: bold;
    border: 1px solid #f0c669;
    margin-bottom: 10px;
    background: #f4d47a ;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
footer .vote a::before{
    content: '';
    display: inline-block;
    width: 1.4em;
    height: 1.4em;
    background: url(./images/copa-1.svg) right center/contain no-repeat;
}

footer .join{
    text-wrap: balance;
}

.votes a{
    color: #ba9b42;
    display: block;
    padding: 3px;
    text-align: center;
    font-size: 13px;
    text-decoration: none;
    font-weight: bold;
}
.votes a::after{
    content: '>';
    display: inline-block;
    margin-left: 5px;
}

.votes ol{
    margin: 0;
    padding: 5px;
    list-style: none;
    counter-reset: item_num;
}

.votes ol li{
    padding: 4px 0 10px 35px;
    font-size: 13px;
    display: flex;
    margin-bottom: 5px;
    align-items: center;
    position: relative;
    counter-increment: item_num;
}

.votes ol li:not(:last-child){
    border-bottom: 1px solid #fccc5733;
}

.votes ol li::before{
    position: absolute;
    left: 0;
    top: calc( 50% - 1px );
    transform: translateY(-50%);
    display: inline-block;
    content: counter(item_num);
    font-size: 12px;
    line-height: 12px;
    width: 22px;
    height: 22px;
    color: #fccc57;
    border: 1px solid #fccc57;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.votes ol li span:first-child{
    padding: 5px 0 5px 40px;
    flex: 1;
    position: relative;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.votes ol li span:first-child::before{
    border-radius: 5px;
    background: var(--flag) left center/contain no-repeat;
    display: inline-block;
    width: 30px;
    height: calc(1em + 10px);
    content: '';
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    position: absolute;
}

.howto ul{
    margin: 0;
    padding: 5px;
    list-style: none;
}

.howto ul li{
    font-size: 11px;
    margin-bottom: 8px;
}

#login{
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#login section{
    flex: none;
    width: 60vw;
    text-align: center;
    padding: 4rem;
    background: #06151588;
}

#login section input[type=text]{
    display: block;
    padding: 5px 10px;
    border: 1px solid #AAA;
    width: 80%;
    margin: 20px auto;
    border-radius: 5px;
    font-size: 24px;
    outline: none;
}

#back_menu{
    background: #0D0303;
}
#back_menu,
#back_menu ul {
    margin: 0; 
    padding: 0;
    list-style: none;
}

#back_menu ul{
    display: flex;
    justify-content: center;
}

#back_menu ul a{
    display: block;
    padding: 10px 30px;
    background: #0D0303;
    color: white;
    text-decoration: none;
}


#back_menu ul a:hover{
    background: #230909;
}

#back_menu ul a.active{
    background: #361036;
}

.admin section{
    background: #06151588;
}

.admin table{
    width: 100%;
    border-collapse: collapse;
}

.admin table thead th,
.admin table tbody td{
    padding: 6px 10px;
}

.admin table thead th{
    background: #402155;
    text-transform: uppercase;
}

.admin table tbody tr td{
    background: #081C2C;
}
.admin table tbody tr:nth-child(odd) td{
    background: #010C17;
}

.admin table .actions{
    width: 1%;
    white-space: nowrap;
}
.admin table .actions a{
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    text-decoration: none;
    margin-left: 4px;
    color: white;
}

.admin table .actions a.edit{
    background: #1079c3;
}

.admin table .actions a.delete{
    background: #9e1c1c;
}

.admin .header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin .header .add{
    display: inline-block;
    text-decoration: none;
    background: #149c43;
    color: white;
    font-size: 16px;
    padding: 8px 20px;
    border-radius: 4px;
}

.admin .no-results{
    padding: 10px;
    text-align: center;
    font-size: 16px;
    background: #966161;
    border-radius: 5px;
}


#modal{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
}

#modal h2{
    margin: 0 0 10px;
}

#modal .buttons{
    margin-top: 10px;
}

.votaciones > div,
.votaciones > form{
    background: #1A1B26;
    padding: 30px;
    margin: 20px 100px;
    border-radius: 5px;
} 

.votaciones > div ul,
.votaciones > form ul{
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 5px;
    grid-template-columns: repeat( 4, 1fr );
}

.votaciones > div ul{
    gap: 5px 15px;
}

.votaciones > div ul li{
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 15px;
    border: 1px solid #12121C;
}

.votaciones > div ul li span:first-of-type{
    flex: 1;
}

.votaciones > div ul img{
    max-height: 1lh;
    aspect-ratio: 4/3;
    object-fit: contain;
}

.votaciones > form ul input{
    display: none;
}

.votaciones > form ul label{
    display: block;
    padding: 7px 15px;
    border: 1px solid #12121C;
    cursor: pointer;
}

.votaciones > form ul input:not(:checked) + label:hover{
    background: #3B3B5D;

}

.votaciones > form ul input:checked + label{
    background: fuchsia;
    color: white;
}

.votaciones .buttons{
    display: flex;
    justify-content: center;
    gap: 30px;
}

.votaciones .buttons button{
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    outline: none;
    cursor: pointer;
    color: white;
}


.votaciones .buttons button[type=submit]{
    background: rgb(36, 112, 36);
}

.votaciones .buttons button[type=button]{
    background: rgb(49, 49, 49);
}


.nowrap{
    white-space: nowrap;
}

@keyframes show_toast{
    0%, 100%{ top: -100px; }
    2%, 98%{ top: 20px; }
}

.toast{
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    background: rgb(77, 110, 172);
    text-align: center;
    color: white;
    padding: 10px 30px;
    border-radius: 6px;
    box-shadow: 0 0 4px rgba(0,0,0,.5);
    animation: show_toast 6s linear 1 forwards 1s;
}
.toast.toast-error{
    background: #D13636;
}

.toast.toast-success{
    background: rgb(62, 143, 62);
}


.gallery{
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat( 4, 1fr );
    gap: 20px;
}


.gallery li{
    background: white;
    padding: 10px;
    box-shadow: 0 0 5px rgba(0,0,0,.5);
    position: relative;
}

.gallery img{
    width: 100%
}

#fixture.gallery{
    display: flex;
    flex-direction: column;
}

#fixture.gallery ul{
    flex: 1;
    display: block;
    height: 100%;
    margin-top: 0;
    padding: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
}

#fixture.gallery ul li{
    height: 100%;
    width: 100%;
    background: white;
    padding: 20px;
    box-sizing: border-box;
    position: absolute;
    left: 100%;
    transition: .4s left;
}


#fixture.gallery ul li img{
    display :block;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#fixture.gallery ul li.pending{
    opacity: 0;
    left: 100%;
}

#fixture.gallery ul li.showing{
    opacity: 1;
    left: 0%;
}

#fixture.gallery ul li.gone{
    left: -100%;
    opacity: 1;
}


#fixture.gallery ul li.hidden{
    left: -100%;
    opacity: 0;
}

.header-filters{
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-filters input,
.header-filters select,
.header-filters button{
    font-family: inherit;
    border: none;
    font-size: 14px;
    box-sizing: border-box;
    padding: 5px 10px;
    border-radius: 3px;
}

.header-filters .form-group{
    padding-left: 10px;
    background: white;
    color: black;
    border-radius: 3px;
}

.header-filters .form-group input{
    border-left: 1px solid #bababa;
    margin-left: 10px;
}

.header-filters button:hover{
    border: 1px solid #216789;
    background-color: #216789;
}

.header-filters button{
    border: 1px solid #277498;
    background-color: #277498;
    cursor: pointer;
    color: white;
}

tr.incomplete td{
    color: #FFF0F2;
}

tr.incomplete td:first-of-type{
    font-weight: bold;
    background: #901C1C;
}

.admin table tbody tr.incomplete:nth-child(odd) td:first-of-type {
    background: #500305;
}