:root {
    /* Transparencies */
    --trans-50: rgba(0, 0, 0, 0.5);
    --trans-80: rgba(0, 0, 0, 0.8);

    /* Sponsor-specific gradients */
    --degree: 0deg;
    --basic-gradient: linear-gradient(var(--degree), #EACDA3, #D6AE7B);
    --special-gradient: linear-gradient(var(--degree), #FF0000, #FDCF58);
    --silver-gradient: linear-gradient(var(--degree), #70706F, #C0C0C0, #E3E3E3);
    --gold-gradient: linear-gradient(var(--degree), #A57C01, #B79001, #FFDF01);
    --soft-light: linear-gradient(var(--degree), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35));
}
@font-face {
    font-family: 'dejavu_sans_monobook';
    src: url('DejaVuSansMono-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* Base layout + typography */
html, body {
    background-color: var(--b-main);
    color: var(--t-main);
    font-family: "Roboto Mono", monospace;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: medium;
    margin: 0;
}

.material-symbols-outlined {
    font-size: 10px;
}

a {
    color: var(--t-link);
    text-decoration: none;
    text-shadow: none;
    width: max-content;
}

/* Accessibility skip link */
.skip-link {
    left: 0;
    padding: 10px;
    position: absolute;
    top: -100px;
    z-index: 1;

    &:focus {
        top: 0;
    }
}

/* Headings / text utilities */
h1 {
    margin: 0;
}

h2 {
    border-bottom: 2px solid var(--t-main);
}

h3 {
    color: var(--c-main);
}

.center {
    text-align: center;
}

.icon {
    vertical-align: middle;
}

.main {
    color: var(--c-main);
    width: calc(100% - 20px);
}

.on {
    color: var(--i-on);
}

.off {
    color: var(--i-off);
}

.b {
    color: var(--t-focus);
    font-weight: bold;
    text-shadow: 0 0 0.1em var(--t-focus-shadow);
}

.i {
    font-style: italic;
}

.u {
    text-decoration: underline;
}

.cross {
    text-decoration: line-through;
}

.lg {
    font-size: larger;
}

.sm {
    font-size: small;
}

.ssm {
    font-size: x-small;
}

.false-link {
    color: var(--t-link);
    text-shadow: none;
}

/* Reusable small helpers */
.hint-label {
    margin-bottom: 0;
}

.hint {
    background-color: var(--b-code);
    color: var(--b-code);
    height: 10px;
    margin-top: 0;
    overflow: hidden;
    transition: height 1.5s ease 1s, color 1.5s linear 1s;

    &:hover {
        color: var(--t-main);
        height: fit-content;
    }
}

/* Sections and page layout */

hr {
    border-color: var(--t-focus);
}

section {
    margin: 16px;
}

header {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 5px;
    text-align: center;
}

header.section {
    position: sticky;
    top: 54px;
    z-index: 10;
}

.section {
    background: var(--b-sec);
    border: 32px solid transparent;
    color: var(--t-main);
    filter: drop-shadow(0 2px 3px var(--trans-80));
    padding: 5px 16px;
    position: relative;
    z-index: 1;

    &::before, &::after {
        border: 32px solid transparent;
        content: "";
        pointer-events: none;
        position: absolute;
    }
}

/* Containers */
.img-container, .logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto;
    max-width: fit-content;

    img {
        display: block;
        max-width: 100%;
        height: auto;
        width: auto;
    }
}

.logo-container img {
    max-height: 500px;
}

.img-container img {
    max-height: 400px;
}

.logo-container {
    box-shadow: 2px 2px 22px 0 var(--t-main);
}

.shadow {
    box-shadow: 0 0 10px var(--trans-50);
}

.pad {
    padding: 10px;
}

/* Grid / tables / helpers */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.container-item {
    margin: 5px;
}

.column {
    padding: 10px;

    &:first-child {
        width: max-content;
    }

    &:last-child {
        width: 40%;
        flex-grow: 1;
    }
}

.spacer {
    display: block;
    margin: max(25px, 1vw);
}

.keyitem {
    box-sizing: border-box;
    height: 100px;
    margin-top: 10px;
    width: 50%;
}

#help {
    margin: 0 0 -20px;
    max-width: 850px;
    width: calc(100% - 40px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 20px;

    a {
        display: flex;
        align-items: center;
        gap: 8px;
    }
}

/* Table */
caption {
    border: 1px dashed var(--t-main);
    border-bottom: none;
    color: var(--t-focus);
    font-weight: bold;
    font-style: italic;

    &.shift {
        color: var(--t-link);
    }
}

table {
    border-collapse: collapse;
}

th, td, tr {
    border-color: var(--t-main);
    border-width: 1px;
    padding: 5px;
    text-align: center;
    border-style: solid;
}

td {
    border-left-style: solid;
    border-right-style: solid;

    &.select {
        background-color: var(--t-link) !important;
    }

    &.cross {
        color: #396a39;
    }

    &.red {
        background-color: red !important;
        color: var(--t-nav) !important;
    }
}

/* Easter Egg */
.egg {
    color: var(--c-final);
}

/* Responsive tweaks */
@media (max-width: 900px) {
    h1 {
        font-size: large;
    }

    .section::before {
        border: 16px solid transparent;
    }
}

@media (max-width: 600px) {
    td {
        font-size: x-small;
    }

    tr > th:nth-child(odd) {
        max-width: 20px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sm {
        font-size: x-small;
    }

    .spacer {
        margin: 0;
    }
}
/* Inputs, buttons, dialogs, code display blocks */
input {
    background: var(--b-main);
    border: 1px solid var(--c-main);
    color: var(--c-main);
    font-size: large;
    margin: 0;
    padding: 0 2px;
    box-sizing: border-box;

    &::placeholder {
        color: var(--c-main);
    }

    &:focus {
        border-width: 2px;
        outline: none;
    }
}

.input {
    width: 400px;
}

.right {
    margin: 20px;
    max-width: 800px;
    text-align: right;
}

button {
    background: none;
    border: none;
    white-space: nowrap;
    color: var(--t-focus);
    font-family: "Roboto Mono", monospace;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;

    &::before {
        font-size: 1.5em;
        content: "{ ";
    }

    &::after {
        font-size: 1.5em;
        content: " }";
    }
}

.access-button {
    cursor: pointer;
}

/* Code blocks */
.code {
    background-color: var(--b-code);
    border: none;
    display: block;
    font-family: "DejaVu Sans Mono", monospace;
    font-size: large;
    font-weight: bold;
    margin-bottom: 10px;
    margin-top: 5px;
    max-height: 100px;
    max-width: 400px;
    overflow: hidden;
    padding: 5px 10px;
    text-overflow: ellipsis;
    width: fit-content;
    word-wrap: break-word;

    &.attach {
        margin-top: -10px;
        text-align: left;
    }

    &.free {
        max-height: none;
        max-width: none;
    }

    &.sm {
        font-size: small;
    }

    &.part.main {
        width: fit-content;
    }
}

.part {
    display: inline-flex;
    margin: 2px;
    max-width: 100%;
    padding: 2px;
}

.mono {
    font-family: "DejaVu Sans Mono", monospace !important;
}

/* Dialogs */
dialog {
    background-color: var(--b-code);
    border: 1px solid var(--c-main);
    border-radius: 10px;
    box-shadow: 0 0 1500px 1500px rgba(0, 0, 0, 0.8);
    color: var(--c-main);
    height: 100px;
    left: 20px;
    overflow: hidden;
    padding: 20px;
    position: fixed;
    text-align: center;
    top: 200px;
    width: 300px;
    z-index: 100;

    &.end {
        background-color: transparent !important;
        border: none !important;
        height: 800px;
        left: 0;
        outline: none !important;
        padding: 0;
        top: calc(50vh - 400px);
        width: 800px;
    }
}

/* Shimmer section */
.shimmer {
    --offset: 1px;
    border-radius: 10px;
    box-shadow: 0 0 10px var(--c-main), inset 0 0 10px var(--c-main);
    height: 30px;
    margin-top: 30px;
    width: 100%;
    overflow: hidden;
    padding: 20px 10px 40px 10px;
    position: relative;

    form {
        border-radius: inherit;
        inset: 0;
        margin: 3px;
        position: absolute;
        z-index: 10;
    }

    input {
        width: calc(100% - 180px);
    }
}

.shimmer.short {
    height: 0;
}

.form-box {
    margin: 10px;
}

/* Image helpers */
img {
    max-height: 400px;
    width: 60%;
    height: auto;
}

.fill {
    height: 80%;
    max-height: none;
    width: 80%;
}

.vsmallpic {
    width: 50px;
}

.smallpic {
    width: 150px !important;
}

.midspic {
    width: 220px;
}

.midpic {
    width: 285px !important;
}

.midlargepic {
    width: 500px;
}

.widepic {
    max-height: 80px;
    max-width: 60vw;
    height: auto;
    width: auto;
}

/* Navbar */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 0;
    background: var(--b-sec);
    color: var(--t-nav);
}

.nav {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    gap: 5%;
    height: 30px;
}

.nav a, .nav .false-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--t-nav);
    text-decoration: none;
    font-weight: bold;
    transition: filter 0.15s ease;

    &:hover {
        filter: saturate(10);
    }
}

.nav a:hover img {
    filter: saturate(0.05);
}

.nav img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: block;
}

/* User menu (hover swap) */
.user-menu {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;

    span {
        user-select: none;
    }

    .user-action {
        display: inline-flex;
        opacity: 0;
        color: var(--t-nav-special);
        transition: opacity 0.15s ease;
    }

    &:hover {
        .user-action {
            opacity: 1;
        }
    }
}

/* Dropdown */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--b-sec);
    border-radius: 4px;
    display: none;
    width: 100%;
    min-width: 3em;
    filter: saturate(0.1) !important;
    box-sizing: border-box;
    z-index: 1001;

    a {
        display: block;
        text-decoration: none;
        text-align: center;
        width: 100%;
        padding: 0.25em 0;

        &:hover {
            color: var(--t-nav);
        }

        p {
            margin: 5px 0;
        }
    }
}

