:root {
    --addr-width: 130rem;
}

#ip-addr {
    display: flex;
    flex-grow: 2;
    flex-direction: column;
    order: 1;
    width: 100%;
    height: max(30vh, 2rem);
    gap: 1rem;
    padding: 1rem;
    align-items: center;
    justify-content: center;
}

#ip-addr > a {
    font-size: max(min(8vh, 8vw), 2rem);
    text-align: center;
    padding: 1rem;
    width: 75vw;
    border-radius: clamp(1rem, 2vw, 5rem);
    text-decoration: none;
    background-color: rgba(0, 0, 0, 0);
}

#ip-addr > a:hover {
    color: var(--forground-highlight-color);
    background: var(--background-highlight-color);
}

.user_tr, .public_tr {
    width: 100%;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr min(3vw, 2rem) min(3vw, 2rem);
    justify-items: stretch;
}

.user_tr > th:first-child, .public_tr > th:first-child {
    text-align: right;
    padding-right: 1ch;
}

.user_tr > th:nth-child(2), .public_tr > th:nth-child(2) {
    text-align: center;
    padding-right: 1ch;
    padding-left: 1ch;
}

.user_tr > th:nth-child(3), .public_tr > th:nth-child(3) {
    text-align: left;
    padding-right: 1ch;
    padding-left: 1ch;
}

img {
    height: min(3vw, 2rem);
    width: min(3vw, 2rem);
    align-self: center;
}

.flag {
    width: min(1.48 * 3vw, 1.48 * 2rem);
    align-self: center;
}

table {
    width: 100%;
}

input {
    text-align: center;
    width: min(90vw, max(50vh, 10rem, 12vw));
    border: 1px solid var(--border-color);
    border-radius: clamp(1rem, 2vw, 5rem);
    color: var(--forground-color);
    background: var(--background-color);
    font-family: 'Space Mono', monospace;
    font-size: min(3vw, 1.5rem);
}

input:focus {
    color: var(--forground-highlight-color);
    background: var(--background-highlight-color);
    outline: 2px solid white; /*todo red or green depending on min and max len*/
}

.name:hover, .address:hover {
    text-decoration: var(--background-highlight-color) underline;
}

#edit-container {
    display: flex;
    flex-grow: 2;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    order: 1;
    align-items: center;
    justify-content: center;
}

#qr {
    order: 1;
    height: min(90vw, max(50vh, 10rem, 12vw));
    width: auto;
    align-self: center;
}

#edit {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

#edit > div {
    display: grid;
}

#edit-valid, #edit-save, #copy-token {
    grid-column: 1;
    grid-row: 1;
    z-index: 1;
    justify-self: right;
}

#edit-name, #edit-addr, #token {
    grid-column: 1;
    grid-row: 1;
    z-index: 1;
}

#token-container {
    width: min(90vw, max(50vh, 12rem, 12vw));
}

#token {
    border: 1px solid var(--border-color);
    border-radius: clamp(1rem, 2vw, 5rem);
    padding-left: 16px;
    padding-right: 32px;
    text-align: center;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

#addrs > div > h1 {
    text-align: center;
    border: 1px solid var(--table-header-color);
    border-radius: .5ch;
    color: var(--table-header-color);
}

#edit-qr {
    order: 1;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 0.5rem;
    width: min(90vw, max(50vh, 10rem));
    align-items: center;
    justify-content: space-around;
}


#addrs {
    order: 2;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 3rem;
    justify-content: center;
    width: min(90vw, var(--addr-width));
}

#addrs > div {
    width: min(60rem, 90vw);
}


main {
    column-gap: 0;
}


#hint {
    color: var(--forground-highlight-color);
    background-color: var(--background-highlight-color);
    text-align: center;
    padding-right: 16px;
    width: 15px;
    border: 1px solid var(--border-color);
    border-radius: clamp(1rem, 2vw, 5rem);
    z-index: 2;
    grid-column: 1;
    grid-row: 1;
    justify-self: right;
    margin: 0;
    animation-name: animate_hint;
    animation-duration: 400ms;
    animation-delay: 5ms;
    animation-fill-mode: both;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

@keyframes animate_hint {
    from {
        width: 15px;
        color: rgba(0, 0, 0, 0);
    }
    to {
        width: max(9rem, 100% - 16px);
        color: var(--forground-highlight-color);
    }
}

.img-with-hint-container {
    display: grid;
    float: right;
}

.img-with-hint-container > img {
    grid-column: 1;
    grid-row: 1;
    z-index: 1;
    margin-left: 9rem;
}