@font-face {
    font-family: 'Playfair'; 
    src: url('Playfair.otf');
    font-weight: normal;
}
html {
    min-height:100vh;

    --page-bg-rgb: 32, 32, 32;
    --accent-rgb: 85, 119, 132;
    --link-rgb: 253, 236, 131;

    --white-color: #ececec;
    --neutral-color: #333;
    --accent-color: rgb(var(--accent-rgb));
    --accent-bg-color: rgba(var(--accent-rgb), 0.3);
    --accent-hover-color: #75a6ac;

    --bigsecret1-color: #3CBFD2; 
    --bigsecret2-color: #F9CD2F;
    --bigsecret3-color: #33AA48;
    --bigsecret4-color: #F7586B;
    --bigsecret5-color: #C040FF;
    --bigsecret6-color: #EF8B11;
    --bigsecret7-color: #577DF0;
    --bigsecret8-color: #A79F93;
    --bigsecret9-color: #14F0B9;
    --bigsecret10-color: #C557A6;

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

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

    --link-text-color: rgb(var(--link-rgb));
    --link-hover-color: var(--white-color);

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

    --tray-text-color: var(--white-color);
    --tray-bg-color: var(--accent-color);

    --text-font: 'Playfair', Fallback, serif;
    --btn-font: 'Playfair', Fallback, serif;
    --input-font: monospace;
    --answer-font: monospace;
} 

h1 {
    letter-spacing: 0.08rem;
}

h2 {
    letter-spacing: 0.04rem;
}


body {
    background-image: url('/static/images/backgrounds/bg_main.png');
    background-repeat: repeat;
    min-height: 100vh;
}

.body-content-wrapper {
    min-height: 100vh;
}

.body-content {
    font-family: var(--text-font);
    color: var(--white-color);
    font-variant-ligatures: none;
    font-feature-settings: "lnum";
    font-weight: medium;
    line-height: 2.3rem;
    font-size: 1.9rem;
    overflow-wrap: break-word;
    position: relative;
    min-height:calc(100vh - 30px);
    padding-bottom: 30px;    /* Footer height */
}

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

@media screen {
    .body-content {
        margin: 0 auto;
        width: 80%;
        width: 80vw;
        max-width: 960px;
    }
}

p {
    margin-bottom: 2rem;
}

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

ul > li {
    list-style-type: "\2013  ";
}

textarea {
    width: 100%;
    min-height: 24ch;
    font-family: var(--input-font);
    background: rgba(0,0,0,.4);
    color: #ececec;
    border: rgba(0,0,0,.4);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
}

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

main {
    position: relative;
    padding: 20px 30px;
    border-radius: 8px;
    background-color: rgba(32, 32, 32, 0.8);
    color: #ececec;
}

