:host,
:root {
    --pico-form-element-spacing-vertical: 0.5rem;
    --pico-form-element-spacing-horizontal: 0.75rem;
}

html,
body,
#app {
    height: 100%;
    line-height: 1.4;
}

[hidden] {
    display: none !important;
}

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background-color: var(--pico-background-color);
    z-index: 999999;
}

#main-menu {
    text-align: center;
    max-width: 38rem;
    padding-bottom: 1rem;
}

#main-menu > p {
    font-size: 105%;
    font-style: italic;
    color: var(--pico-secondary);
    margin-bottom: 2rem;
}

#main-menu select {
    border-width: 2px;
    border-color: #373c44;
}

#main-menu > img {
    display: inline-block;
    margin: 1rem auto;
}

#main-menu .menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    max-width: 20rem;
    align-content: center;
    margin: 0 auto;
}

#main-menu .menu > * {
    width: 100%;
    max-width: 20rem;
}
#main-menu .menu > [role="button"],
#main-menu .menu > button {
    font-weight: 700;
    border: 2px solid var(--pico-color);
}

#main-menu .menu > .secondary {
    color: var(--pico-color);
    background-color: transparent;
}

#main-menu #credits {
    margin-top: 2rem;
}

#main-menu .tabletop-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#main-menu .tabletop-wrapper #thumb {
    display: block;
    width: 180px;
    margin-top: 0.5rem;
    overflow: hidden;
    border-radius: 3px;
}

#main-menu .tabletop-wrapper #buy_button {
    user-select: none;
    box-sizing: border-box;
    display: inline-block;
    background: #ff2449;
    color: white;
    text-decoration: none;
    padding: 0 10px;
    font-size: 14px;
    text-shadow: 0 1px 0 #c3223e;
    background: #ff2449;
    color: white;
    text-shadow: 0 1px 0 #c3223e;
    cursor: pointer;
    border-radius: 3px;
    border: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.21);
    text-align: center;
    line-height: 33px;
    font-weight: bold;
    height: 35px;
    min-width: auto;
    width: auto;
    position: relative;
    top: -15px;
    opacity: 1;
    text-transform: none;
}

#app {
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

#app #logs {
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 0;
    position: relative;
    padding-top: 1rem;
}

#app #fade-effect {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 200px;
    background: linear-gradient(
        to bottom,
        rgb(19, 23, 31) 2%,
        rgba(19, 23, 31, 0) 100%
    );
    opacity: 0;
    transition: opacity 300ms;
    z-index: 1;
    pointer-events: none;
}

#app #scene {
    border-bottom: 1px solid var(--pico-muted-border-color);
    margin-top: 0;
    padding-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--pico-muted-color);
}

button {
    --pico-primary-focus: color-mix(
        in srgb,
        var(--pico-background-color) 40%,
        var(--pico-secondary-inverse)
    );
    text-transform: capitalize;
    opacity: 0.9;
    transition: opacity 0.4s;
    width: 100%;
}

#main-menu .menu :hover,
#main-menu .menu :focus,
#app button:hover,
#app button:focus {
    opacity: 1;
    transform: scale(1.02, 1.05);
}

#app #actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

#app #actions button[data-suffix]::after {
    content: attr(data-suffix);
    text-transform: initial;
    font-size: 0.85em;
}

#app .section {
    margin-top: 1rem;
}

#app .line {
    position: relative;
}

.diaglog-content .line + .line,
#app .line + .line {
    margin-top: 0.5rem;
}

#app .large {
    font-size: 2rem;
}

#app .line.bold {
    font-weight: 700;
}

#app #logs hr {
    border-width: 4px;
}

#app #logs .divider {
    display: block;
    width: 98%;
    border-top: 2px dotted var(--pico-muted-border-color);
    margin: 0 auto;
}

#app button {
    font-size: 0.875rem;
}

#app #hint {
    color: #876400;
    animation: hint-color-animation 1.5s infinite;
}

#app #info {
    color: var(--pico-muted-color);
    font-style: italic;
}

dialog > article {
    --pico-block-spacing-vertical: 2rem;
    --pico-block-spacing-horizontal: 1.5rem;
    line-height: 2;
}

dialog > article > h2 {
    --pico-font-size: 1.25rem;
}

dialog > article > footer {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex-direction: column-reverse;
}

dialog > article footer > button {
    margin-left: 0 !important;
}

#dialog-alert.daily-challenge-stats > article {
    width: 20rem;
    max-width: 100%;
    text-align: center;
    font-weight: 700;
}

#dialog-alert.daily-challenge-stats > article > footer > button {
    width: 100%;
}

#app .loader {
    display: none;
    padding: var(--pico-block-spacing-vertical) 0;
    text-align: left;
    font-size: 1.25rem;
}

#app.loading .loader {
    display: block;
}

#app.loading #stats,
#app.loading #hint,
#app.loading #info,
#app.loading #actions {
    display: none;
}

.icon {
    display: inline-block;
    position: relative;
    top: -1px;
    width: 24px;
    height: 24px;
    background-size: contain;
    border: none !important;
    transform: scale(0.9);
}

.text-gray {
    color: var(--pico-secondary);
}

[data-alert]:not(a, button, input, [role="button"]) {
    border-bottom: 1px dotted;
    text-decoration: none;
    cursor: help;
}

.text-danger {
    color: #c52f21;
    animation: danger-color-animation 1.5s infinite;
}

@media (min-width: 768px) {
    #app button,
    button {
        min-width: 10rem;
        width: auto;
    }

    dialog > article > footer {
        flex-direction: row;
        justify-content: end;
    }
}

@media (min-width: 1024px) {
    :root,
    :host {
        --pico-font-size: 18px;
    }
}
@media (min-width: 1280px) {
    :root,
    :host {
        --pico-font-size: 18px;
    }
}
@media (min-width: 1536px) {
    :root,
    :host {
        --pico-font-size: 18px;
    }
}

@keyframes hint-color-animation {
    0% {
        color: #876400;
    }
    50% {
        color: #b78800;
    }
    100% {
        color: #876400;
    }
}

@keyframes danger-color-animation {
    0% {
        color: #c52f21;
    }
    50% {
        color: var(--pico-color);
    }
    100% {
        color: #c52f21;
    }
}
