/* Shared interior-page design: Cataclyzmo's ivory, charcoal, and gold. */
html {
    background: #f5f1e8;
}

body.interior-page {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: 100vh;
    background: #f5f1e8;
    color: #181b20;
    font-family: "Roboto", sans-serif;
    --main-content-width: 1152px;
    --aside-color-left: #e8e3d7;
    --aside-color-right: #fffdf8;
    --aside-border-size: 1px;
}

.interior-page h1,
.interior-page h2,
.interior-page h3 {
    font-family: "Montserrat", sans-serif;
    line-height: 1.25;
}

.page-header {
    box-sizing: border-box;
    width: 100%;
    padding: 48px max(24px, calc((100% - 1104px) / 2));
    background: #181b20;
    color: #f5f1e8;
    border-bottom: 1px solid #353940;
}

.page-header .page-eyebrow {
    margin: 0 0 14px;
    color: #f6cb06;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.interior-page .page-header h1 {
    width: auto;
    max-width: none;
    margin: 0;
    font-size: clamp(32px, 4vw, 48px);
    letter-spacing: -0.03em;
}

.page-header .page-intro {
    max-width: 62ch;
    margin: 16px 0 0;
    color: #d4d1ca;
    font-size: 18px;
    line-height: 1.65;
}

.page-header a {
    color: #f6cb06;
    text-underline-offset: 4px;
}

.interior-page :where(main, article) a {
    color: #695100;
    text-underline-offset: 4px;
}

.interior-page a:focus-visible,
.interior-page button:focus-visible {
    outline: 3px solid #b38b00;
    outline-offset: 4px;
}

