.thyrathen-guide {
    --thg-brand: #571313;
    --thg-deep: #35120f;
    --thg-ink: #36271f;
    --thg-muted: #655548;
    --thg-paper: #fffdf7;
    --thg-option: #f8f3e7;
    --thg-hover: #eee4cb;
    --thg-gold: #ccbc86;
    --thg-line: #b3a16f;
    --thg-edge: 1rem;
    --thg-right: calc(var(--thg-edge) + env(safe-area-inset-right, 0px));
    --thg-bottom: calc(var(--thg-edge) + env(safe-area-inset-bottom, 0px));
    --thg-launcher-size: 3.5rem;
    font-family: inherit;
}

.thyrathen-guide [hidden],
.thyrathen-guide .thyrathen-guide__dialog:not([open]),
.thyrathen-guide .thyrathen-guide__launcher[aria-expanded="true"] .thyrathen-guide__tooltip {
    display: none !important;
}

.thyrathen-guide .thyrathen-guide__launcher {
    position: fixed;
    inset: auto var(--thg-right) var(--thg-bottom) auto;
    z-index: 9990;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: var(--thg-launcher-size);
    height: var(--thg-launcher-size);
    margin: 0;
    padding: 0;
    border: 2px solid var(--thg-gold);
    border-radius: 50%;
    color: var(--thg-paper);
    background: var(--thg-brand);
    box-shadow: 0 4px 18px rgb(53 18 15 / 28%);
    cursor: pointer;
    line-height: 1;
}

.thyrathen-guide .thyrathen-guide__launcher:hover {
    background: var(--thg-deep);
}

.thyrathen-guide .thyrathen-guide__bubble {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 25px;
    height: 19px;
    border: 2px solid currentColor;
    border-radius: 7px;
}

.thyrathen-guide .thyrathen-guide__bubble::before {
    position: absolute;
    inset: 6px auto auto 3px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 6px 0 currentColor, 12px 0 currentColor;
    content: "";
}

.thyrathen-guide .thyrathen-guide__bubble::after {
    position: absolute;
    inset: auto auto -5px 4px;
    width: 7px;
    height: 5px;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    border-radius: 0 0 0 2px;
    background: var(--thg-brand);
    transform: skewY(-32deg);
    content: "";
}

.thyrathen-guide .thyrathen-guide__launcher:hover .thyrathen-guide__bubble::after {
    background: var(--thg-deep);
}

.thyrathen-guide .thyrathen-guide__tooltip {
    position: fixed;
    inset: auto calc(var(--thg-right) + var(--thg-launcher-size) + .55rem) calc(var(--thg-bottom) + .4rem) auto;
    z-index: 9990;
    box-sizing: border-box;
    width: max-content;
    max-width: min(16rem, calc(100vw - var(--thg-right) - var(--thg-launcher-size) - 1.4rem));
    padding: .5rem .75rem;
    border: 1px solid var(--thg-line);
    border-radius: 1rem;
    color: var(--thg-brand);
    background: var(--thg-paper);
    box-shadow: 0 3px 13px rgb(53 18 15 / 18%);
    font: inherit;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: start;
    white-space: normal;
    overflow-wrap: anywhere;
    pointer-events: none;
}

.thyrathen-guide .thyrathen-guide__dialog {
    position: fixed;
    inset: auto var(--thg-right) var(--thg-bottom) auto;
    z-index: 9991;
    box-sizing: border-box;
    width: min(25rem, calc(100vw - var(--thg-right) - var(--thg-edge) - env(safe-area-inset-left, 0px)));
    max-width: none;
    max-height: min(38rem, calc(100vh - var(--thg-bottom) - var(--thg-edge)));
    max-height: min(38rem, calc(100dvh - var(--thg-bottom) - var(--thg-edge) - env(safe-area-inset-top, 0px)));
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--thg-line);
    border-radius: 1rem;
    color: var(--thg-ink);
    background: var(--thg-paper);
    box-shadow: 0 10px 44px rgb(53 18 15 / 26%);
    font: inherit;
    line-height: 1.45;
}

