:root {
    --stock: #faf6ef;
    --ink: #1a140c;
    --plate: #f2d325;
    --brand: #1c7c3a;
    --brand-deep: #145c2b;
    --surface-muted: #f2eee6;
    --brand-soft: rgba(28, 124, 58, 0.12);
    --shadow-sharp: 5px 5px 0 var(--ink);
    --display: "DM Serif Display", Georgia, serif;
    --display-weight: 400;
    --text-face: "Source Sans 3", sans-serif;
    --navbar-height: 4.75rem;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--text-face);
    font-weight: 400;
    line-height: 1.55;
    min-height: 100vh;
    background: var(--brand);
    color: var(--ink);
}

a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--brand-deep);
}

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

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

canvas,
#myChart {
    max-width: 100%;
    height: auto;
    background: transparent;
}

.section {
    padding: 1.5rem 1.5rem 3rem;
}

.container {
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
}

.hero {
    padding: 1.25rem 0 0;
    background: transparent;
}

.hero-body {
    padding: 0 1.5rem;
}

.hero-body > .container {
    background: var(--stock);
    border: 2px solid var(--ink);
    padding: 1.6rem 1.5rem 1.7rem;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 1.25rem 1.75rem;
    align-items: center;
}

.hero-layout > .title-xl {
    margin: 0;
    font-size: clamp(1.9rem, 3vw, 2.7rem);
    line-height: 1.08;
}

.hero-era {
    display: block;
    margin-top: 0.35rem;
}

.hero-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-decoration: none;
    color: var(--ink);
    background: var(--stock);
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-sharp);
}

.hero-card:hover {
    color: var(--ink);
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0 var(--ink);
}

.hero-card:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 3px;
}

.hero-card-id {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 4.75rem;
    padding: 0.4rem 1rem 0.4rem 0.4rem;
    background: var(--plate);
    border-bottom: 2px solid var(--ink);
}

.hero-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    line-height: 1.15;
    font-family: var(--display);
    font-size: clamp(1.15rem, 2.6vw, 1.7rem);
    color: var(--ink);
}

.hero-more {
    font-size: 0.82em;
    white-space: nowrap;
}

.hero-card:hover .hero-more {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hero-card-chart {
    position: relative;
    display: block;
    height: clamp(176px, 20vw, 210px);
    padding: 0.4rem 0.25rem 0.05rem;
}

.title {
    font-family: var(--display);
    font-weight: var(--display-weight);
    font-size: 1.7rem;
    line-height: 1.15;
    color: inherit;
    margin: 0 0 0.75rem;
}

.title-xl {
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    line-height: 1.12;
}

.player-pos {
    font-family: var(--display);
    font-weight: var(--display-weight);
    font-size: 1.45rem;
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

.subtitle {
    margin: 0.35rem 0 1rem;
    font-family: var(--text-face);
    font-weight: 600;
    color: rgba(26, 20, 12, 0.75);
}

.navbar {
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0 1rem;
    background: var(--stock);
    border-bottom: 2px solid var(--ink);
    position: sticky;
    top: 0;
    z-index: 30;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
}

.logo {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.5rem;
    font-family: var(--display);
    font-size: 1.35rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: var(--display-weight);
    color: var(--ink);
    text-decoration: none;
}

.logo:hover {
    color: #3f3a34;
}

.navbar-search {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0.65rem 0.5rem;
}

.input {
    font: inherit;
    font-family: var(--text-face);
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--ink);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    width: 100%;
}

.input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

#results {
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    top: calc(100% - 0.15rem);
    background: var(--stock);
    color: var(--ink);
    max-height: 16rem;
    overflow-y: auto;
    border: 2px solid var(--ink);
    z-index: 20;
    padding: 0;
}

#results[hidden] {
    display: none;
}

#results a {
    color: var(--ink);
    display: block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border-bottom: 1px solid var(--ink);
    font-family: var(--text-face);
}

#results a:hover {
    background: var(--surface-muted);
    color: var(--ink);
}

#results a:last-child {
    border-bottom: none;
}

.panel {
    background: var(--stock);
    border: 2px solid var(--ink);
    padding: 1.25rem;
}

.panel > .title {
    margin: 0 0 0.35rem;
    padding: 0;
}

.columns {
    display: flex;
    flex-wrap: wrap;
}

.column {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.75rem;
}

.column-wide {
    flex: 0 0 60%;
}

