/* 
* Tools
*/

#tools {
    display: flex;
    flex-direction: row;
}
#tools > div {
    position: relative;

    height: 100%;
    width: 60px;
    flex-grow: 1;

    transition: flex-grow 100ms ease;
}

/*
* Numbers
*/

#tools > #numbers {
    display: flex;
    justify-content: center;
    align-items: center;

    height: calc(100% - 10px);
    margin: 5px 0;
    border-radius: 0 15px 15px 0;
    box-shadow: 0 0 5px var(--dark-blue);

    background-color: var(--dark-blue);
}
#numbers > div {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;

    height: 90%;
    max-height: 400px;
    aspect-ratio: 4 / 6;
}
#numbers > div > * {
    position: relative;
    display: block;

    width: 36px;
    height: 36px;
    margin: auto;
}
#numbers > div > div {
    border: 2px solid transparent;
    border-radius: 50%;

    line-height: 36px;
    text-align: center;
    font-size: 28px;
    text-decoration: line-through;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;


    transition-property: color, text-decoration-color, border-color;
    transition-duration: 100ms;
    transition-timing-function: ease;
}
#numbers > div > div.red {
    text-decoration-color: var(--white);

    color: var(--orange);
}
#numbers > div > div.green {
    border-color: var(--white);
    
    color: var(--green);
}

/*
* Rounds
*/

#rounds {
    display: flex;
    flex-direction: column;
    align-items: center;
    
    overflow-y: auto;
}
#rounds > :not(#rounds_btns) {
    min-height: 30px;
    flex-shrink: 0;

    line-height: 30px;
}
#rounds > *, #rounds_btns > * {
    min-width: 280px;
    width: 90%;
    max-width: 320px;
    border-radius: 10px;
    margin: 5px 0;
    padding: 5px 5px;

    background-color: var(--blue);
}
#rounds > *:first-child {
    margin-top: 20px;
}
#rounds > .round {
    min-height: 100px;
}
#rounds_btns {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content:space-evenly;

    height: 50px;

    background-color: transparent;

    line-height: 50px;
}
#rounds_btns > div.btn {
    min-width: unset;
    width: 140px;
    max-width: unset;
    margin: 20px 0;
    padding: unset;
}

.round {
    display: grid;
    align-items: center;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 2px;

    height: 100px;
}
.round > * {
    width: 38px;
    height: 38px;
    margin: 0 auto;

    line-height: 38px;
}
.round > select {
    display: block;

    padding: 0 14px;
    border: unset;
    border-radius: 2px;

    font-size: 16px;
    font-weight: bold;
    text-align: center;

    background-color: var(--grey);
    text-shadow: 0 0 1px var(--black);

    appearance: none;
    cursor: pointer;
}
.round > div:not([data-card]) {
    width: 28px;
    height: 28px;
    margin: 5px auto;
}
.round > select:nth-child(2) {
    color: var(--triangle);
}
.round > select:nth-child(4) {
    color: var(--square);
}
.round > select:nth-child(6) {
    color: var(--circle);
}
.round[data-locked="1"] > select {
    pointer-events: none;
}
.round > div[data-card] {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid transparent;

    line-height: 34px;
    font-weight: bold;

    transition-property: background-color, border-color, text-shadow;
    transition-duration: 100ms;
    transition-timing-function: ease;
}
.round > div[data-card]:hover {
    text-decoration: underline;

    cursor: pointer;
}
.round > div[data-card].green {
    text-shadow: 1px 1px var(--black);

    background-color: var(--green)
}
.round > div[data-card].red {
    text-shadow: 1px 1px var(--black);
    
    background-color: var(--orange)
}
.round > div[data-verified="green"] {
    border-color: var(--green);
} 
.round > div[data-verified="red"] {
    border-color: var(--orange);
}

.round[data-cards="4"] > div:nth-child(11), .round[data-cards="4"] > div:nth-child(12) {
    visibility: hidden;
}
.round[data-cards="5"] > div:nth-child(12) {
    visibility: hidden;
}

/*
* Solve Dialog
*/

#check_solution {
    gap: 15px;
}
#check_solution > * {
    width: 90px;
    height: 38px;
    padding: 0;

    line-height: 38px;
}
#solution:valid {
    color: var(--white);
}
.solution_result.green {
    color: var(--green);
}

/*
* Handle small screens
*/

@media screen and (orientation: landscape) and (max-height: 580px) {
    #tools {
        display: none;
    }
}

@media screen and (max-width: 600px) {
    #tools[data-view="rounds"] > #numbers, #tools[data-view="numbers"] > #rounds {
        flex-grow: 0;
        
        cursor: pointer;
    }
    #tools[data-view="rounds"] > #numbers > *, #tools[data-view="numbers"] > #rounds > * {
        display: none;
    }
    #tools[data-view="rounds"] > #numbers::after, #tools[data-view="numbers"] > #rounds::after {
        content: "▶";
        display: block;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    #tools[data-view="numbers"] > #rounds::after {
        content: "◀";
    }
}