html {
    --page-bg-rgb: 26, 22, 52;
    --accent-bg-rgb: 40, 26, 33;
    --accent-rgb: 35, 31, 32;
    --dark-accent-rgb: 13, 4, 26;
    --body-rgb: 221, 221, 215;
    --dark-flair-rgb: 219, 97, 162;
    --flair-rgb: 159, 122, 234;
    --light-flair-rgb: 192, 168, 240;

    --white-color: #ffffff;
    --neutral-color: #bbbcc3;
    --dark-text-color: rgba(var(--dark-accent-rgb), 0.9);
    --subtle-text-color: rgba(var(--dark-accent-rgb), 0.5);
    --body-text-color: rgba(var(--body-rgb), 0.9);
    --glow-color: rgba(var(--accent-rgb), 0.4);

    --accent-color: rgb(var(--accent-rgb));
    --accent-bg-color: rgba(var(--accent-rgb), 0.1);
    --accent-hover-color: rgba(var(--flair-rgb), 0.7);
    --light-flair-color: rgba(var(--light-flair-rgb), 0.8);

    --page-bg-color: rgb(var(--page-bg-rgb));
    --sticky-bg-color: var(--light-green);
    --heading-text-color: var(--accent-color);

    --border-color: var(--green);
    --print-border-color: #111;

    --link-text-color: var(--blue);
    --link-hover-color: #b794f4;

    --btn-text-color: var(--white-color);
    --btn-bg-color: var(--pink);
    --btn-hover-color: var(--light-pink);

    --tray-text-color: var(--neutral-color);
    --tray-bg-color: rgba(var(--accent-bg-rgb), 0.65);
    --info-bg-color: #1a1634cc;
    --dropdown-bg-color: rgba(var(--accent-bg-rgb), 0.9);

    --text-font: "Dosis";
    --btn-font: "Dosis";
    --input-font: monospace;
    --answer-font: monospace;

    --text-color: #231f20;
    --black: #160c12;
    --dark-blue: #1a1634;
    --purple: #5f2a57;
    --green: #75be45;
    --light-green: #9cce6d;
    --pink: #d961a4;
    --light-pink: #cb85b9;
    --blue: #2171a0;
    --light-blue: #51b2de;
    --yellow: #f7ea15;

    --content-text-color: var(--text-color);
}


body {
    font-family: var(--text-font);
    font-variant-ligatures: none;
    font-weight: 600;
    line-height: 2.6rem;
    font-size: 1.75rem;
    overflow-wrap: break-word;
    position: relative;
    color: var(--body-text-color);
}

strong {
    text-shadow: 0 0 10px var(--glow-color);
}

@media print {
    nav, .shortcuts {
        display: none;
    }
}

@media screen {
    body {
        margin: 0 auto 60px;
        width: 80%;
        width: 80vw;
        max-width: 1060px;
    }
}

p {
    margin-bottom: 2rem;
}

li {
    list-style-position: outside;
    margin-left: 1.5em;
}

ul > li {
    list-style-type: disc;
}

textarea {
    width: 100%;
    min-height: 24ch;
    font-family: var(--input-font);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--accent-font);
    font-weight: bold;
    text-shadow: 0 0 10px var(--glow-color);

    letter-spacing: 0.02em;
    word-spacing: 0.1em;
}

h1, h2 {
    margin-top: 2.5rem;
    margin-bottom: 4rem;
    font-size: 4rem;
    line-height: 1.2;
}

main {
    position: relative;
}