svg.hunt-icon {
    filter: invert(0.925);
}

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 {
    font-size: 80%;
    max-width: 1000px;
    overflow: scroll;
}

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-radius: 8px;
    border: none;
    font-family: var(--btn-font);
    text-transform: uppercase;

    padding: 0 16px;
    height: 32px;
    line-height: 32px;
    font-size: 2rem;
}

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);
    background: rgba(0,0,0,.4);
    color: #ececec;
    border: rgba(0,0,0,.4);
}

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-right-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 {
        text-align: center;
		background-color: var(--accent-bg-color);
        padding: 2rem;
        border-left: 25px solid var(--accent-color);
        border-right: 25px solid var(--accent-color);
        position: relative;
    }

    /* h3, h4 {
        text-decoration: underline;
    } */

    a {
        transition: color 0.3s;
    }

    a:hover,
    a:focus {
        color: var(--link-hover-color);
    }

    .puzzle-main {
        padding: 20px 30px;
        border-radius: 8px;
        background-color: rgba(32, 32, 32, 0.8);
        color: #ececec;
    }

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

    .btn {
        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;
        margin-top: -5px;
        font-family: var(--text-font);
        font-variant-ligatures: none;
        font-feature-settings: "lnum";
        font-weight: medium;
    }

    select{
        background: rgba(0,0,0,.4);
        color: #ececec;
        border: rgba(0,0,0,.4);
    }

    .top-tabs {
        padding-top: 5px;
        display: flex;
        white-space: nowrap;
        justify-content: space-evenly;
        font-size: 2rem;
        margin: 5px 0 1.5rem;
        padding-top: 5px;
        line-height: 1;
    }

    .navbar-coloring {
        background-color: rgb(var(--accent-rgb));
    }

    .top-tabs a {
        display: inline-flex;
        position: relative;
        padding: 6px 0 10px;
        text-decoration: none;
        align-items: center;
        color: var(--heading-text-color);
    }

    .top-tabs a:hover {
        text-decoration: underline;
    }

    .top-tabs .selected-tab {
        font-weight: bold;
    }

    .top-left-actions {
        float: left;
    }

    .inner-column {
        width: 60%;
        margin: auto;
    }

    .top-right-actions {
        float: right;
        min-height: 32px;
        margin-bottom: 1.5rem;
    }

    .top-left-actions, .top-right-actions {
        line-height: 32px;
        word-spacing: 8px;
    }

    .top-left-actions > *, .top-right-actions > * {
        word-spacing: initial;
    }

    .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 {
        border: 2px solid var(--tray-bg-color);
        background-color: rgba(32, 32, 32, 0.8);
        position: absolute;
        padding: 1rem 1rem 0;
        right: 60px;
        z-index: 800;
        display: none;
    }

    .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: #ececec;
        text-transform: none;
        font-size: 17.5px;
        font-weight: 600;
        line-height: 32px;
        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-content {
        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: 0;
        padding-top: 90vh;
        background-color: var(--tray-bg-color);
        color: var(--tray-text-color);
    }

    .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;
        background-image: linear-gradient(var(--tray-bg-color), var(--tray-bg-color));
        background-size: 100% 48px;
        background-repeat: no-repeat;
        background-origin: content-box;
    }

    .tray div {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        flex-basis: 0;
        z-index: 0;
    }

    .top-tabs {
        align-items: flex-start;
        justify-content: flex-start;
        margin: 0;
        font-size: calc((960px - 100vw) / 16 + 20px);
    }

    .top-left-actions {
        align-items: flex-end;
    }

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

    .top-right-actions {
        float: none;
        text-align: center;
        padding-top: 64px;
    }

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

    a.main-content-anchor {
        top: calc(4rem - 64px); /* .top-right-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-content {
        width: 90vw;
    }

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

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

    .top-left-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 {
    word-break: break-word;
    overflow-wrap: anywhere;
    border-color: var(--border-color);
}

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

@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 {
    margin-bottom: 2.4rem;
}

.info-desc p:last-child {
    margin-bottom: 0;
}

@media screen {
    .info-row > div {
        border: 2px solid var(--border-color);
    }

    .info-row h4 {
        margin: 0;
		text-align: center;
        background-color: var(--border-color);
        color: var(--btn-text-color);
        border: none;
    }

    .info-desc {
        font-size: 2rem;
        padding: 1rem 2rem;
    }
}

@media print, (min-width: 961px) {
    .info-row {
        display: flex;
        gap: 4%;
    }

    .info-row > div {
        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 {
        margin: 0 auto 3rem;
    }

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

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

.errorlist {
    padding: 1rem;
    border: 3px solid currentColor;
    list-style-type: none;
    color: #b21;
    background-color: var(--white-color);
}

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

.solved-title-marker {
    letter-spacing: 0.04rem;
    font-size: 50%;
    color: #ececec;
}

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

.ansnotif {
    font-family: var(--answer-font);
    font-size: 115%;
}

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

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

.current-team {
    font-weight: bold;
}

.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: clamp(16px, 3vw, 24px);
    line-height: clamp(16px, 3vw, 24px);
    width: 100%;
}

.puzzles-list h1 {
    font-size: clamp(30px, 5.5vw, 44px);
    line-height: clamp(30px, 5.5vw, 44px);
}

.puzzles-inner {
    font-size: clamp(10px, 2vw, 16px);
    line-height: clamp(10px, 2vw, 16px);
}

.puzzles-inner b {
    font-size: clamp(11.5px, 2.25vw, 18px);
    line-height: clamp(11.5px, 2.25vw, 18px);
}

.puzzles-section {
    border-radius: 50px;
}
.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, .puzzles-list td:last-child {
    width: 2rem;
    text-align: right;
    font-weight: bold;
}

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

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

.puzzles-answer > :first-child {
    font-family: var(--answer-font);
}

.puzzles-new {
    display: inline-block;
    font-size: clamp(10px, 2vw, 16px);
    line-height: clamp(14px, 2.75vw, 22px);
    padding: 0 clamp(3px, 0.625vw, 5px);
    vertical-align: top;
    font-family: var(--btn-font);
    text-transform: uppercase;
    border-radius: clamp(5px, 0.875vw, 7px);
}

@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);
    }
}

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

    .spoiler:not(:hover) {
        background-color: currentColor;
        color: inherit;
    }
}

.puzzle .copy-only {
    display: none;
}

#clipboard-button:not(.shown) {
    display: none;
}

.clipboard-button {
    border-radius: 1em;
    bottom: 1.5em;
    cursor: pointer;
    font-size: 1em;
    height: 2em;
    padding: 0 0.8em;
    position: fixed !important;
    right: 1.5em;
    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;
        text-underline-offset: -0.1em;
    }
}

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

.chart-area {
    fill: #ECECEC;
    opacity: 0.5;
}

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

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

footer {
    text-align: center;
    opacity: 0.5;
    font-size: 80%;
    position: absolute;
    bottom:0;
    left:0;
    right:0;
    height: 30px;
    z-index: 2;
}

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

.dialogue {
    position: absolute;
    bottom: 25px;
    left: 50%;
    width: 100%;
    transform: translateX(-50%);
    z-index: 10000;
    justify-content: center;
    text-align: center;
}

.dialog-options {
    width: 50%;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: auto;
    margin-top: 10px;
    font-size: 3.2vmin;
    line-height: 3vmin;
    align-items: stretch;
    font-weight: bold;
}

.dialog-option {
    background-color: #5E3583;
    cursor: pointer;
    padding: 10px;
}

.dialog-option:hover {
    outline: 3px solid white;
}

.dialog-box {
    margin: auto;
    pointer-events: none;
    background-color:rgba(0,0,0,0.8);
    color:white;
    width:60%;
    max-height: 20%;
    min-height: 20%;
    outline: 2px dotted white;
    bottom: 25px;
    z-index:10000;
    padding-inline: 10px;
    padding-block: 10px;
    display: flex;
    align-items:center;
    word-wrap: break-word;
}

.dialog-box-puzzle {
    margin: auto;
    pointer-events: none;
    background-color:rgba(0,0,0,0.8);
    color:white;
    width:90%;
    max-height: 20%;
    min-height: 20%;
    outline: 2px dotted white;
    bottom: 25px;
    z-index:10000;
    padding-left: 20px;
    padding-block: 10px;
    display: flex;
    align-items:center;
    word-wrap: break-word;
}

.ghost {
    cursor: pointer;
}

.dialog-image {
    align-items: center;
    justify-content: center;
    height: 10vmin;
    margin: auto;
    max-width: 100%;
    margin-left: 0px;
    margin-right: 5px;
}

.dialog-box-puzzle .dialog-image {
    height: 8rem;
}


.dialog-text {
    font-size: 3.2vmin;
    line-height: 3vmin;
    text-align: left;
    margin-inline: 10px;
}

.dialog-box-puzzle .dialog-text {
    font-size: 2.4rem;
    line-height: 2.25rem;
    text-align: left;
    margin-inline: 10px;
}

.nav-box {
    position: relative;
    width: 75%;
    margin: auto;
}

.darken-bg {
    /* Fallback color */
    background-color: rgb(0, 0, 0);

    /* Black w/opacity/see-through */
    background-color: rgba(32, 32, 32, 0.8);
}

