body {
    font-family: sans-serif;
    font-variant-ligatures: none;
    line-height: 2.6rem;
    font-size: 1.75rem;
    overflow-wrap: break-word;
    position: relative;
}

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

@media screen {
    html {
        background-image: linear-gradient(#111, #111);
        background-size: 100% 40px;
        background-repeat: no-repeat;
    }

    body {
        margin: 0 auto 60px;
        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: disc;
}

textarea {
    width: 100%;
    min-height: 24ch;
    font-family: monospace, monospace;
}

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

h1 {
    margin-top: 1.5rem;
    text-align: center;
    font-weight: 600;
}

h2 {
    margin: 4rem 0;
}

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

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

a, .btn {
    color: #05a;
}

.btn {
    display: inline-block;
    padding: 0 20px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0;
    border: none;
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;

    height: 30px;
    line-height: 30px;
    font-size: 1.5rem;
}

form .btn {
    height: 38px;
    line-height: 38px;
    font-size: 1.75rem;
}

input[type=text], input[type=password], input[type=email] {
    width: 100%;
    border-radius: 0;
}

figcaption {
    text-align: center;
}

@media (min-width: 961px) {
    label {
        text-align: right;
        height: 2em;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    /* normally the label is right-aligned because it's in a column inside a
     * row and left of the corresponding input, but sometimes it's just by
     * itself in a row above the input (hints page) */
    .row > label {
        text-align: left;
        justify-content: flex-start;
    }
}

@media print {
    main {
        border-top: 1px solid #111;
    }

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

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

    h1, h2, h3, h4 {
        color: #05a;
    }

    a {
        transition: color 0.3s;
    }

    a:hover,
    a:focus {
        color: #2af;
    }

    .btn {
        transition: background-color 0.3s;
        color: #f9f8f5;
        background-color: #05a;
    }

    .btn:hover,
    .btn:focus {
        color: #f9f8f5;
        background-color: #2af;
    }

    nav {
        overflow: hidden;
    }

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

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

    .top-tabs a:hover,
    .top-tabs a:focus {
        color: #2af;
    }

    .top-tabs .selected-tab {
        font-weight: 700;
    }
	
	.actions-container {
		display: flex;
		align-items: center;
		margin-bottom: 1.5rem;
	}

    .top-left-actions {
        float: left;
    }
	
	.top-middle-actions {
		flex: 1;
		text-align: center;
	}

    .top-right-actions {
        min-height: 36px;
		position: absolute;
		right: 0%;
    }

    .top-left-actions, .top-right-actions {
        line-height: 36px;
        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: middle;
    }

    .shortcuts {
        border: 4px double #111;
        background-color: white;
        position: absolute;
        padding: 1rem;
        right: 60px;
        min-width: auto;
        z-index: 800;
        display: none;
    }

    .shortcuts form {
        margin: 0;
    }

    #shortcuts {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    [for=shortcuts] {
        display: inline;
        cursor: pointer;
    }

    [for=shortcuts]:after {
        content: "\25BC";
    }

    :checked ~ nav [for=shortcuts]:after {
        content: "\25B2";
    }

    :checked ~ .shortcuts {
        display: block;
    }
}

@media screen and (max-width: 960px) {
    html {
        background-image: none;
        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: "This is not a puzzle.";
        text-align: center;
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: -100vh;
        bottom: 0;
        padding-top: 90vh;
        background-color: #111;
        color: #f9f8f5;
    }

    .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: #f9f8f5;
        text-align: center;
        font-size: 32px;
        line-height: 40px;
        background-image: linear-gradient(#111, #111);
        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);
    }
}

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

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

    body {
        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: middle;
}

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

.gph-list-table td, .gph-list-table th {
    padding: 4px 8px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media screen {
    .gph-list-table th {
        border: none;
        position: sticky;
        top: 0;
        background-color: white;
        box-shadow: inset 0 -1px 0 0 #111;
    }
}

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

.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 #111;
    }
}

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

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

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

.form-section {
    margin-top: 20px;
    margin-bottom: 40px;
}

.team-members-formset .delete-row {
    float: right;
}

.errorlist {
    padding: 10px;
    border: 3px solid currentColor;
    list-style-type: none;
    color: #b21;
    background-color: #eee;
}

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

.team-info-panel, .call-in-answer-panel, .solved-panel, .puzzle-stats-panel {
    margin-bottom: 24px;
}

.call-in-answer-panel:last-child {
    margin-bottom: 0;
}

.call-in-answer-panel .row {
    margin: 1em 0;
}

.call-in-answer-panel .errorlist {
    margin-bottom: 0;
}

.solved-panel {
    color: #4a2;
}

.unsolved-panel {
    color: #c32;
}

.solved-title-marker {
    font-size: 50%;
    color: initial;
}

.solved-title-answer {
    color: #4a2;
}

.stat-entry {
    font-size: 2rem;
}

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

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

.puzzle-erratum {
    color: #c32;
    margin-bottom: 10px;
}

.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 {
    display: flex;
    flex-wrap: wrap;
}

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

.puzzles-entry, .puzzles-spacer {
    flex-grow: 1;
    margin: 0 20px;
    width: 280px;
    box-sizing: border-box;
}

.puzzles-entry {
    margin: 20px;
    border: 2px solid #111;
    position: relative;
    padding: 20px;
    text-align: center;
}

.puzzles-link, .puzzles-new, .puzzles-answer, .puzzles-solution {
    position: absolute;
    line-height: 24px;
    background-color: white;
    padding: 4px 8px;
}

.puzzles-link { top: -16px; left: -12px; font-size: 2rem; }
.puzzles-new { top: -16px; right: -12px; color: #ae4160; }
.puzzles-answer { bottom: -16px; right: -12px; }
.puzzles-solution { bottom: -16px; left: -12px; }

.puzzles-meta {
    border-style: dotted;
}

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

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

.note {
    border: 1px solid #ae4160;
    padding: 0.5em;
    margin-bottom: 2em;
}

.note strong {
    color: #ae4160;
}

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

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

.copy-only {
    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;
}

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

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

.chart {
    width: 100%;
    height: 82px;
    transform: scaleY(-1);
    margin-bottom: 24px;
    position: relative;
    z-index: -1;
}

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

.chart-line {
    stroke: #ae4160;
    stroke-width: 0.25%;
    fill: none;
}

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

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

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

.pdf-link {
    float: right;
}

.copyable-sheet-link {
    float: left;
}