hr {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

table.very-small {
    font-size: 80%;
}

table.very-small td, table.very-small th {
    padding: 0.4em;
    line-height: 1.4;
}

code {
    max-width: 1000px;
    overflow: scroll;
    border: none;
    padding: 0.1em 0.25em;
    background-color: var(--primary-800);
}

tr:last-child td {
    border-bottom: none;
}

a, .btn {
    color: var(--link-text-color);
}

.btn, .shortcuts .btn {
    display: inline-block;
    text-decoration: none;
    font-weight: normal;
    border: none;
    font-family: var(--accent-font);
    text-transform: uppercase;
    letter-spacing: 0;

    padding: 0 16px;
    height: 32px;
    line-height: 32px;
    font-size: 2rem;
    border-radius: 12px;
    font-weight: 600;
}

form .btn {
    padding: 0 24px;
    height: 48px;
    line-height: 48px;
    font-size: 3rem;
}

input[type=text], input[type=password], input[type=email] {
    width: 100%;
    border-radius: 0;
    margin: 0.5rem 0;
    font-family: var(--input-font);
}

figcaption {
    text-align: center;
}

/* See https://webaim.org/techniques/skipnav/ */
a.skip-to-main {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

a.skip-to-main:focus, a.skip-to-main:active {
    color: #fff;
    background-color: #000;
    opacity: 0.8;
    left: auto;
    top: auto;
    width: 70%;
    height: auto;
    overflow: auto;
    margin: 10px 15%;
    padding: 5px;
    border-radius: 15px;
    text-align:center;
    z-index: 999;
}

a.main-content-anchor {
    /* For some reason, display: block, visibility: hidden is needed. */
    display: block;
    visibility: hidden;
    position: relative;
    top: 4rem; /* .top-team-actions margin-bottom + h1 margin-top */
}

@media print {
    main {
        border-top: 1px solid var(--print-border-color);
    }

    .btn {
        border: 1px solid currentColor;
    }
}

@media screen {
    html {
        background-color: var(--page-bg-color);
    }

    main {
        display: table;
        min-width: 100%;
        box-sizing: border-box;
    }

    h1, h2, h3, h4 {
        color: var(--heading-text-color);
    }

    h1, h2 {
        text-transform: uppercase;
    }

    h3, h4 {
        border-bottom: 2px solid var(--border-color);
        font-weight: 700;
    }

    a {
        transition: color 0.3s;
    }

    a:hover,
    a:focus {
        color: var(--link-hover-color);
        text-shadow: 0 0 10px #b794f4aa;
    }

    .puzzle-main {
        background-color: var(--primary-900);
        padding: 20px 30px;
    }

    .puzzle-main h1, .puzzle-main h2, .puzzle-main h3, .puzzle-main h4 {
        background: none;
        border-left: none;
        padding: 0;
    }

    .btn {
        position: relative;
        transition: background-color 0.3s;

        color: var(--btn-text-color);
        background-color: var(--btn-bg-color);


    }

    .btn:hover,
    .btn:focus {
        color: var(--btn-text-color);
        background-color: var(--btn-hover-color);
    }

    .btn.danger {
        filter: hue-rotate(180deg);
    }

    .btn:disabled, .btn:disabled:hover, .btn.btn-disabled {
        background-color: var(--btn-bg-color);
        filter: grayscale(1);
        cursor: not-allowed;
    }

    nav {
        overflow: hidden;
        height: 50px;
        --text-color: var(--neutral-color);
    }

    .top-tabs {
        position: fixed;
        left: 0;
        width: 100%;
        z-index: 100;

        display: flex;
        white-space: nowrap;
        justify-content: space-between;
        font-size: 2rem;
        margin: 0 0 1.5rem 0;
        padding-bottom: 4px;
        line-height: 1;
        background-color: var(--info-bg-color);
        font-family: var(--accent-font);
        text-transform: uppercase;
        backdrop-filter: blur(0.5em);
    }

    .top-tabs a {
        display: inline-flex;
        position: relative;
        padding: 6px 20px;
        text-decoration: none;
        align-items: center;
    }

    .top-tabs .selected-tab {
        font-weight: bold;
        text-shadow: 0 0 10px var(--glow-color);
    }

    .top-more-actions {
        line-height: 32px;
        margin: 5rem 0 2rem 0;
    }

    .top-team-actions {
        margin-left: 5rem;
        display: flex;
        align-items: center;
    }

    .top-team-actions .team-name {
        max-width: 15em;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        display: block;
    }

    .top-more-actions, .top-team-actions {
        word-spacing: 12px;
    }

    .top-more-actions > *, .top-team-actions > * {
        word-spacing: initial;
    }

    .site-nav {
        display: flex;
        margin-right: 5rem;
    }

    .current-stat {
        white-space: nowrap;
        display: inline-block;
        text-decoration: none;
        vertical-align: bottom;
    }

    .current-stat-label {
        font-size: 2.4rem;
        vertical-align: bottom;
    }

    .shortcuts {
        background-color: var(--dropdown-bg-color);
        position: absolute;
        padding: 1rem 1rem 0;
        left: 100px;
        top: 48px;
        z-index: 800;
        display: none;
        color: var(--text-color);
        white-space: normal;
    }

    .shortcuts form {
        margin: 0;
    }

    .shortcuts p {
        width: 25rem;
        font-size: 1.5rem;
        line-height: 1.75rem;
        margin: 0 0 1rem;
    }

    .shortcuts .btn {
        margin-bottom: 1rem;
    }

    button#toggle-shortcuts {
        /* Make the button look like text. */
        padding: 0px;
        margin: 0px;
        height: auto;
        border: none;
        color: var(--body-text-color);
        text-transform: none;
        font-size: 17.5px;
        font-weight: 600;
        line-height: 32px;
        letter-spacing: 0px;
        overflow-wrap: break-word;
    }

    button#toggle-shortcuts:focus {
        outline: 5px auto Highlight;
        outline: 5px auto -webkit-focus-ring-color;
    }
}

