/* @see https://fontsource.org/fonts/montserrat/install */

/* montserrat-latin-700-normal */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/montserrat@latest/latin-700-normal.woff2) format('woff2'), url(https://cdn.jsdelivr.net/fontsource/fonts/montserrat@latest/latin-700-normal.woff) format('woff');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* montserrat-latin-900-normal */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-display: swap;
    font-weight: 900;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/montserrat@latest/latin-900-normal.woff2) format('woff2'), url(https://cdn.jsdelivr.net/fontsource/fonts/montserrat@latest/latin-900-normal.woff) format('woff');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
.draw-title,
.draw-subtitle {
    font-family: "Montserrat";
    font-weight: 900;
}

html,
body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
}

.draggable--is-dragging {
    overflow: hidden;
    touch-action: none;
    -webkit-user-drag: none;
    overscroll-behavior: none;
}


body,
h1,
h2 {
    margin: 0;
}

button,
td {
    padding: 0;
}

table {
    border-spacing: 0px;
}

button {
    font-family: "Montserrat";
    font-weight: 900;
    background: transparent;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.draggable-mirror,
.pot .team {
    touch-action: none;
    -webkit-user-drag: none;
    overscroll-behavior: none;
}

.draggable-mirror {
    z-index: 50;
}

/* Draw UI elements */
.draw {
    width: 100%;
    max-width: 345px;
    margin-inline: auto;
    position: relative;
}

.draw-title {
    transform: scaleY(0.75);
    color: #FFA500;
    text-align: center;
    font-size: 31px;
    letter-spacing: -0.028em;
    line-height: 28px;
    padding: 12px 0px 8px 0px;
}


.draw-description {
    padding-inline: 12px;
}

.draw-description h2 {
    font-weight: 900;
    font-size: 13px;
}

.draw-description li {
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 4px;
}

.draw-description ul {
    margin-top: 8px;
    padding-left: 20px;
}

.draw-subtitle {
    font-size: 12px;
    line-height: 11px;
    padding: 0px 12px;
}

.draw-content {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.draw-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    gap: 19px;
    padding: 0px 12px;
}

.draw-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}

.tablinks {
    text-transform: uppercase;
    cursor: pointer;
    font-size: 46px;
    color: #ddd;
    transition: color 0.3s;
    line-height: 40px;
}

.tablinks:hover,
.tablinks.active {
    color: black;
}

.draw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 35px;
    width: auto;
    background: #00CCCC;
    border-radius: 32px;
    cursor: pointer;
    color: #FFEDCC;
    font-size: 20px;
    line-height: 16px;
}

.draw-btn svg {
    fill: #FFEDCC;
    margin-top: 2px;
}

.draw-btn span {
    display: block;
}

.draw-pots-container {
    min-height: 107px;
    background: #FFEDCC;
}


.pot {
    padding: 6px 12px;
    display: none;
    grid-template-columns: repeat(auto-fit, 49px);
    column-gap: 5px;
    row-gap: 1px;
    min-height: 95px;
}

.team,
.host {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 2px;
    touch-action: none;
    -webkit-user-drag: none;
    overscroll-behavior: none;
    user-select: none;
    pointer-events: auto;
    height: min-content;
}

.team img,
.host img {
    border-radius: 5px;
    object-fit: cover;
    width: 100%;
    height: auto;
    pointer-events: none;

    /* TODO: Delete */
    aspect-ratio: 47 / 28;
}

.team-name {
    display: block;
    font-size: 15px;
    line-height: 16px;
    text-align: center;
}