.thyrathen-guide .thyrathen-guide__dialog[open] {
    display: flex;
    flex-direction: column;
}

.thyrathen-guide .thyrathen-guide__dialog::backdrop {
    background: rgb(53 18 15 / 18%);
}

.thyrathen-guide .thyrathen-guide__header {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .3rem .65rem;
    padding: .45rem .65rem .45rem 1rem;
    border-bottom: 2px solid var(--thg-gold);
    color: var(--thg-paper);
    background: var(--thg-brand);
}

.thyrathen-guide .thyrathen-guide__title {
    flex: 1 1 8rem;
    margin: 0;
    color: inherit;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.thyrathen-guide .thyrathen-guide__controls {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    min-width: 0;
    max-width: 100%;
    margin-inline-start: auto;
}

.thyrathen-guide .thyrathen-guide__close,
.thyrathen-guide .thyrathen-guide__sound,
.thyrathen-guide .thyrathen-guide__language,
.thyrathen-guide .thyrathen-guide__back {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    max-width: 100%;
    margin: 0;
    padding: .25rem .55rem;
    border: 1px solid transparent;
    border-radius: .45rem;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
}

.thyrathen-guide .thyrathen-guide__close {
    padding-inline: .3rem;
    font-size: 1.5rem;
}

.thyrathen-guide .thyrathen-guide__sound,
.thyrathen-guide .thyrathen-guide__language {
    border-color: var(--thg-gold);
    font-size: .85rem;
    font-weight: 650;
}

.thyrathen-guide .thyrathen-guide__controls button:hover {
    color: var(--thg-paper);
    background: var(--thg-deep);
}

.thyrathen-guide .thyrathen-guide__sound[aria-pressed="false"] {
    text-decoration: line-through;
}

.thyrathen-guide .thyrathen-guide__content {
    min-height: 0;
    padding: .9rem 1rem 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.thyrathen-guide .thyrathen-guide__back {
    margin: 0 0 .2rem -.45rem;
    color: var(--thg-brand);
    text-decoration: underline;
    text-underline-offset: .15em;
}

.thyrathen-guide .thyrathen-guide__back:hover {
    background: var(--thg-option);
}

.thyrathen-guide .thyrathen-guide__heading {
    margin: 0 0 .7rem;
    color: var(--thg-deep);
    font: inherit;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.thyrathen-guide .thyrathen-guide__intro,
.thyrathen-guide .thyrathen-guide__status {
    margin: 0 0 .75rem;
    color: var(--thg-muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.thyrathen-guide .thyrathen-guide__status {
    padding: .44rem .6rem;
    border-inline-start: 3px solid var(--thg-line);
    background: var(--thg-option);
    font-size: .85rem;
}

.thyrathen-guide .thyrathen-guide__choices {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.thyrathen-guide .thyrathen-guide__choices li {
    margin: 0;
}

.thyrathen-guide .thyrathen-guide__option {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: .62rem .75rem;
    border: 1px solid var(--thg-line);
    border-radius: .55rem;
    color: var(--thg-brand);
    background: var(--thg-option);
    cursor: pointer;
    font: inherit;
    font-weight: 650;
    line-height: 1.4;
    text-align: start;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

.thyrathen-guide .thyrathen-guide__option:hover {
    color: var(--thg-deep);
    background: var(--thg-hover);
}

.thyrathen-guide button:focus-visible,
.thyrathen-guide a:focus-visible {
    outline: 2px solid var(--thg-brand);
    outline-offset: 2px;
}

.thyrathen-guide .thyrathen-guide__launcher:focus-visible,
.thyrathen-guide .thyrathen-guide__controls button:focus-visible {
    outline: 2px solid var(--thg-paper);
    outline-offset: -4px;
}

@media (max-width: 30rem) {
    .thyrathen-guide {
        --thg-edge: .75rem;
    }

    .thyrathen-guide .thyrathen-guide__content {
        padding-inline: .75rem;
    }

    .thyrathen-guide .thyrathen-guide__header {
        padding-inline: .6rem;
    }

    .thyrathen-guide .thyrathen-guide__title {
        flex-basis: 100%;
    }
}