.lighten-bg {
    /* Fallback color */
    background-color: rgb(255, 255, 255);

    /* White w/opacity/see-through */
    background-color: rgba(255, 255, 255, 0.2);
}

.blur-bg {
    backdrop-filter: blur(2px);
}

.top-right-actions {
    color: #ececec;
}

.toast {
    font-family: 'Playfair';
}

.puzzles-list {
    border: 2px solid var(--border-color);
    background-color: rgba(32,32,32,0.8);
    border-radius: 16px;
    border-collapse: separate;
}

.puzzles-list h1 {
    letter-spacing: 0;
    background-color:rgba(0, 0, 0, 0);
    border: none;
    padding: 1rem;
}

.puzzles-list tbody th {
    border-radius: 11px 11px 0px 0px;
    border-left: 25px solid var(--accent-color);
    border-right: 25px solid var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    background-color: var(--accent-bg-color);
}

.puzzles-list tr:not(:last-child) td:not(:last-child):not(:first-child) {
    border-bottom: 1px solid var(--accent-color);
}

.puzzles-list td:nth-child(2) {
    padding-left: clamp(4px, 0.75vw, 6px);
}

.puzzles-section tr:first-child td {
    padding-top: clamp(13px, 2.5vw, 20px);
}

.puzzles-section tr:last-child td {
    padding-bottom: clamp(13px, 2.5vw, 20px);
}

#android-chrome {
    display: none;
}