.catalog-page main {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1152px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.catalog-page .character-search {
    box-sizing: border-box;
    width: 100%;
    max-width: 1152px;
    margin: 0 auto;
    padding: 32px 24px 0;
}

.catalog-page .character-search label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.catalog-page .character-search input {
    box-sizing: border-box;
    width: 100%;
    max-width: 480px;
    padding: 12px 14px;
    border: 1px solid #8b7330;
    border-radius: 3px;
    background: #fffdf8;
    color: #181b20;
    font: inherit;
}

.catalog-page .character-search input:focus-visible {
    outline: 3px solid #b38b00;
    outline-offset: 3px;
}

.catalog-page .character-no-results {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 18px;
}

.catalog-page .character-no-results[hidden] {
    display: none;
}

/* Shared catalog artwork and comic nameplates. */
.catalog-page .character {
    border: 1px solid #353941;
    display: block;
    width: auto;
    max-width: none;
    min-width: 0;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background:
        radial-gradient(circle, #d9e2ea16 1px, transparent 1.3px) 0 0 / 7px 7px,
        radial-gradient(ellipse at 50% 38%, #4a505a 0, #292e36 48%, #171b22 100%);
}

.catalog-page .character:hover {
    border-color: #8b7330;
    box-shadow: 0 8px 24px rgb(24 27 32 / 12%);
}

.catalog-page .character[hidden],
.catalog-page .character-pagination[hidden] {
    display: none;
}

.catalog-page .character-pagination {
    box-sizing: border-box;
    width: 100%;
    max-width: 1152px;
    margin: -24px auto 64px;
    padding: 0 24px;
    text-align: center;
}

.catalog-page .pagination-status {
    margin: 0 0 16px;
    color: #51504c;
    font-size: 14px;
}

.catalog-page .pagination-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.catalog-page .pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid #8b7330;
    border-radius: 3px;
    background: #fffdf8;
    color: #181b20;
    font-weight: 700;
    text-decoration: none;
}

.catalog-page a.pagination-link:hover,
.catalog-page .pagination-link[aria-current="page"] {
    border-color: #181b20;
    background: #181b20;
    color: #fff8e9;
}

.catalog-page .character > a {
    display: block;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle, #d9e2ea16 1px, transparent 1.3px) 0 0 / 7px 7px,
        radial-gradient(ellipse at 50% 38%, #4a505a 0, #292e36 48%, #171b22 100%);
}

.catalog-page .character img,
.catalog-page .team-div .team-img {
    display: block;
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-sizing: border-box;
    height: clamp(360px, 38vw, 440px);
    padding: 12px 8px 0;
    object-fit: contain;
    object-position: center bottom;
    background: transparent;
}

.catalog-page .character img.flame-dragon-image {
    object-position: center;
    padding: 12px 8px;
}

.catalog-page .character img.item-device-image,
.catalog-page .character img.world-image {
    object-position: center;
    padding: 12px 8px;
}

.catalog-page .character h2 {
    margin: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 80px;
    padding: 20px 24px;
    border-top: 3px solid #bd2838;
    background: #181b20;
    color: #fff8e9;
    font-family: "Poppins", sans-serif;
    font-size: clamp(16px, 1.6vw, 20px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
}

.catalog-page .character h2::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 16px;
    width: 40px;
    height: 5px;
    background: #eab733;
    transform: skewX(-25deg);
}

.catalog-page .character hr { display: none; }

.catalog-page .comic-availability {
    background: #181b20;
    color: #fff8e9;
}

.catalog-page .comic-availability a { color: #f6cb06; }

/* Profile artwork and facts alongside a comfortable reading column. */
.profile-page main {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
    align-items: start;
    gap: 32px;
    width: 100%;
    max-width: 1152px;
    margin: 0 auto;
    padding: 40px 24px 64px;
}

.profile-page aside {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    background: #fffdf8;
    border: 1px solid #d8d4ca;
    border-radius: 8px;
}

.profile-page aside :is(h1, h2) {
    padding: 12px 16px;
    background: #181b20;
    color: #f5f1e8;
    font-size: 15px;
}

.profile-page #characterImage {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    background: #22262c;
}

.profile-page .team-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    height: auto;
    min-height: 64px;
    padding: 10px 12px;
    background: #202126;
    color: #fff8e9;
    font: 700 12px "Roboto", sans-serif;
}

.profile-page .team-carousel-controls button {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #eab733;
    border-radius: 3px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}

.profile-page .team-carousel-controls button:hover {
    background: #eab733;
    color: #202126;
}

.profile-page .team-carousel-controls button:focus-visible {
    outline: 2px solid #fff8e9;
    outline-offset: 2px;
}

.profile-page .team-member-card #characterImage { cursor: pointer; }

.profile-page .team-member-profile {
    display: block;
    padding: 12px 16px;
    color: #8f2230;
    font: 700 13px "Roboto", sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.profile-page .team-member-profile[hidden],
.profile-page .team-member-details[hidden] { display: none; }

.profile-page .character-forms {
    margin: 0;
    padding: 12px;
    border: 0;
}

.profile-page .character-forms legend {
    padding: 8px 0 0;
    font: 600 12px "Poppins", sans-serif;
}

.profile-page .character-forms label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    cursor: pointer;
    font: 12px "Poppins", sans-serif;
}

.profile-page .character-forms input {
    accent-color: #bd2838;
}

.profile-page .character-forms input:checked + span {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.profile-page .character-forms input:focus-visible {
    outline: 2px solid #bd2838;
    outline-offset: 3px;
}

.profile-page .traits {
    width: 100%;
    border: 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
    line-height: 1.5;
}

.profile-page .traits :is(td, th) {
    padding: 8px;
    overflow-wrap: anywhere;
    border-bottom: 1px solid #d8d4ca;
    font-family: "Roboto", sans-serif;
    font-size: 14px;
}

/* Comic dossier: ink, paper, and sharply cut power meters. */
.profile-page .power-scanner {
    --stat-base-color: #bd2838;
    --stat-boost-color: #eab733;
    padding: 0 16px 18px;
    color: #202126;
    background: radial-gradient(#292a3012 .7px, transparent .8px) 0 0 / 5px 5px, #f0eadc;
    border-block: 2px solid #202126;
    font-family: "Roboto", sans-serif;
}

.profile-page .scanner-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    margin: 0 -16px 18px;
    background: #202126;
    border-bottom: 4px solid var(--stat-base-color);
    font-style: italic;
    color: #fff8e9;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.profile-page .scanner-status {
    width: 9px;
    height: 18px;
    transform: skewX(-18deg);
    background: var(--stat-base-color);
}

.profile-page .scanner-scale { margin-left: auto; color: #e7d8b8; font-style: normal; font-size: 11px; }
.profile-page .scanner-stat + .scanner-stat { margin-top: 18px; }
.profile-page .scanner-stat-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; }
.profile-page .scanner-stat-heading a {
    padding-block: 4px;
    color: #202126;
    font: 800 12px/1.5 "Roboto", sans-serif;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: underline;
    text-decoration-color: #998b73;
    text-underline-offset: 4px;
}
.profile-page .scanner-stat-heading a:hover { color: var(--stat-base-color); }
.profile-page .power-scanner :is(a, input):focus-visible { outline: 2px solid var(--stat-boost-color); outline-offset: 4px; }
.profile-page .stat-rating { display: block; margin-left: auto; color: #383a40; font: 700 12px/1.5 "Roboto", sans-serif; }
.profile-page .stat-boost-note { display: block; color: #735208; font-size: 10px; text-align: right; }

.profile-page .scanner-meter {
    position: relative;
    height: 14px;
    margin-top: 6px;
    overflow: hidden;
    border: 0;
    clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
    background: #292a30;
}
.profile-page .scanner-fill {
    display: block;
    height: 100%;
    background: linear-gradient(to right, var(--stat-base-color) 0 var(--base), var(--stat-boost-color) var(--base) 100%);
    /* The gradient uses the whole track as its reference, keeping the base length exact. */
    width: 100%;
    clip-path: inset(0 calc(100% - var(--equipped)) 0 0);
}
.profile-page .scanner-meter::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to right, transparent 0 calc(10% - 1px), #292a3070 calc(10% - 1px) 10%);
    pointer-events: none;
}
.profile-page .stats-base-only .scanner-fill { clip-path: inset(0 calc(100% - var(--base)) 0 0); }
.profile-page .power-scanner .stat-base,
.profile-page .stats-base-only .stat-equipped { display: none; }
.profile-page .stats-base-only .stat-base { display: block; }

.profile-page .stats-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 2px solid #202126;
    color: #51504c;
    font: 11px/1.6 "Roboto", sans-serif;
}
.profile-page .stats-legend p { width: 100%; margin: 2px 0 0; font: inherit; }
.profile-page .stat-key { display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; }
.profile-page .stat-key-base { background: var(--stat-base-color); }
.profile-page .stat-key-boost { background: var(--stat-boost-color); }
.profile-page .stats-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; cursor: pointer; font-size: 12px; color: #202126; }
.profile-page .stats-toggle input { width: 18px; height: 18px; margin: 0; accent-color: #bd2838; }
.profile-page .power-scanner[hidden],
.profile-page .stats-legend [hidden] { display: none; }

@media screen and (max-width: 380px) {
    .profile-page main { padding-right: 12px; padding-left: 12px; }
    .profile-page .power-scanner { padding-inline: 12px; }
    .profile-page .scanner-header { margin-inline: -12px; padding-inline: 12px; }
}

.reference-page h2[id] {
    scroll-margin-top: 90px;
}

.profile-page article,
.reference-page article {
    box-sizing: border-box;
    min-width: 0;
    background: #fffdf8;
    border: 1px solid #d8d4ca;
    border-radius: 8px;
    padding: clamp(20px, 3vw, 36px);
    font-family: "Roboto", sans-serif;
    line-height: 1.75;
}

.profile-page article :is(h1, h2),
.reference-page article :is(h1, h2) {
    padding: 0;
    margin: 28px 0 12px;
    font-size: 23px;
    color: #181b20;
}

.profile-page article > :first-child,
.reference-page article > :first-child {
    margin-top: 0;
    padding-top: 0;
}

.profile-page article p,
.reference-page article p {
    padding: 0;
    margin: 0 0 20px;
    font-size: 17px;
    line-height: 1.75;
}

.profile-page .team-overview-image {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    margin: 0 auto 24px;
    background: #181b20;
}

.profile-page article :is(ol, ul),
.reference-page article :is(ol, ul) {
    padding-left: 24px;
    font-size: 17px;
}

.interior-page article hr {
    width: 100%;
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #d8d4ca;
}

.reference-page article {
    width: calc(100% - 48px);
    max-width: 1104px;
    margin: 40px auto 64px;
}

.reference-page article li {
    margin: 0 0 12px;
    font-size: 17px;
    line-height: 1.75;
}

.reference-page .figures {
    box-sizing: border-box;
    width: 100%;
    max-width: 1152px;
    margin: 0 auto;
    padding: 40px 24px 0;
    gap: 24px;
}

.reference-page .figures figure {
    box-sizing: border-box;
    width: min(100%, 340px);
    margin: 0;
    padding: 20px;
    border: 1px solid #d8d4ca;
    border-radius: 8px;
    background: #fffdf8;
}

.reference-page {
    --graph-width: 100%;
}

.reference-page .legend {
    line-height: 1.8;
    margin-top: 20px;
    font-family: "Roboto", sans-serif;
}

/* A consistent ending on every interior page. */
.interior-page .site-footer {
    margin-top: auto;
    background: #181b20;
    color: #f5f1e8;
    border-top: 1px solid #353940;
}

.interior-page .site-footer-inner {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1152px;
    margin: 0 auto;
    padding: 32px 24px;
}

.interior-page .footer-brand {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.interior-page .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.interior-page .footer-links a {
    display: inline-block;
    padding: 8px 0;
    color: #f5f1e8;
    text-underline-offset: 4px;
}

.interior-page .footer-links a:hover {
    color: #f6cb06;
}

@media screen and (max-width: 900px) {
    .catalog-page main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-page main { grid-template-columns: minmax(0, 1fr); }
    .profile-page aside { max-width: 400px; margin: 0 auto; }
}

@media screen and (max-width: 520px) {
    .catalog-page main { grid-template-columns: minmax(0, 1fr); }
    .page-header { padding-top: 32px; padding-bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-page .character { transition: none; }
}

.catalog-page .comic-availability { margin: 0; padding: 0 20px 24px; line-height: 1.6; }
.catalog-page .comic-availability a { display: inline; font-weight: 700; }
