:root {
    --header-section-min: 400px;
    --combat-list-max-width: 1520px;
    --combat-entry-width: 380px;
    --combat-entry-height: 50px;
    --header-height: 50px;
}

html {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    padding: 0px var(--main-margin);
}

body {
    width: 100%;
    max-width: var(--combat-list-max-width);
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    align-self: center;

    display: grid;
    grid-auto-rows: max-content;

    /*border: 1px dotted green;/**/

    margin: 0px;
}

header {
    display: grid;
    align-items: stretch;
    justify-content: space-between;
    grid-template-columns: 320px 1fr 320px;
    font-size: 1.6em;
    width: 100%;
    max-width: var(--combat-list-max-width);
    align-self: center;
    position: sticky;
    top: 0px;
    padding-top: 20px;
    background-color: black;
    /*border: 1px solid orange;/**/
}

header>h1, header>h2 {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0px;
    text-align: center;
}

.combat-display.in-combat {
    display: unset;
}

.date {
    width: fit-content;
    white-space: nowrap;
    place-self: top start;
}

.location {
    width: fit-content;
    padding: 20px;
    text-align: center;
    place-self: center center;
    font-size: 1.8em;
}

.time {
    width: fit-content;
    justify-self: end;
}

.narrow, .tight {
    display: none;
}

.full {
    display: unset;
    /*background-color: lime;/**/
}

/* Narrow */
@media only screen and (max-width: 1000px) {
    .full {
        display: none;
    }
    .narrow {
        display: unset;
        /*background-color: gold;/**/
    }

    header {
        grid-template-columns: 1fr;
        grid-auto-flow: row;
    }
}

/* Tight */
@media only screen and (max-width: 600px) {
    .full, .narrow {
        display: none;
    }

    .tight {
        display: unset;
        /*background-color: tomato;/**/
    }

    header {
        grid-template-columns: 1fr;
        grid-auto-flow: row;
    }

    .location {
        max-width: 100%;
    }
}

.headline {
    font-size: 2.6em;
    margin: auto;
    text-align: center;
}

h1 {
    font-size: 2.6em;
    margin: 5px auto;
}

h2 {
    font-size: 1.2em;
    margin: 2px auto;
}

#combat-section.combat-display {
    display: none;
    flex-direction: column;
    margin: 0px;
}

#combat-section.combat-display.in-combat {
    width: 100%;
    min-width: 0px;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    
    display: flex;

    /*border: 1px solid red;/**/
}

#combat-list {
    width: 100%;
    min-width: 0px;
    max-width: var(--combat-list-max-width);
    min-height: 100%;
    box-sizing: border-box;

    display: grid;
    grid-template-rows: repeat(auto-fill, var(--combat-entry-height));
    grid-auto-flow: column;/**/
    justify-content: center;
    grid-auto-rows: var(--combat-entry-height);
}

.combat-entry {
    width: var(--combat-entry-width);
    height: var(--combat-entry-height);

    display: flex;
    align-items: center;

    font-size: 1.3em;

    box-sizing: border-box;
    border: 1px dotted yellow;/**/
}

.dead #name {
    text-decoration: line-through;
}

.indicator {
    color: green;
    width: 1em;
    height: 1em;
    visibility: hidden;
}

.current .indicator {
    visibility: initial;
}

#mode-wrapper .main-section {
    display: none;
}

#mode-wrapper.explore .main-section.explore {
    display: flex;
}

#mode-wrapper.combat .main-section.combat {
    display: flex;
}

.main-section.explore {
    flex-flow: column;
    align-items: center;
}

.party-formation {
    width: fit-content;
    height: fit-content;
    display: grid;
    grid-template: repeat(5, 70px) / repeat(5, 1fr);
    gap: 2px;
}

.party-formation>div {
    width: 70px;
    line-height: 70px;
    aspect-ratio: 1;
    text-align: center;
    border: 1px dotted silver;
    user-select: none;
}

.initiative-form {
    display: inline-flex;
    margin-left: auto;
    margin-right: auto;
    gap: 10px;
}

input[type=text].initiative {
    width: 3em;
}