/* Year menu reveals dropdown */
.year-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--t-main);
    padding: 5px;

    &:hover {
        .dropdown {
            display: block;
        }
    }
}

/* responsive helper */
@media (max-width: 900px) {
    .nav-text {
        display: none;
    }
}
/* Sponsor */

.tiers {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

.explorer-name {
    font-weight: bold;
    margin: 10px 0 0 0;
}

.tier {
    height: 50px !important;
}

/* Keys */
.tier1-key, .tier1plus-key, .tier2-key, .tier3-key {
    color: black;
}

.tier1-key {
    background: var(--soft-light), var(--basic-gradient);
}

.tier1plus-key {
    background: var(--soft-light), var(--special-gradient);
}

.tier2-key {
    background: var(--soft-light), var(--silver-gradient);
}

.tier3-key {
    background: var(--soft-light), var(--gold-gradient);
}

/* Tier boxes with decorative ::before ring */
.tier1-box, .tier2-box, .tier3-box {
    position: relative;
    margin: 0.5em 0 2em 0;
    min-height: 50px;
    border-radius: 20px;
    padding: 1.5em 1em;
    box-sizing: border-box;

    &::before {
        content: "";
        position: absolute;
        inset: 0;
        padding: 3px;
        border-radius: inherit;
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask-composite: exclude;
        pointer-events: none;
    }
}

.tier1-box {
    &::before {
        background: var(--special-gradient);
    }
}

.tier2-box {
    &::before {
        background: var(--silver-gradient);
    }
}

.tier3-box {
    &::before {
        background: var(--gold-gradient);
    }
}

/* Lists inside tiers */
.tier1-lists, .tier2-lists, .tier3-lists {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tier1-lists {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.tier2-lists {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Badges */
.pathfinder, .wayfarer, .explorer {
    text-align: center;
    border-radius: 30px;
    color: black;
}

.pathfinder, .wayfarer {
    width: 150px;
    height: 50px;
}

.pathfinder {
    background: var(--soft-light), var(--special-gradient);
}

.wayfarer {
    background: var(--soft-light), var(--basic-gradient);
}

.explorer {
    width: 300px;
    padding: 1rem;
    background: var(--soft-light), var(--soft-light), var(--silver-gradient);
}

.pathfinder a, .explorer p {
    color: black;
    text-decoration: underline;
}

/* Images */
.img-2, .img-3 {
    height: auto;
    width: auto;
}

.img-2 {
    max-width: 200px;
    max-height: 80px;
}

.img-3 {
    max-width: 300px;
    max-height: 120px;
}

/* Tier 3 layout */
.tier3-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--soft-light), var(--soft-light), var(--gold-gradient);

    .box-a, .box-b, .box-c {
        padding: 8px;
        max-width: 100%;
        color: black;
    }

    .box-b, .box-a {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .box-b {
        font-size: x-large;
        font-weight: bold;
    }
}

@media (min-width: 768px) {
    .tier3-layout {
        grid-template-columns: 1fr 300px;
        grid-template-rows: auto auto;

        .box-a {
            grid-column: 2;
            grid-row: 1 / span 2;
            width: 300px;
            max-width: 100%;
            padding: 0 20px 0 0;
        }

        .box-b {
            grid-column: 1;
            grid-row: 1;
            padding: 20px 0 5px 20px;
        }

        .box-c {
            grid-column: 1;
            grid-row: 2;
            padding: 5px 0 20px 20px;
        }
    }
}