.draw-groups {
    display: flex;
    flex-direction: column;
    height: 346px;
    overflow: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.draw-groups::-webkit-scrollbar {
    display: none;
}

.draw-groups,
.group,
.group tbody {
    gap: 3px;
}

.group {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.group tbody {
    grid-column: span 4 / span 4;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.group caption,
.group td {
    display: flex;
    justify-content: center;
    min-height: 46px;
}

.group td {
    position: relative;
    align-items: self-start;
    margin-top: 9px;
    max-width: 47px;
    margin-inline: auto;
}

.group caption {
    align-items: center;
    font-size: 38px;
    color: #FFEDCC;
}

.draw-groups .group:nth-child(3n + 1) caption,
.draw-groups .group:nth-child(3n + 1) tr {
    background: #FFA500
}

.draw-groups .group:nth-child(3n + 2) caption,
.draw-groups .group:nth-child(3n + 2) tr {
    background: #00CCCC
}

.draw-groups .group:nth-child(3n) caption,
.draw-groups .group:nth-child(3n) tr {
    background: #C0157A
}

.toast {
    background: #FFEDCC;
    bottom: 25%;
    left: 50%;
    min-width: 130px;
    position: absolute;
    transform: scale(0.6) translateX(-50%);
    transition:
        opacity 0.25s ease,
        transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 3;
    pointer-events: auto;
    border: 1px solid rgba(20, 20, 40, 0.06);
    box-shadow: 0 8px 20px rgba(20, 20, 40, 0.08);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    gap: 0.6rem;
    opacity: 0;
    font-family: "Montserrat";
}

.toast.show {
    transform: scale(1) translateX(-50%);
    opacity: 1;
}

.toast.hide {
    transform: scale(0.8) translateX(-50%);
    opacity: 0;
}

.toast .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.toast .msg {
    text-align: center;
    font-size: 12px;
    line-height: 15px;
    font-weight: 700;
}

.toast .close-btn {
    position: absolute;
    top: 0;
    transform: translate(30%, -30%);
    right: 0;
    background: #C0157A;
    color: #FFEDCC;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
    margin-left: 0.4rem;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100%;
}


.toast:hover {
    box-shadow: 0 14px 30px rgba(20, 20, 40, 0.12);
    transform: translateX(-50%) scale(1.01);
}

@media (min-width: 620px) {
    .draw {
        max-width: 620px;
    }

    .draw-title {
        font-size: 56px;
        line-height: 48px;
        padding: 20px 0px 16px 0px;
    }

    .draw-description {
        padding-bottom: 16px;
    }

    .draw-description h2 {
        font-size: 18px;
    }

    .draw-description li {
        font-size: 15px;
    }

    .draw-subtitle {
        font-size: 18px;
        line-height: 14px;
        padding: 0px 36px;
    }

    .draw-description {
        padding-inline: 10px;
    }

    .draw-content {
        gap: 9px;
    }

    .draw-controls {
        padding: 0px 36px;
    }

    .draw-tabs {
        gap: 12px;
    }

    .tablinks {
        font-size: 80px;
        line-height: 62px;
    }

    .draw-btn {
        height: 58px;
        font-size: 38px;
        gap: 11px;
        line-height: 28px;
    }

    .draw-btn svg {
        margin-top: 5px;
        width: 28px;
        height: 28px;
    }

    .draw-pots-container {
        min-height: 178px;
    }

    .pot {
        padding: 9px 23px;
        min-height: 160px;
        grid-template-columns: repeat(auto-fit, 88px);
        column-gap: 9px;
        row-gap: 6px;
    }

    .draw-groups {
        height: auto;
        overflow: visible;
    }

    .team,
    .host {
        gap: 6px;
    }

    .team img,
    .host img {
        border-radius: 10px;
    }

    .draw-groups,
    .group,
    .group tbody {
        gap: 5px;
    }

    .group caption,
    .group td {
        min-height: 82px;
    }

    .group caption {
        font-size: 68px;
    }

    .group td {
        margin-top: 17px;
        max-width: 84px;
    }

    .toast {
        min-width: 190px;
    }

    .toast .msg {
        font-size: 18px;
        line-height: 22px;
    }

    .toast .close-btn {
        font-size: 16px;
        padding: 0.7rem;
    }

    .draw-pots[data-style="mini"] {
        background: #FFEDCC;
        width: 100%;
        position: absolute;
        z-index: 4;
    }

    .draw-pots[data-style="normal"] {
        position: relative;
    }

    .draw-pots[data-style="mini"] .pot:not(:has(.team)) {
        padding: 0;
        min-height: auto;
    }

    .draw-pots[data-style="mini"] .pot {
        grid-template-columns: repeat(12, 1fr);
        min-height: 46px;
    }
}

@media (min-width: 940px) {
    .draw {
        max-width: 940px;
    }

    .draw-title {
        font-size: 86px;
        line-height: 68px;
        padding: 20px 0px 26px 0px;
    }

    .draw-subtitle {
        font-size: 28px;
        line-height: 21px;
        padding: 0px 73px;
    }

    .draw-description {
        padding-inline: 8px;
    }

    .draw-content {
        gap: 20px;
    }

    .draw-controls {
        padding: 0px 50px;
    }

    .draw-tabs {
        gap: 18px;
    }

    .tablinks {
        font-size: 125px;
        line-height: 97px;
    }

    .draw-btn {
        height: 87px;
        font-size: 56px;
        gap: 17px;
        line-height: 42px;
    }

    .draw-btn svg {
        margin-top: 7px;
        width: 43px;
        height: 43px;
    }

    .pot {
        min-height: 231px;
    }

    .draw-pots-container {
        min-height: 267px;
    }

    .pot {
        grid-template-columns: repeat(auto-fit, 125px);
        column-gap: 22px;
        row-gap: 22px;
        padding: 18px 40px;
    }

    .team,
    .host {
        gap: 8px;
    }

    .team-name {
        font-size: 18px;
        line-height: 22px;
    }

    .group caption,
    .group td {
        min-height: 125px;
    }

    .group caption {
        font-size: 90px;
    }

    .group td {
        margin-top: 25px;
        max-width: 127px;
    }

    .draw-pots[data-style="mini"] .pot {
        min-height: 61px;
    }
}