@media screen and (max-width: 960px) {
    html {
        font-size: calc((960px - 100vw) / 80 + 10px);
    }

    body {
        width: calc(480px + 30vw);
    }

    .tray {
        display: flex;
        justify-content: space-between;
        position: fixed;
        margin: auto;
        left: 0;
        right: 0;
        transform: translateY(calc(5px - 100%));
        transition: transform .1s;
        z-index: 900;
        padding: 2rem calc(150vw - 1160px) 1rem;
    }

    .tray:before {
        content: "";
        text-align: center;
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: -100vh;
        bottom: -48px;
        padding-top: 90vh;
        background-color: var(--info-bg-color);
        color: var(--tray-text-color);
        backdrop-filter: blur(0.5em);
    }

    .tray:after {
        content: "\2630";
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        margin-top: -10px;
        padding-top: 10px;
        height: 64px;
        cursor: grab;
        color: var(--tray-text-color);
        text-align: center;
        font-size: 32px;
        line-height: 40px;
    }

    .top-team-actions, .top-team-actions #nav-team-name, .site-nav {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        flex-basis: 0;
        z-index: 0;
        align-items: start;
        gap: 0.5em;
    }

    .top-tabs {
        position: relative;
        margin: 0;
        font-size: calc((960px - 100vw) / 16 + 20px);
        background-color: initial;
        gap: 0.5em;
        backdrop-filter: none;
        padding-top: 32px;
    }

    .top-tabs a, .top-tabs .site-nav .dropdown-trigger button {
        padding: 0;
        line-height: 1.5;
    }

    .top-tabs .site-nav .dropdown-content a {
        padding: 0.5em 1em;
    }

    .top-more-actions a {
        line-height: 2;
        height: auto;
        font-size: calc((960px - 100vw) * 3 / 80 + 18px);
        margin-bottom: calc((960px - 100vw) * 3 / 40 + 12px);
    }

    .top-team-actions {
        margin-left: 0;
    }

    .site-nav {
        margin-right: 0;
        align-items: end;
    }

    .flavor {
        margin-left: calc(100vw - 800px);
        margin-right: calc(100vw - 800px);
    }

    a.main-content-anchor {
        top: calc(4rem - 64px); /* .top-team-actions margin-bottom + h1 margin-top - .tray:after height */
    }
}

