/* Finite dungeon sprite cycles pause while the game is backgrounded. */
html[data-game-hidden="true"] .dungeon-walk-strip {
    animation-play-state: paused;
}

:root {
    --font-ui: "Inter", "Helvetica Neue", Arial, sans-serif;
    --font-display: "Alegreya", "Iowan Old Style", Georgia, "Times New Roman", serif;
    --font-lore: var(--font-display);
    --font-numeric: var(--font-display);
    color-scheme: only dark;
    font-family: var(--font-ui);
    font-synthesis: none;
    font-optical-sizing: auto;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    --safe-area-background: #07090a;
    background: #07090a;
    color: #eee8da;
}

.numeric-value {
    font-family: var(--font-numeric);
    font-variant-numeric: tabular-nums;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-variable.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-italic-variable.woff2") format("woff2");
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Alegreya";
    src: url("../fonts/alegreya-latin-variable.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
}

@font-face {
    font-family: "Alegreya";
    src: url("../fonts/alegreya-latin-italic-variable.woff2") format("woff2");
    font-style: italic;
    font-weight: 400 900;
    font-display: swap;
}

* {
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

html, body, #app { width: 100%; height: 100%; min-height: 0; margin: 0; }
html { overflow: hidden; overscroll-behavior: none; }
body { min-width: 20rem; overflow: hidden; overscroll-behavior: none; background: #07090a; }
html::before {
    position: fixed;
    z-index: 2147483647;
    inset: 0;
    content: "";
    pointer-events: none;
    background:
        linear-gradient(var(--safe-area-background), var(--safe-area-background)) top / 100% env(safe-area-inset-top, 0px) no-repeat,
        linear-gradient(var(--safe-area-background), var(--safe-area-background)) bottom / 100% env(safe-area-inset-bottom, 0px) no-repeat,
        linear-gradient(var(--safe-area-background), var(--safe-area-background)) left / env(safe-area-inset-left, 0px) 100% no-repeat,
        linear-gradient(var(--safe-area-background), var(--safe-area-background)) right / env(safe-area-inset-right, 0px) 100% no-repeat;
}
html:has(.exploration-map) { --safe-area-background: #ddcca5; background-color: #ddcca5; }
html.is-exploration-map { --safe-area-background: #ddcca5; background-color: #ddcca5; }
html:has(.exploration-map) body { background-color: #ddcca5; }
html.is-exploration-map body { background-color: #ddcca5; }
h1:focus { outline: none; }
button { font-family: var(--font-ui); }

::view-transition-group(character-preview-shared) {
    animation-duration: 720ms;
    animation-timing-function: linear;
    perspective: 1100px;
}

::view-transition-image-pair(character-preview-shared) { perspective: 1100px; }
::view-transition-old(character-preview-shared) {
    animation: character-preview-flip-out 360ms linear both;
    backface-visibility: hidden;
}
::view-transition-new(character-preview-shared) {
    animation: character-preview-flip-in 360ms 360ms linear both;
    backface-visibility: hidden;
}

html.is-character-preview-returning::view-transition-old(character-preview-shared) {
    animation-name: character-preview-flip-return-out;
}
html.is-character-preview-returning::view-transition-new(character-preview-shared) {
    animation-name: character-preview-flip-return-in;
}

@keyframes character-preview-flip-out {
    to { opacity: 0; transform: rotateY(90deg); }
}

@keyframes character-preview-flip-in {
    from { opacity: 0; transform: rotateY(-90deg); }
    to { opacity: 1; transform: rotateY(0); }
}

@keyframes character-preview-flip-return-out {
    to { opacity: 0; transform: rotateY(-90deg); }
}

@keyframes character-preview-flip-return-in {
    from { opacity: 0; transform: rotateY(90deg); }
    to { opacity: 1; transform: rotateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(character-preview-shared),
    ::view-transition-old(character-preview-shared),
    ::view-transition-new(character-preview-shared) { animation-duration: 1ms; animation-delay: 0ms; }
}

.app-shell { width: 100%; height: 100vh; height: 100svh; height: 100dvh; height: var(--app-viewport-height, 100dvh); min-height: 0; overflow: hidden; }
.language-picker { position: fixed; z-index: 20; top: 0.85rem; right: 1rem; display: flex; align-items: center; gap: 0.45rem; color: #d9d1c1; font-size: 0.75rem; }
.language-picker select { border: 1px solid #6b6251; border-radius: 0.25rem; padding: 0.28rem 0.4rem; background: #171a1b; color: inherit; font: inherit; }
.campaign-level-select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 3rem; border: 1px solid #77725c66; border-radius: 0.3rem; padding: 0.55rem 0.7rem; color: #e3dac8; font: inherit; background: #0b0e0ddd; }
.campaign-level-select--compact { min-height: 2.4rem; padding: 0.35rem 0.55rem; color: #e2cd9c; font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.language-picker--options { position: static; justify-content: center; margin: 1rem 0 1.2rem; }

@media (max-width: 38rem) {
    .village-run-start .campaign-level-select { min-height: 2.7rem; padding: 0.4rem; font-size: 0.7rem; }
}

#blazor-error-ui {
    position: fixed;
    z-index: 1000;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    padding: 0.75rem 1.25rem;
    background: #351613;
    box-shadow: 0 -1px 8px #0008;
}

#blazor-error-ui a { color: #f0d59b; }
#blazor-error-ui .dismiss { position: absolute; right: 0.8rem; cursor: pointer; }
#blazor-email-error-report, #blazor-share-error-report, #blazor-copy-error-report { margin: .25rem .35rem; border: 1px solid #c6a66a; border-radius: .25rem; padding: .4rem .6rem; color: #f0d59b; background: #211b17; font: inherit; }
#blazor-error-report-status { margin-inline-end: 2rem; }
#blazor-error-report-text { box-sizing: border-box; width: 100%; margin-top: .5rem; color: #ded7c4; background: #171311; font: .75rem/1.4 monospace; }
#blazor-error-report-text[hidden] { display: none; }

.loading-progress {
    position: absolute;
    display: block;
    width: 7rem;
    height: 7rem;
    inset: 28vh 0 auto;
    margin: auto;
}

.loading-progress circle {
    fill: none;
    stroke: #2e302f;
    stroke-width: 0.55rem;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.loading-progress circle:last-child {
    stroke: #ba813f;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
}

.loading-progress-text {
    position: absolute;
    inset: calc(28vh + 2.8rem) 0 auto;
    color: #a7a092;
    font-size: 0.75rem;
    text-align: center;
}

.loading-progress-text::after { content: var(--blazor-load-percentage-text, "Wird geladen"); }
