/* minimal reset */
* {
    box-sizing: border-box;
    margin: 0;
}

html {
    font-family: sans-serif;
}

/* minimal theming */
:root {
    --theme-background-color: #eee;
    --theme-border-color: darkgray;
    --theme-color: #222;
    --theme-button-color: black;
    --theme-animated-hilight-color: #ff06b5;
    --theme-danger-color: darkred;
}

@media (prefers-color-scheme: dark) {
    :root {
        --theme-background-color: #222;
        --theme-border-color: black;
        --theme-color: #eee;
        --theme-button-color: darkgray;
        --theme-animated-hilight-color: #ff06b5;
        --theme-danger-color: darkorange;
    }
}

/* roller styles */
html {
    background-color: var(--theme-background-color);
    color: var(--theme-color);
}

#header-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 5.5rem;
    display: grid;
    grid-template-columns: 1fr 4fr 1fr;
    border-bottom: 0.1rem solid var(--theme-border-color);
    padding: 1rem;
    align-items: center;
    background-color: var(--theme-background-color);
    z-index: 1;
}

#header-bar nav {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

#header-bar nav:has(#menu-toggle) {
    justify-content: center;
}

#header-bar nav:has(#history-toggle) {
    justify-content: center;
}

#menu-toggle,
#menu-toggle::selection {
    all: unset;
    font-size: 2rem;
}

#title-display {
    text-align: center;
    font-size: 3rem;
    background-color: var(--theme-background-color);
    color: var(--theme-color);
}

#title-display[data-rolled=true] {
    animation: glow 500ms ease-out;
}

#history-toggle,
#history-toggle::selection {
    all: unset;
    font-size: 2rem;
}

.history-entry {
    width: 100%;
    font-size: 2rem;
    text-align: center;
    border-bottom: 0.1rem solid var(--theme-border-color);
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 4fr 1fr;
    grid-template-areas: "l c r";
}

.history-entry:has(> .clicked) {
    background-color: var(--theme-animated-hilight-color);
    transition-property: background-color, color;
    transition-duration: 300ms, 300ms;
    transition-timing-function: linear, linear;
}

.history-entry-command {
    grid-area: c;
}

.history-entry-delete {
    grid-area: r;
    color: var(--theme-danger-color);
}

#content-display,
#history-display,
#menu-display {
    position: absolute;
    top: 5.5rem;
    left: 0;
    right: 0;
    overflow: auto;
}

#history-display,
#menu-display {
    bottom: 0;
}

#content-display {
    bottom: 12.4rem;
}

#content-display:has(> #message-result),
#history-display:has(> #no-history),
#menu-display:has(> #no-menu) {
    display: flex;
    justify-content: center;
    align-items: center;
}

#message-result,
#no-history,
#no-menu {
    font-size: 2rem;
    max-width: 80%;
}

#die-results {
    width: 100%;
    display: flex;
    flex-flow: wrap;
    justify-content: center;
    align-items: center;
}

.die-result {
    width: 25%;
    padding: 1rem;
    display: inline-block;
    border-right: 0.1rem solid var(--theme-border-color);
    border-bottom: 0.1rem solid var(--theme-border-color);
    background-color: var(--theme-background-color);
    color: var(--theme-color);
}

.die-result:nth-child(4n+1) {
    border-left: 0.1rem solid var(--theme-border-color);
}

.die-result[data-rolled=true] {
    animation: glow 500ms ease-out;
}

@keyframes glow {
    0% {
        text-shadow: 0 0 5rem var(--theme-animated-hilight-color);
        color: transparent;
    }

    50% {
        text-shadow: 0 0 1rem var(--theme-animated-hilight-color);
        color: transparent;
    }

    100% {
        text-shadow: 0 0 0px var(--theme-animated-hilight-color);
        color: var(--theme-color);
    }
}

.die-graphic {
    display: flex;
    justify-content: center;
    align-items: center;
}

.die-value {
    font-size: 2rem;
}

#input-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 12.4rem;
    display: grid;
    grid-template-rows: 1fr 3fr;
    background-color: var(--theme-background-color);
    z-index: 1;
}

#command-input {
    all: unset;
    width: 100%;
    border-top: 0.1rem solid var(--theme-border-color);
    padding: 0.5rem;
    box-sizing: border-box;
    font-size: 2rem;
    background-color: var(--theme-background-color);
    color: var(--theme-color);
    transition-property: background-color, color;
    transition-duration: 300ms, 300ms;
    transition-timing-function: linear, linear;
}

#command-input[data-loaded=true] {
    background-color: var(--theme-animated-hilight-color);
}

#roll-button {
    width: 100%;
    font-size: 3rem;
    background: linear-gradient(var(--theme-background-color), var(--theme-border-color));
    color: var(--theme-color);
}