@media screen and (max-width: 960px) and (any-hover: hover) {
    .tray:not(:hover) {
        transform: translateY(-100%);
    }

    .tray:focus-within {
        transform: none;
    }
}

@media screen and (max-width: 800px) {
    html {
        font-size: 12px;
    }

    body {
        width: min(calc(90vw + 100px), 100vw - 60px);
    }

    .tray {
        padding: 2rem calc((100% - 90vw) / 2) 1rem;
    }

    .top-tabs {
        font-size: 30px;
    }

    .top-more-actions a {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .flavor {
        margin-left: 0;
        margin-right: 0;
    }
}

.hunt-icon {
    vertical-align: bottom;
}

.btn .hunt-icon {
    vertical-align: -5px;
}

.list-table {
    min-width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.list-table td, .list-table th {
    padding: 4px 8px;
}

.list-table td:first-child, .list-table th:first-child {
    padding-left: 0;
}

.list-table td {
    word-break: break-word;
    overflow-wrap: anywhere;
    border-color: var(--border-color);
}

@media screen {
    .list-table th {
        border: none;
        position: sticky;
        top: 36px;
        background-color: var(--sticky-bg-color);
        box-shadow: inset 0 -2px 0 0 var(--border-color);
        z-index: 1;
    }
}

@media screen and (max-width: 960px) {
    .list-table th {
        top: 4rem;
    }
}

.form-section {
    margin: 4rem 0;
}

.form-row, .note {
    background-color: var(--accent-bg-color);
    border-left: 2px solid var(--border-color);
    padding: 1rem 2rem;
    margin: 1rem 0 1rem;
    position: relative;
}

.form-desc label {
    display: inline;
}

.form-row .delete-row {
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 2.4rem;
    text-decoration: none;
}

.dynamic-form:only-of-type .delete-row {
    display: none;
}

.info-row {
    display: flex;
    gap: 4%;
}

.info-row > div {
    font-size: 2rem;
    margin-bottom: 4rem;
    flex-grow: 1;
    flex-basis: 0;
}

.no-break {
    -webkit-column-break-inside: avoid; /* Chrome, Safari */
    page-break-inside: avoid;           /* Theoretically FF 20+ */
    break-inside: avoid;                /* IE 11 */
    display: table;                     /* Actually FF 20+ */
    width: 100%;
}

.submitted-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media print {
    .story-chunk {
        border-bottom: 1px solid var(--print-border-color);
    }
}

@media screen {
    .story-chunk {
        max-width: 600px;
        margin: 0 auto 3rem;
    }

    .story-chunk a {
        text-decoration: none;
    }
}

.flavor {
    margin-left: 22.5%;
    margin-right: 22.5%;
    text-align: center;
    font-style: italic;
}

.errorlist {
    padding: 1rem;
    list-style-type: none;
    color: var(--btn-text-color);
    text-shadow: 0 0 10px var(--glow-color);
    background-image: linear-gradient(-1deg, rgba(141, 45, 35, 0.8), rgb(194, 42, 25));

}

.errorlist li {
    margin-bottom: 0;
    list-style-type: none;
    text-indent: 0;
    padding-left: 0;
}

.solved-title-marker {
    font-size: 50%;
    color: var(--body-text-color);
}

.solved-title-answer {
    color: #4a2;
    font-family: var(--answer-font);
}

.stat-entry {
    font-weight: bold;
}

.stat-value {
    font-weight: normal;
}

.current-team {
    background-color: var(--btn-bg-color);
}

.meta-stats {
    font-style: italic;
}

.puzzle-erratum {
    color: #c32;
    margin-bottom: 1rem;
}

.hint-table {
    width: 100%;
}

.hint-table th, .hint-table td {
    border: none;
    padding: 0 15px;
}

.hint-table tr:first-child th, .hint-table tr:first-child td, .hint-table td[colspan] {
    padding-top: 12px;
}

.hint-table tr:last-child th, .hint-table tr:last-child td {
    padding-bottom: 12px;
}

.hint-table button {
    margin: 0;
}

.hint-table hr {
    border-color: currentColor;
    opacity: 0.25;
}

.hint-table .submitted-text, .hint-table textarea {
    font-size: 1.5rem;
    line-height: 2rem;
}

.hint-controls {
    margin-bottom: 2rem;
}

.hint-controls > :last-child {
    float: right;
}

.hint-controls form, .hint-controls input {
    margin: 0;
}

.puzzles-list {
    font-size: 2.4rem;
    width: 100%;
}

.puzzles-list a {
    text-decoration: none;
}

.puzzles-list h1 {
    text-align: left;
    margin: 0;
}

.puzzles-list th {
    border: none;
}

.puzzles-list tbody:not(:first-child) th {
    padding-top: 2em;
}

.puzzles-list td {
    border: none;
    padding-left: 0;
    padding-right: 0.5ch;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.puzzles-list td:first-child {
    width: 3rem;
    text-align: right;
    font-weight: bold;
}

.puzzles-list td:nth-child(3) {
    width: 0;
    white-space: nowrap;
}

.puzzles-list td:last-child {
    padding-right: 0;
}

.puzzles-answer {
    width: 20ch;
    max-width: 30vw;
}

.puzzles-answer > :first-child {
    border-bottom: 2px solid var(--border-color);
    font-family: var(--answer-font);
    font-weight: bold;
}

.puzzles-new {
    display: inline-block;
    font-size: 1.5rem;
    padding: 0 0.5rem;
    margin-right: 0.2rem;
    vertical-align: top;
    font-family: var(--accent-font);
    text-transform: uppercase;
}

@media screen {
    .puzzles-new {
        color: var(--btn-text-color);
        background-color: var(--btn-bg-color);
        transition: background-color 0.3s;
    }

    .puzzles-new:hover, a:hover .puzzles-new {
        color: var(--btn-text-color);
        background-color: var(--btn-hover-color);
    }
}

.puzzles-inner {
    font-size: 1.8rem;
}

.puzzles-inner b {
    font-size: 2.0rem;
}

@media screen {
    .spoiler.solved-title-answer {
        display: inline-block;
        min-width: 200px;
        text-align: left;
    }

    .spoiler:not(:hover) {
        background-color: currentColor;
        color: rgb(var(--accent-rgb));
    }
}

.copy-only {
    display: none;
}

.clipboard-button {
    border-radius: 50%;
    bottom: 1.5em;
    box-shadow: .1em .1em .5em var(--info-bg-color);
    font-size: 2em;
    height: 2.25em;
    position: fixed !important;
    right: 1.5em;
    width: 2.25em;
    z-index: 100; /* Needed so hover & click work even when button floats outside of its parent. */
}

@media print {
    .clipboard-button {
        display: none;
    }
}

@media screen {
    time[title] {
        text-decoration: underline dotted;
        text-underline-position: under;
        cursor: help;
    }
}

.chart {
    width: 100%;
    transform: scaleY(-1);
    margin-bottom: 2.4rem;
    position: relative;
    display: block;
    z-index: -1;
}

.chart-area {
    fill: var(--neutral-color);
    opacity: 0.5;
}

.chart-line {
    stroke: var(--accent-color);
    stroke-width: 0.25%;
    fill: none;
}

@media print {
    .chart {
        display: none;
    }
}

kbd {
    display: inline-block;
    padding: 0 0.25em;
    border: 1px solid var(--primary-200);
    border-radius: 0.25em;
    margin: 0.15em 0.2em;
    background-color: var(--primary-800);
}

footer {
    text-align: center;
    opacity: 0.5;
    font-size: 80%;
}

@media print {
    footer {
        display: none;
    }
}






.content {
    background-color: #fff;
    border: var(--green) 8px solid;
    padding-left: 20px;
    padding-right: 20px;
    color: var(--content-text-color);
}
.top-tabs a {
    color: var(--neutral-color);
}