:root {
    --venture-ink: #20243a;
    --venture-indigo: #5145cd;
    --venture-purple: #7c3aed;
    --venture-coral: #ef6a67;
    --venture-gold: #f4b740;
    --venture-paper: #fffdf8;
}

html, body {
    color: var(--venture-ink);
    font-family: Inter, ui-rounded, 'Segoe UI', system-ui, sans-serif;
}

body {
    background:
        radial-gradient(circle at 78% 6%, rgba(244, 183, 64, .14), transparent 26rem),
        radial-gradient(circle at 20% 94%, rgba(124, 58, 237, .09), transparent 30rem),
        #f7f4ee;
}

a, .btn-link {
    color: #5546c7;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--venture-indigo), var(--venture-purple));
    border-color: var(--venture-indigo);
    box-shadow: 0 .25rem .7rem rgba(81, 69, 205, .2);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: linear-gradient(135deg, #4338b7, #6d28d9);
    border-color: #4338b7;
}

.btn {
    border-radius: .65rem;
    font-weight: 650;
}

.btn-success {
    background: linear-gradient(135deg, #087f67, #0e9f6e);
    border-color: #087f67;
}

main:not(:has(.game-page)) > .content {
    margin-inline: auto;
    max-width: 90rem;
    padding-bottom: 4rem;
}

main:not(:has(.game-page)) h1 {
    color: #2e276f;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.15rem, 4vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -.045em;
    margin-top: .55rem;
}

main:not(:has(.game-page)) h1::after {
    background: linear-gradient(90deg, var(--venture-coral), var(--venture-gold));
    border-radius: 99rem;
    content: "";
    display: block;
    height: .3rem;
    margin-top: .55rem;
    width: 4.5rem;
}

.lead {
    color: #605d73;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50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jMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.game-page {
    color: var(--game-text-colour, #212529);
    font-family: var(--game-font, 'Helvetica Neue', Helvetica, Arial, sans-serif);
    min-height: calc(100vh - 2.2rem);
}

main:has(.game-page) {
    background: var(--game-page-background, #fff);
}

.game-page h1,
.game-page .game-text h2,
.game-page .game-text h3,
.game-page .game-text h4,
.game-page .game-text h5,
.game-page .game-text h6 {
    color: var(--game-heading-colour, inherit);
    font-family: var(--game-heading-font, var(--game-font, 'Helvetica Neue', Helvetica, Arial, sans-serif));
}

.game-player {
    max-width: 52rem;
}

.game-scene-image {
    aspect-ratio: 16 / 7;
    border-radius: .65rem;
    display: block;
    margin-bottom: 1.5rem;
    object-fit: cover;
    width: 100%;
}

.game-library-logo {
    aspect-ratio: 1;
    border-radius: 1rem;
    display: block;
    margin: 1.25rem auto 0;
    max-width: calc(100% - 2.5rem);
    object-fit: cover;
    width: 12rem;
}

.game-library-card {
    color: inherit;
    display: block;
    height: 100%;
    text-decoration: none;
}

.game-library-card .card {
    background: rgba(255, 253, 248, .92);
    border: 1px solid rgba(81, 69, 205, .15);
    border-radius: 1.15rem;
    box-shadow: 0 .35rem 1.2rem rgba(39, 32, 87, .08);
    overflow: hidden;
    position: relative;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.game-library-card .card::before {
    background: linear-gradient(90deg, var(--venture-coral), var(--venture-gold), var(--venture-purple));
    content: "";
    height: .35rem;
    inset: 0 0 auto;
    position: absolute;
}

.game-library-card:hover .card,
.game-library-card:focus-visible .card {
    border-color: rgba(81, 69, 205, .55);
    box-shadow: 0 1rem 2rem rgba(39, 32, 87, .16);
    transform: translateY(-5px) rotate(.15deg);
}

.game-library-card:focus-visible {
    border-radius: .375rem;
    outline: .2rem solid rgba(13, 110, 253, .35);
    outline-offset: .2rem;
}

.game-inventory {
    background: var(--game-panel-background, #f4f6f8);
    border: 1px solid var(--game-panel-border, #d9dee3);
    border-radius: .5rem;
    margin-bottom: 1.5rem;
    padding: .75rem 1rem;
}

.game-text {
    font-family: var(--game-story-font, Georgia, 'Times New Roman', serif);
    font-size: 1.12rem;
    line-height: 1.75;
    margin-bottom: 1.75rem;
}

.game-text h2,
.game-text h3,
.game-text h4,
.game-text h5,
.game-text h6 {
    margin-top: 1.5rem;
}

.game-colour-red { color: #b42318; }
.game-colour-orange { color: #b54708; }
.game-colour-yellow { color: #8a6100; }
.game-colour-green { color: #067647; }
.game-colour-blue { color: #175cd3; }
.game-colour-purple { color: #6938ef; }
.game-colour-black { color: #101828; }
.game-colour-white { color: #fff; background: #344054; padding: 0 .15rem; }

.game-style-underlined {
    text-decoration: underline;
}

.game-style-struck {
    text-decoration: line-through;
}

.game-style-serif {
    font-family: Georgia, 'Times New Roman', serif;
}

.game-style-monospace {
    font-family: 'Cascadia Mono', Consolas, monospace;
}

.game-style-uppercase {
    letter-spacing: .14em;
    text-transform: uppercase;
}

.game-style-large {
    font-size: 1.45em;
}

.game-style-small {
    font-size: .75em;
}

.game-style-speech,
.speech {
    color: var(--game-speech-colour, var(--game-accent, #5145cd));
    font-style: italic;
    quotes: "“" "”";
}

.game-style-speech::before,
.speech::before {
    content: open-quote;
}

.game-style-speech::after,
.speech::after {
    content: close-quote;
}

.game-style-light-swatch {
    background: #f4f1e8;
    border-radius: .2rem;
    padding: .1rem .35rem;
}

.game-choices {
    display: grid;
    gap: .75rem;
}

.game-choice {
    border-color: var(--game-accent, #0d6efd);
    color: var(--game-accent, #0d6efd);
    text-align: left;
}

.game-choice:hover,
.game-choice:focus-visible {
    background: var(--game-accent, #0d6efd);
    border-color: var(--game-accent, #0d6efd);
    color: var(--game-accent-text, #fff);
}

.game-choice-number {
    font-weight: 700;
}

.game-ending {
    margin-top: 1.5rem;
}

.game-inline-link {
    appearance: none;
    background: none;
    border: 0;
    color: var(--game-link-colour, #006bb7);
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
}

.game-inline-link:hover,
.game-inline-link:focus-visible {
    color: var(--game-link-hover-colour, #0a58ca);
}

.game-link-dialog {
    border: 0;
    border-radius: .75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .25);
    max-width: min(32rem, calc(100vw - 2rem));
    padding: 0;
    width: 100%;
}

.game-link-dialog::backdrop {
    background: rgba(16, 24, 40, .55);
}

.game-link-dialog-content {
    padding: 1.5rem;
}

.game-source-editor {
    background: #171827;
    border: 1px solid #343657;
    color: #f6f1ff;
    font-family: Consolas, 'Courier New', monospace;
    line-height: 1.45;
    min-height: 34rem;
    resize: vertical;
    tab-size: 4;
}

.game-source-editor:focus {
    background: #171827;
    border-color: #8b7cf6;
    box-shadow: 0 0 0 .25rem rgba(124, 58, 237, .18);
    color: #fff;
}

.help-page {
    max-width: 62rem;
}

.help-page section {
    margin-top: 2.75rem;
    scroll-margin-top: 1rem;
}

.help-page pre {
    background: linear-gradient(145deg, #171827, #242641);
    border: 1px solid #36395e;
    border-radius: .8rem;
    box-shadow: inset 0 1px rgba(255, 255, 255, .05), 0 .5rem 1.2rem rgba(32, 36, 58, .1);
    color: #eef4f8;
    overflow-x: auto;
    padding: 1rem 1.25rem;
}

.help-page code {
    font-family: Consolas, 'Courier New', monospace;
}

.help-toc {
    align-items: flex-start;
    background: #f4f6f8;
    border: 1px solid #d9dee3;
    border-radius: .5rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1rem 1.25rem;
}

.faq-list {
    display: grid;
    gap: .75rem;
}

.faq-list details {
    background: rgba(255, 253, 248, .85);
    border: 1px solid rgba(81, 69, 205, .16);
    border-radius: .85rem;
    box-shadow: 0 .25rem .8rem rgba(39, 32, 87, .05);
    padding: 1rem 1.15rem;
}

.faq-list summary {
    color: #3b337f;
    cursor: pointer;
    font-weight: 600;
}

.faq-list details p {
    margin: .75rem 0 0;
}

.nav-tabs {
    border-bottom-color: rgba(81, 69, 205, .2);
    gap: .25rem;
}

.nav-tabs .nav-link {
    border-radius: .7rem .7rem 0 0;
    color: #5b5870;
    font-weight: 650;
}

.nav-tabs .nav-link.active {
    background: var(--venture-paper);
    border-color: rgba(81, 69, 205, .22) rgba(81, 69, 205, .22) var(--venture-paper);
    color: var(--venture-indigo);
}

.badge.text-bg-secondary {
    background: #eeeafd !important;
    border: 1px solid #d9d2fa;
    color: #4a3ca2 !important;
    font-weight: 650;
}

.form-control,
.form-select {
    border-color: #cbc6dc;
    border-radius: .65rem;
}

.alert {
    border: 0;
    border-radius: .85rem;
    box-shadow: 0 .3rem .9rem rgba(39, 32, 87, .06);
}

.home-hero {
    align-items: center;
    display: grid;
    gap: clamp(2rem, 6vw, 6rem);
    grid-template-columns: minmax(0, 1.4fr) minmax(16rem, .6fr);
    min-height: 31rem;
    padding: clamp(2rem, 5vw, 5rem) 0;
}

.home-hero-copy {
    max-width: 48rem;
}

.home-kicker {
    color: #7a3470;
    display: inline-block;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .15em;
    margin-bottom: .65rem;
    text-transform: uppercase;
}

.home-hero .lead {
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    line-height: 1.65;
    max-width: 44rem;
}

.home-hero-emblem {
    align-items: center;
    aspect-ratio: 1;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, .32), transparent 25%),
        linear-gradient(145deg, #ef6a67, #7c3aed 72%);
    border: .65rem solid rgba(255, 255, 255, .55);
    border-radius: 45% 55% 48% 52% / 56% 42% 58% 44%;
    box-shadow: 0 1.5rem 3.5rem rgba(76, 48, 147, .25);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 22rem;
    padding: 2rem;
    transform: rotate(2deg);
}

.home-hero-emblem span {
    color: #ffe49a;
    font-size: 2.4rem;
}

.home-hero-emblem strong {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1.05;
}

.home-features {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 3rem;
}

.home-features article {
    background: rgba(255, 253, 248, .88);
    border: 1px solid rgba(81, 69, 205, .14);
    border-radius: 1.15rem;
    box-shadow: 0 .5rem 1.5rem rgba(39, 32, 87, .07);
    padding: 1.6rem;
}

.home-feature-icon {
    color: var(--venture-coral);
    font-size: 2rem;
    font-weight: 800;
}

.home-features h2 {
    color: #393174;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin: .55rem 0;
}

.home-features p {
    color: #605d73;
    line-height: 1.6;
    margin: 0;
}

.home-callout {
    align-items: center;
    background: linear-gradient(110deg, #29245f, #5145cd);
    border-radius: 1.15rem;
    box-shadow: 0 1rem 2rem rgba(39, 32, 87, .16);
    color: #fff;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
}

.home-callout p {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.home-callout a {
    color: #ffe49a;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .home-hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .home-hero-emblem {
        max-width: 16rem;
    }

    .home-features {
        grid-template-columns: 1fr;
    }

    .home-callout {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-library-card .card {
        transition: none;
    }
}
.code-mirror-editor {
    background: var(--venture-paper);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
}

.code-mirror-editor:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.code-mirror-editor .cm-editor.cm-focused {
    outline: none;
}

.code-mirror-editor .cm-game-directive {
    color: #8a2be2;
    font-weight: 700;
}

.code-mirror-editor .cm-game-heading {
    color: #087990;
    font-weight: 700;
}

.code-mirror-editor .cm-game-string {
    color: #198754;
}

.game-editor-files .card-body {
    max-height: 24rem;
    overflow: auto;
}

.game-file-tree ul {
    border-left: 1px solid rgba(81, 69, 205, .16);
    margin-left: .65rem;
    padding-left: .45rem;
}

.game-file-tree-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: .4rem;
    color: var(--venture-ink);
    display: flex;
    font-family: var(--bs-font-monospace);
    font-size: .82rem;
    gap: .35rem;
    padding: .25rem .35rem;
    text-align: left;
    width: 100%;
}

.game-file-tree-item:hover {
    background: rgba(81, 69, 205, .08);
}

.game-file-tree-item.active {
    background: #eeeafd;
    color: #3f3293;
    font-weight: 700;
}

.game-editor-file-heading {
    align-items: center;
    display: flex;
    gap: .5rem;
}

.validation-issue-link {
    padding: 0;
    text-align: left;
    text-decoration: none;
}

.validation-issue-link:hover,
.validation-issue-link:focus-visible {
    text-decoration: underline;
}

@media (max-width: 767.98px) {
    .code-mirror-editor .cm-editor {
        height: 28rem !important;
        font-size: 1rem !important;
    }

    .code-mirror-editor .cm-content {
        min-height: 27rem !important;
    }
}