@media (max-width: 1100px) {
    .columns-stack > .column {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .column-wide {
        flex: 1 1 100%;
    }
}

.column:has(.card-frame) {
    flex: 0 0 340px;
    max-width: 340px;
    align-items: center;
}

.column:has(.card-frame) + .column {
    flex: 1 1 0;
    min-width: 0;
}

.table-scroll {
    overflow: visible;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    border-radius: 0;
    font-variant-numeric: tabular-nums;
}

.table th,
.table td {
    padding: 0.45rem 0.7rem;
    text-align: left;
    border-bottom: 1px solid rgba(26, 20, 12, 0.14);
    white-space: nowrap;
}

.table td:has(a) {
    white-space: normal;
}

.table a {
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
}

.table th.num,
.table td.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.table th {
    font-family: var(--text-face);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(26, 20, 12, 0.62);
    background: var(--stock);
    border-bottom: 2px solid var(--ink);
    position: sticky;
    top: var(--navbar-height);
    z-index: 5;
}

.table tr:hover td {
    background: rgba(26, 20, 12, 0.04);
}

.js-sort-table thead tr > th:not(.js-sort-none),
.js-sort-table tr:first-child > th:not(.js-sort-none) {
    cursor: pointer;
    padding-left: 1.45rem;
}

.js-sort-table thead tr > th:not(.js-sort-none)::after,
.js-sort-table tr:first-child > th:not(.js-sort-none)::after {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid rgba(26, 20, 12, 0.45);
}

.js-sort-table thead tr > th.num:not(.js-sort-none),
.js-sort-table tr:first-child > th.num:not(.js-sort-none) {
    padding-left: 0.55rem;
    padding-right: 1.35rem;
}

.js-sort-table thead tr > th.num:not(.js-sort-none)::after,
.js-sort-table tr:first-child > th.num:not(.js-sort-none)::after {
    left: auto;
    right: 0.35rem;
}

.js-sort-asc thead tr > .js-sort-active:not(.js-sort-none)::after,
.js-sort-asc tr:first-child > .js-sort-active:not(.js-sort-none)::after {
    border-top-color: var(--ink);
}

.js-sort-desc thead tr > .js-sort-active:not(.js-sort-none)::after,
.js-sort-desc tr:first-child > .js-sort-active:not(.js-sort-none)::after {
    border-top: none;
    border-bottom: 6px solid var(--ink);
}

#frontLink,
#frontLink:hover {
    text-decoration: none;
    color: var(--ink);
}

.hero-card-id {
    color: var(--ink);
    font-family: var(--display);
}

img.thumb {
    filter: contrast(115%) brightness(120%) saturate(110%);
    flex: 0 0 auto;
    height: 76px;
    width: 54px;
    border: 2px solid var(--ink);
    margin: 0;
    background: var(--ink);
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease-in-out;
}

img.thumb.is-visible {
    opacity: 1;
    visibility: visible;
}

.table td img {
    display: inline-block;
    vertical-align: middle;
    min-width: 16px;
}

.table td:first-child {
    white-space: nowrap;
    width: auto;
}

.card-frame {
    background-color: var(--stock);
    padding: 12px;
    width: 280px;
    border: 3px solid var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    position: relative;
}

.card-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url(../img/dust.png);
    background-size: cover;
    pointer-events: none;
    opacity: 60%;
    z-index: 10;
}

img.card-photo {
    filter: contrast(120%) brightness(130%) saturate(115%);
    border: 2px solid var(--ink);
    object-fit: cover;
    object-position: 0 0;
    width: 240px;
    height: 360px;
    display: block;
}

.card-caption {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    text-align: center;
    line-height: 1.15;
    height: 48px;
    width: 240px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--display-weight);
    font-family: var(--display);
    font-size: clamp(8px, calc(210px / (var(--name-len, 12) * 0.74)), 26px);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--ink);
    background-color: var(--plate);
    white-space: nowrap;
    overflow: hidden;
    border: 2px solid var(--ink);
    box-sizing: border-box;
    z-index: 5;
}

.footer {
    padding: 2.5rem 1.5rem;
    background: var(--stock);
    color: var(--ink);
    border-top: 2px solid var(--ink);
}

.footer-note {
    margin: 0 0 1.5rem;
    padding-bottom: 1.5rem;
    text-align: center;
    border-bottom: 2px solid var(--ink);
}

.footer a:hover {
    color: var(--brand-deep);
}

.site-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.75rem;
}

.site-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink);
    text-decoration: none;
}

.site-link:hover {
    text-decoration: underline;
}

.site-link img {
    width: 32px;
    height: 32px;
    min-width: 16px;
    object-fit: contain;
}

.tabs {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    margin: 0 0 1.5rem;
    border-bottom: 2px solid var(--ink);
}

.tabs button {
    font: inherit;
    font-family: var(--text-face);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink);
    background: #fff;
    border: 2px solid var(--ink);
    border-bottom: none;
    border-radius: 0;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
}

.tabs button:hover {
    background: var(--surface-muted);
}

.tabs button.is-active,
.tabs button.is-active:hover {
    color: var(--stock);
    background: var(--ink);
    border-color: var(--ink);
}

.content {
    font-family: var(--text-face);
    font-size: 1.05rem;
    color: var(--ink);
}

.content p {
    margin: 0 0 1rem;
}

@media (max-width: 900px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }

    .hero-card-chart {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .hero-body {
        padding: 0 0.75rem;
    }

    .hero-body > .container {
        padding: 1.15rem 1rem 1.25rem;
    }

    :root {
        --navbar-height: 7.5rem;
    }

    .navbar {
        padding: 0 0.75rem;
    }

    .navbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .logo {
        justify-content: center;
        padding: 0.55rem 0.375rem 0.2rem;
    }

    .navbar-search {
        padding: 0.5rem 0.375rem 0.65rem;
    }

    .input {
        width: 100%;
    }

    .columns {
        gap: 1.25rem;
    }

    .column {
        flex: 1 1 100%;
    }

    .column:has(.card-frame),
    .column:has(.card-frame) + .column {
        flex: 1 1 100%;
        max-width: 100%;
    }
}
