/* The Witcher DB */

/* Scrollbar: scrollbar-color / scrollbar-width */
html {
    scrollbar-color: #c8a96e #070708;
    scrollbar-width: thin;
}

/* Base typography & colour */
body {
    margin: 0;
    padding: 0;
    font-family: "Lora", Georgia, serif;
    font-size: 100%;
    color: #e6dfd3;
    background-color: #070708;
}

h1 {
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.75em;
    color: #c8a96e;
    letter-spacing: 0.06em;
    margin-top: 0;
}

h2 {
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.35em;
    color: #c8a96e;
    border-bottom: 1px solid rgba(200, 169, 110, 0.35);
    padding-bottom: 0.35em;
}

p {
    font-family: "Lora", Georgia, serif;
    font-size: 1em;
    line-height: 1.55;
    color: #e6dfd3;
}

a {
    color: #c8a96e;
    text-decoration: none;
}

a:hover {
    color: #e8d4a8;
    text-decoration: underline;
}

/* Navigation */
.nav-wrap {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 1.25em 4% 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.nav {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.4em 0.6em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    max-width: min(96vw, 58rem);
}

.nav a {
    color: rgba(230, 223, 211, 0.9);
    padding: 0.5em 0.85em;
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.82em;
    border-radius: 999px;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e8d4a8;
    text-decoration: none;
}

/* Cards */
.card {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(200, 169, 110, 0.45);
    padding: 1.15em 1.25em;
    border-radius: 1.35rem;
    width: 96%;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    text-align: center;
}

/* Home: Witcher IV trailer embed */
.video-embed {
    width: min(60%, 720px);
    max-width: 720px;
    margin: 1rem auto 1.25rem auto;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(200, 169, 110, 0.35);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.video-embed iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 200px;
    border: none;
}

.intro {
    position: relative;
    padding: 0.35rem 1.1rem 1.25rem 1.1rem;
    margin: 0 auto 1.1rem auto;
    max-width: 620px;
    text-align: center;
    border-radius: 1.25rem;
    border: none;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.intro-title {
    margin: 0 0 0.55rem 0;
    font-family: "Cinzel", Georgia, serif;
    letter-spacing: 0.06em;
    color: #e8d4a8;
    line-height: 1.18;
    font-size: clamp(1.65rem, 2.2vw + 1rem, 2.55rem);
}

.intro-title-sub {
    display: block;
    margin-top: 0.25rem;
    color: rgba(230, 223, 211, 0.9);
    letter-spacing: 0.04em;
    font-size: 0.86em;
}

.intro-text {
    margin: 0 auto;
    max-width: 55ch;
    font-size: 1rem;
    color: rgba(230, 223, 211, 0.92);
}

.intro-actions {
    display: flex;
    flex-wrap: wrap;
    margin-top: 0.95rem;
    justify-content: center;
}

.intro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(200, 169, 110, 0.45);
    background: rgba(18, 14, 12, 0.55);
    color: rgba(230, 223, 211, 0.95);
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition:
        transform 0.15s ease,
        filter 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.intro-btn-ghost {
    background: rgba(18, 14, 12, 0.55);
    border-color: rgba(200, 169, 110, 0.4);
}

.intro-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    border-color: rgba(232, 212, 168, 0.7);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    filter: brightness(1.06);
}

.intro-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(200, 169, 110, 0.38),
        0 10px 28px rgba(0, 0, 0, 0.35);
}

button.intro-btn {
    appearance: none;
    cursor: pointer;
    margin: 0;
}

/* Home: featured content row */
.featured-head {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
    text-align: center;
}

.featured-head h2 {
    width: 100%;
}

.featured-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.feature-card {
    display: flex;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.75rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(200, 169, 110, 0.35);
    background: rgba(0, 0, 0, 0.55);
    box-shadow:
        0 14px 44px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    flex: 1 1 320px;
    min-width: 280px;
    color: inherit;
    text-decoration: none;
    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.feature-card img {
    width: 160px;
    height: 112px;
    border-radius: 0.85rem;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(200, 169, 110, 0.22);
}

.feature-meta {
    min-width: 0;
}

.feature-eyebrow {
    margin: 0 0 0.25rem 0;
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(232, 212, 168, 0.78);
}

.feature-card h3 {
    margin: 0 0 0.35rem 0;
}

.feature-hook {
    margin: 0;
    color: rgba(230, 223, 211, 0.86);
    font-size: 0.95rem;
    line-height: 1.4;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: rgba(232, 212, 168, 0.72);
    box-shadow:
        0 18px 56px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(200, 169, 110, 0.22),
        0 0 22px rgba(200, 169, 110, 0.12);
    text-decoration: none;
}

.feature-card:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(200, 169, 110, 0.35),
        0 14px 44px rgba(0, 0, 0, 0.42);
}

/* Headings */
h3 {
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.05em;
    color: #c8a96e;
    margin: 0 0 0.35em 0;
    letter-spacing: 0.04em;
}

/* Character cards: wiki link + portrait compare (game / Netflix range) */
.char-card-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.card.char-card-wrap[hidden] {
    display: none;
}

.card.char-card-wrap {
    text-align: left;
}

/* Game / Netflix portrait compare */
.char-thumb-wrap.char-compare {
    position: relative;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
}

.char-compare-inner {
    position: relative;
    width: 100%;
    height: 220px;
    border-radius: 0.65rem;
    overflow: hidden;
    background: rgba(10, 8, 7, 0.6);
}

.char-compare-game,
.char-compare-netflix {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
    margin: 0;
}

.char-compare-netflix {
    clip-path: inset(0 100% 0 0);
}

.char-compare-label {
    display: block;
    font-size: 0.72rem;
    font-family: "Cinzel", Georgia, serif;
    letter-spacing: 0.04em;
    color: #8a8075;
    margin: 0.4em 0 0.2em 0;
}

.char-compare-range {
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.15em 0;
    cursor: pointer;
    accent-color: #c8a96e;
}

.char-compare-range:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.char-card-wrap article {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    text-align: left;
}

a.char-card-link {
    position: relative;
    z-index: 1;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    border-bottom: none;
}

a.char-card-link:hover {
    text-decoration: none;
}

a.char-card-link::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
}

.char-compare-range,
.char-compare-inner {
    position: relative;
    z-index: 1;
}

.char-card-wrap article h2 {
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.32rem;
    font-weight: 600;
    color: #c8a96e;
    letter-spacing: 0.04em;
    line-height: 1.2;
    margin: 0 0 0.2em 0;
    border-bottom: none;
    padding-bottom: 0;
}

.char-card-wrap article > .char-role {
    font-size: 0.9rem;
    font-style: italic;
    color: #8a8075;
    margin: 0 0 0.45em 0;
}

.char-card-wrap article > p:not(.char-role):not(.char-compare-label) {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #e6dfd3;
    margin: 0;
}

.char-card-wrap:hover,
.char-card-wrap:focus-visible,
.char-card-wrap:has(.char-card-link:hover),
.char-card-wrap:has(.char-card-link:focus-visible) {
    transform: translateY(-2px);
    border-color: rgba(232, 212, 168, 0.82);
    box-shadow:
        0 22px 56px rgba(0, 0, 0, 0.52),
        0 0 0 2px rgba(200, 169, 110, 0.42),
        0 0 36px rgba(200, 169, 110, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.char-card-wrap:focus-visible {
    outline: 2px solid rgba(200, 169, 110, 0.8);
    outline-offset: 2px;
}

.char-thumb-wrap {
    width: 100%;
    height: 220px;
    min-height: 220px;
    max-height: 220px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 0.65rem;
    margin: 0.45em 0 0.65em 0;
}

.char-thumb-wrap img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center center;
    opacity: 1;
    transition: opacity 0.35s ease;
}

/* Character cards: thin frame around portraits */
.char-card-wrap .char-thumb-wrap > img,
.char-card-wrap .char-compare-inner {
    border: 1px solid rgba(200, 169, 110, 0.38);
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 0.65rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 0.85rem;
    overflow: hidden;
}

table caption {
    caption-side: top;
    padding: 0.5em 0.35em 0.65em 0.35em;
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.92em;
    color: #c8a96e;
    text-align: left;
}

th {
    background-color: rgba(26, 20, 16, 0.95);
    color: #c8a96e;
    padding: 0.65em;
    font-family: "Cinzel", Georgia, serif;
    text-align: center;
    border-bottom: 2px solid rgba(139, 0, 0, 0.65);
}

td {
    padding: 0.55em;
    border-bottom: 1px solid rgba(74, 103, 65, 0.45);
    text-align: center;
}

form {
    max-width: 90%;
    width: 32.5rem;
    margin: 1em auto;
    padding: 1em;
}

input,
textarea {
    width: 96%;
    padding: 0.55em 0.65em;
    background-color: rgba(18, 14, 12, 0.9);
    border: 1px solid rgba(200, 169, 110, 0.45);
    color: #e6dfd3;
    font-family: "Lora", Georgia, serif;
    box-sizing: border-box;
    border-radius: 0.55rem;
}

button {
    background: linear-gradient(180deg, #3d5a38, #2d4428);
    color: #e6dfd3;
    padding: 0.55em 1.2em;
    border: 1px solid rgba(200, 169, 110, 0.5);
    cursor: pointer;
    font-family: "Cinzel", Georgia, serif;
    border-radius: 0.55rem;
}

button:hover {
    filter: brightness(1.08);
}

/* Footer  */
.footer {
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.footer-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 4%;
}

.footer-row {
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    font-size: 0.875rem;
    color: #8a8075;
}

@media screen and (min-width: 768px) {
    .footer-row {
        flex-direction: row;
        align-items: center;
    }

    .footer-copy {
        text-align: left;
    }

    .footer-dev {
        text-align: right;
    }
}

.footer-copy {
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* TW = Wolf medallion gold, DB = muted parchment */
.footer-brand {
    color: #d4af37;
    text-shadow: 0 0 12px rgba(200, 169, 110, 0.35);
    font-weight: bold;
    font-size: 0.95em;
    letter-spacing: 0.06em;
}

.footer-site {
    color: #8a8075;
    font-weight: 500;
}

.footer-dev {
    text-align: center;
}

.footer-dev a {
    color: rgba(230, 223, 211, 0.85);
    font-weight: bold;
}

.footer-dev a:hover {
    color: #c8a96e;
    text-decoration: underline;
}

/* Page layout (used on every page) */
.page-inner {
    width: 96%;
    max-width: min(98vw, 58rem);
    margin-left: auto;
    margin-right: auto;
    padding: 0.8em 0 3em 0;
    position: relative;
    z-index: 2;
}

/* Center the page title and lead paragraph */
.page-inner > h1 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0.05em;
}

.page-inner > h1 + p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
}

/* Books page has a second intro paragraph before the table */
.book-page .page-inner > h1 + p + p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Timeline page */
.page-inner:has(> .timeline-wrap) > h1,
.page-inner:has(> .timeline-wrap) > h1 + p {
    max-width: 700px;
}

/* Gwent page */
.faction-portrait-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto 1.25rem auto;
    border-radius: 0.85rem;
    border: 1px solid rgba(200, 169, 110, 0.35);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

#gwent-lightbox-source .faction-portrait-img {
    cursor: pointer;
}

.faction-key-list {
    margin: 0.5rem 0 1.25rem 0;
    padding-left: 1.25em;
    color: rgba(230, 223, 211, 0.9);
}

.faction-key-list li {
    margin-bottom: 0.35em;
}

/* Three-level nested list for the Gwent card hierarchy */
.gwent-nested-tree ul {
    margin: 0.35em 0 0.35em 0;
}

.gwent-nested-tree > li {
    margin-bottom: 0.75em;
}

/* Background images */
.site-bg {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    background-color: #0d0f0e;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.site-bg-home        { background-image: url(../images/backgrounds/home-bg.webp); }
.site-bg-characters  { background-image: url(../images/backgrounds/characters-bg.webp); }
.site-bg-gwent       { background-image: url(../images/backgrounds/gwent-bg.webp); }
.site-bg-series      { background-image: url(../images/backgrounds/series-bg.webp); }
.site-bg-timeline    { background-image: url(../images/backgrounds/timeline-bg.webp); }
.site-bg-book        { background-image: url(../images/backgrounds/books-bg.webp); }
.site-bg-schools     { background-image: url(../images/backgrounds/schools-bg.webp); }
.site-bg-bestiary    { background-image: url(../images/backgrounds/bestiary-bg.webp); }
.site-bg-gallery     { background-image: url(../images/backgrounds/gallery-bg.webp); }
.site-bg-games       { background-image: url(../images/backgrounds/games-bg.webp); }

/* Feedback form status / error banners */
.feedback-form-status,
.feedback-form-error {
    width: 100%;
    box-sizing: border-box;
    border-radius: 0.75rem;
    padding: 0.8rem 0.9rem;
    margin-bottom: 0.9rem;
    border: 1px solid rgba(200, 169, 110, 0.3);
    background: rgba(12, 10, 9, 0.45);
    color: rgba(230, 223, 211, 0.92);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.feedback-form-status em {
    font-style: normal;
    color: rgba(232, 212, 168, 0.92);
}

.feedback-form-status strong {
    color: rgba(232, 212, 168, 0.98);
}

.feedback-form-error {
    border-color: rgba(139, 0, 0, 0.55);
    background: rgba(36, 10, 10, 0.35);
}

.feedback-reset-btn {
    background: rgba(18, 14, 12, 0.55) !important;
    border-color: rgba(200, 169, 110, 0.45) !important;
    color: rgba(230, 223, 211, 0.95) !important;
}

.feedback-reset-btn:hover {
    filter: brightness(1.06);
}

/* Dark overlay */
.overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    min-height: 100%;
    background-color: rgba(19, 19, 19, 0.55);
    
    z-index: 0;
}

/* Generic grid | Flex-based card grid used on most pages */
.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.grid .card,
.grid a.card {
    width: 46%;
    min-width: 240px;
    flex: 1 1 280px;
    margin: 0.5em;
}

/* Characters grid (Overrides the flex grid with a strict 3-column CSS Grid) */
.page-inner > .grid:has(.char-card-wrap) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    justify-content: stretch;
    align-items: stretch;
}

.page-inner > .grid:has(.char-card-wrap) > .card.char-card-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: none;
    margin: 0;
    padding: 0.95em 1em;
}

.page-inner > .grid:has(.char-card-wrap) .char-card-wrap article h2 {
    font-size: 1.08rem;
}

.page-inner > .grid:has(.char-card-wrap) .char-card-wrap article > .char-role {
    font-size: 0.82rem;
}

.page-inner > .grid:has(.char-card-wrap) .char-card-wrap article > p:not(.char-role):not(.char-compare-label) {
    font-size: 0.74rem;
    line-height: 1.45;
}

@media screen and (max-width: 960px) {
    .page-inner > .grid:has(.char-card-wrap) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 560px) {
    .page-inner > .grid:has(.char-card-wrap) {
        grid-template-columns: minmax(0, 1fr);
    }
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.char-role {
    font-size: 0.92em;
    color: #8a8075;
    font-style: italic;
    margin: 0 0 0.5em 0;
}

.menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(200, 169, 110, 0.35);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-btn:hover {
    background: rgba(200, 169, 110, 0.12);
    border-color: rgba(200, 169, 110, 0.65);
}

.menu-btn:focus-visible {
    outline: 2px solid rgba(200, 169, 110, 0.55);
    outline-offset: 2px;
}

.menu-btn-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: #c8a96e;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Animate to × when open */
.menu-btn.is-open .menu-btn-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-btn.is-open .menu-btn-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.menu-btn.is-open .menu-btn-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.timeline-item {
    position: relative;
    border-left: 2px solid rgba(200, 169, 110, 0.55);
    padding-left: 1em;
    margin-bottom: 1rem;
    border-radius: 0 0.65rem 0.65rem 0;
    background: rgba(12, 10, 9, 0.35);
    padding-top: 0.5em;
    padding-bottom: 0.5em;
}

/* Timeline page */
.timeline-wrap {
    position: relative;
    max-width: 700px;
    margin: 2rem auto;
}

.timeline-line {
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #c9a84c;
}

.timeline-events {
    padding-left: 50px;
}

.timeline-wrap .timeline-item {
    border-left: none;
    background: transparent;
    padding-left: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-radius: 0;
}

.timeline-marker {
    position: absolute;
    left: -31px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #c9a84c;
    border: 2px solid #c9a84c;
    transform: translateX(-50%);
}

.timeline-era {
    display: block;
    font-family: "Lora", serif;
    font-style: italic;
    font-size: 0.8rem;
    color: #a0896a;
    margin-bottom: 0.2rem;
}

.timeline-item h2 {
    font-family: "Cinzel", serif;
    font-size: 1.2rem;
    color: #e8d5a3;
    margin: 0 0 0.4rem 0;
}

.timeline-item p {
    font-family: "Lora", serif;
    font-size: 0.95rem;
    color: #c0a87a;
    line-height: 1.6;
    margin: 0;
}

.gallery-img {
    border: 1px solid rgba(74, 103, 65, 0.5);
    border-radius: 0.75rem;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.gallery-img:hover {
    border-color: #c8a96e;
    transform: scale(1.02);
}

/* Gallery page */
.gallery-grid {
    align-items: flex-start;
}

.gallery-grid .card {
    padding: 0.85em 0.85em 0.65em 0.85em;
    box-sizing: border-box;
}

.gallery-grid .gallery-img {
    width: 100%;
    box-sizing: border-box;
}

.gallery-grid .card > p {
    margin: 0.5em 0 0 0;
}

/* Lightbox */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(0, 0, 0, 0.78);
    cursor: pointer;
}

.gallery-lightbox-panel {
    position: relative;
    z-index: 1;
    max-width: min(88vw, 920px);
    max-height: 88vh;
    padding: 0.85rem 0.85rem 0.75rem;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 1rem;
    box-shadow:
        0 20px 56px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.gallery-lightbox-close {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    z-index: 2;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border-radius: 0.45rem;
    border: 1px solid rgba(200, 169, 110, 0.45);
    background: rgba(18, 14, 12, 0.92);
    color: #e8d4a8;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.gallery-lightbox-close:hover {
    background: rgba(28, 22, 18, 0.98);
    border-color: rgba(232, 212, 168, 0.55);
    color: #e6dfd3;
}

.gallery-lightbox-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.45);
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border-radius: 0.55rem;
    border: 1px solid rgba(200, 169, 110, 0.45);
    background: rgba(18, 14, 12, 0.92);
    color: #e8d4a8;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.gallery-lightbox-prev {
    left: 0.45rem;
}

.gallery-lightbox-next {
    right: 0.45rem;
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
    background: rgba(28, 22, 18, 0.98);
    border-color: rgba(232, 212, 168, 0.55);
    color: #e6dfd3;
}

.gallery-lightbox-prev:focus-visible,
.gallery-lightbox-next:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.45);
}

@media screen and (max-width: 520px) {
    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        width: 2.15rem;
        height: 2.15rem;
        font-size: 1.45rem;
    }
}

.gallery-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: min(72vh, 620px);
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 0.65rem;
    border: 1px solid rgba(74, 103, 65, 0.45);
}

.gallery-lightbox-caption {
    margin: 0.55rem 0 0 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: rgba(230, 223, 211, 0.92);
    text-align: center;
}

.gallery-lightbox-caption:empty {
    display: none;
}

/* Mobile nav */
.nav-mobile-bar {
    display: none;
}

@media screen and (max-width: 768px) {
    .nav-wrap {
        padding: 0.75em 0 0;
        width: 100%;
        position: static;
    }

    .nav-mobile-bar {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 52px;
        box-sizing: border-box;
        padding: 0 1rem;
    }

    .nav-mobile-title {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-family: "Cinzel", Georgia, serif;
        font-size: 0.92rem;
        letter-spacing: 0.12em;
        color: #c8a96e;
        pointer-events: none;
        white-space: nowrap;
        text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
        max-width: calc(100% - 100px);
        overflow: hidden;
        text-overflow: ellipsis;
        z-index: 0;
    }

    .nav-mobile-spacer {
        display: none;
    }

    .menu-btn {
        display: flex;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 200;
        flex-shrink: 0;
    }

    .video-embed {
        width: 100%;
    }

    .feature-card {
        flex-direction: column;
    }

    .feature-card img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    #nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(80vw, 300px);
        flex-direction: column;
        align-items: stretch;
        background: rgba(0, 0, 0, 0.55);
        border-left: 1px solid rgba(200, 169, 110, 0.3);
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(18px);
        z-index: 160;
        padding: 5rem 0 2rem 0;
        box-sizing: border-box;
        overflow-y: auto;
        display: flex;
        transform: translateX(100%);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: hidden;
    }

    #nav-menu.nav-open {
        transform: translateX(0);
        visibility: visible;
    }

    #nav-menu::before {
        content: "Navigation";
        display: block;
        position: absolute;
        top: 1.4rem;
        left: 1.5rem;
        font-family: "Cinzel", Georgia, serif;
        font-size: 0.7rem;
        letter-spacing: 0.2em;
        text-transform: uppercase;
        color: rgba(200, 169, 110, 0.5);
    }

    .nav-links a {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.85em 1.5em;
        border-radius: 0;
        border-bottom: 1px solid rgba(200, 169, 110, 0.1);
        font-size: 0.95rem;
        letter-spacing: 0.06em;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links a:hover {
        background: rgba(200, 169, 110, 0.1);
        color: #e8d4a8;
        text-decoration: none;
    }

    .nav {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        overflow: visible;
        width: 100%;
        max-width: 100%;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        border-radius: 0;
    }
}

@media screen and (min-width: 769px) {
    #nav-menu {
        display: flex;
        flex-wrap: wrap;
    }
}

/* Books page */
.books-table-section {
    width: 100%;
    margin-top: 1.25rem;
    margin-left: auto;
    margin-right: auto;
}

.books-table-section-title {
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.2em;
    color: #c8a96e;
    margin: 0 0 0.75rem 0;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(200, 169, 110, 0.35);
    padding-bottom: 0.35em;
    text-align: center;
}

.page-search-toolbar {
    width: 100%;
    margin-bottom: 1rem;
}

.page-search-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.85rem 0;
    padding: 0.55em 0.65em;
    background-color: rgba(12, 10, 9, 0.98);
    border: 1px solid rgba(200, 169, 110, 0.45);
    color: #e6dfd3;
    font-family: "Lora", Georgia, serif;
    font-size: 1rem;
    border-radius: 0.55rem;
}

.page-search-input::placeholder {
    color: rgba(138, 128, 117, 0.9);
}

.page-search-input:focus {
    outline: none;
    border-color: rgba(232, 212, 168, 0.65);
    box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.25);
}

.page-search-empty {
    margin: 0 0 1rem 0;
    padding: 1.25rem 1rem;
    text-align: center;
    color: rgba(190, 178, 160, 0.95);
    font-family: "Lora", Georgia, serif;
    font-size: 1rem;
    line-height: 1.5;
    background: rgba(12, 10, 9, 0.55);
    border: 1px dashed rgba(200, 169, 110, 0.38);
    border-radius: 0.55rem;
}

.page-search-empty[hidden] {
    display: none !important;
}

.page-search-empty p {
    margin: 0;
}

.book-page .books-table caption {
    text-align: center;
}

.books-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.25rem;
    margin-left: auto;
    margin-right: auto;
}

.book-page .books-table {
    table-layout: fixed;
    width: 100%;
    min-width: 36rem;
}

.book-page .books-table thead th {
    background-color: rgba(0, 0, 0, 0.55);
}

.book-page .books-table-col-order {
    width: 4%;
}

.book-page .books-table-col-cover {
    width: 11%;
}

.book-page .books-table-col-title {
    width: 20%;
}

.book-page .books-table-col-kind {
    width: 16%;
}

.book-page .books-table-col-year {
    width: 8%;
}

.book-page .books-table-col-notes {
    width: 29%;
}

.book-page .books-table tbody tr {
    transition: background-color 0.15s ease;
    background-color: rgba(0, 0, 0, 0.55);
}

.book-page .books-table tbody tr:hover {
    background-color: rgba(61, 90, 56, 0.35);
}

.book-page .books-table tbody tr[hidden],
.book-page .books-table thead[hidden] {
    display: none;
}

.book-page .books-table td:first-child,
.book-page .books-table th:first-child {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.book-thumb {
    width: 56px;
    height: 84px;
    max-width: none;
    border-radius: 0.4rem;
    border: 1px solid rgba(200, 169, 110, 0.35);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: block;
    margin: 0 auto;
    object-fit: contain;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.book-thumb:hover {
    border-color: #c8a96e;
    transform: scale(1.02);
}

.book-page .books-table a {
    font-weight: 600;
}

.book-page .books-table abbr {
    text-decoration: none;
    border-bottom: 1px dotted rgba(200, 169, 110, 0.55);
    cursor: help;
}

/* On small screens, hide the cover and notes columns to keep the table readable. */

@media screen and (max-width: 600px) {
    .book-page .books-table thead th:nth-child(2),
    .book-page .books-table thead th:nth-child(6),
    .book-page .books-table tbody td:nth-child(2),
    .book-page .books-table tbody td:nth-child(6) {
        display: none;
    }

    .book-page .books-table {
        table-layout: auto;
        min-width: 0;
        width: 100%;
    }

    .book-page .books-table-col-order,
    .book-page .books-table-col-cover,
    .book-page .books-table-col-title,
    .book-page .books-table-col-kind,
    .book-page .books-table-col-year,
    .book-page .books-table-col-notes {
        width: auto;
    }

    .books-table-wrap {
        overflow-x: auto;
    }
}

/* Bestiary catalog */
.page-inner .bestiary-chip-nav + .bestiary-catalog {
    margin-top: 1.15rem;
}

.bestiary-catalog {
    width: 100%;
    margin-top: 0.5rem;
}

.bestiary-category-title {
    font-family: "Cinzel", Georgia, serif;
    font-size: 1.15em;
    color: #c8a96e;
    margin: 1.25rem 0 0.65rem 0;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(200, 169, 110, 0.35);
    padding-bottom: 0.35em;
    text-align: center;
}

.bestiary-category[hidden],
.bestiary-beast-card[hidden] {
    display: none !important;
}

.bestiary-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.bestiary-card-link:hover,
.bestiary-card-link:focus-visible {
    text-decoration: none;
}

.bestiary-card-link:focus-visible {
    outline: 2px solid rgba(200, 169, 110, 0.75);
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* Bestiary: icon-chip category navigation */
.bestiary-chip-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem 0;
    padding: 0;
    list-style: none;
}

.bestiary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45em 0.9em;
    border: 1px solid rgba(200, 169, 110, 0.45);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #e6dfd3;
    font-family: "Lora", Georgia, serif;
    font-size: 0.85rem;
    text-decoration: none;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        color 0.18s ease;
    white-space: nowrap;
}

.bestiary-chip:hover,
.bestiary-chip.bestiary-chip-active {
    color: #e8d4a8;
    background: rgba(0, 0, 0, 0.7);
}

.bestiary-chip:hover {
    border-color: #c8a96e;
    text-decoration: none;
}

.bestiary-chip.bestiary-chip-active {
    border-color: rgba(200, 169, 110, 0.75);
}

.bestiary-chip.bestiary-chip-active .bestiary-chip-label {
    color: #e8d4a8;
}

.bestiary-chip-icon {
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.bestiary-chip-icon img {
    display: block;
    border-radius: 0;
    margin: 0;
}

.bestiary-chip-label {
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: #c8a96e;
}

.bestiary-chip:hover .bestiary-chip-label {
    color: #e8d4a8;
}

.bestiary-chip-count {
    font-family: "Lora", Georgia, serif;
    font-size: 0.72rem;
    color: #8a8075;
    margin-left: 0.1rem;
}

.bestiary-beast-card {
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.bestiary-beast-card:hover {
    transform: translateY(-3px);
    border-color: rgba(200, 169, 110, 0.75);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 20px rgba(200, 169, 110, 0.12);
}

/* CSS Grid keeps cards in 3 equal columns */
.bestiary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: flex-start;
}

.bestiary-grid .card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: none;
    margin: 0;
}

.bestiary-grid .gallery-img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: transparent;
    border-radius: 0.75rem;
    box-sizing: border-box;
}

@media screen and (max-width: 640px) {
    .bestiary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 400px) {
    .bestiary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Back-to-top button  */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    background: rgba(0, 0, 0, 0.55);
}

#back-to-top:hover {
    filter: none;
    background: rgba(0, 0, 0, 0.7);
}

#back-to-top:focus-visible {
    outline: 2px solid rgba(200, 169, 110, 0.75);
    outline-offset: 2px;
}

.gallery-lightbox[hidden],
#back-to-top[hidden] {
    display: none !important;
}

/* Schools page */
.school-infobox {
    float: right;
    clear: right;
    margin: 0 0 1.25rem 1.75rem;
    width: 210px;
    border: 1px solid rgba(201, 168, 76, 0.22);
    border-top: 3px solid #c9a84c;
    border-radius: 0 0 6px 6px;
    background: rgba(0, 0, 0, 0.42);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.school-infobox-emblem {
    display: flex;
    justify-content: center;
    padding: 1.1rem 0 0.9rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.18);
}

.school-infobox dl {
    margin: 0;
    padding: 0;
}

.school-infobox dt {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #c9a84c;
    padding: 0.6rem 0.85rem 0.15rem;
}

.school-infobox dd {
    margin: 0;
    padding: 0 0.85rem 0.65rem;
    color: rgba(230, 223, 211, 0.88);
    font-size: 0.88rem;
    line-height: 1.4;
    border-bottom: 1px solid rgba(201, 168, 76, 0.1);
}

.school-infobox dd:last-child {
    border-bottom: none;
}

/* Fix: forces the profile box to grow tall enough to contain the floated infobox. */
.school-profile::after {
    content: '';
    display: table;
    clear: both;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 2rem;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.schools-page .tabs {
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 4.8rem;
    min-height: 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: #ccc;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.85rem 0.45rem;
    text-align: center;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tab-btn:hover {
    background: transparent;
    border-bottom-color: rgba(201, 168, 76, 0.45);
    color: #e8d4a8;
}

.tab-btn.active {
    background: transparent;
    border-bottom: 2px solid #c9a84c;
    color: #e8d4a8;
    font-weight: 600;
}

.tab-panel {
    display: none;
    opacity: 0;
}

.tab-panel.active {
    display: block;
    opacity: 1;
    animation: schoolFadeIn 0.25s ease forwards;
}

@keyframes schoolFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.school-profile {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Schools page: Narrative quote */
.schools-quote {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 2rem auto 0;
    text-align: center;
}

.schools-quote p {
    margin-top: 0;
}

.schools-quote p::first-letter {
    font-family: inherit;
    font-size: inherit;
    float: none;
    line-height: inherit;
    margin: 0;
    color: inherit;
}

.schools-quote footer {
    margin-top: 0.85rem;
    color: rgba(230, 223, 211, 0.85);
    font-family: "Cinzel", Georgia, serif;
    letter-spacing: 0.05em;
}

.schools-quote cite {
    font-style: normal;
    color: #e8d4a8;
}

/* First letter of each school's opening lore paragraph */
.school-profile > p:first-of-type::first-letter,
.school-layout-content > p:first-of-type::first-letter {
    font-family: 'Cinzel', serif;
    font-size: 3em;
    float: left;
    line-height: 0.82;
    margin: 0.06em 0.1em 0 0;
    color: #c9a84c;
}

.school-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 2rem;
}

.school-layout-content {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    height: 100%;
    min-width: 0;
}

.school-layout-content .school-history {
    margin-top: auto;
}

.school-layout .school-infobox {
    float: none;
    clear: none;
    margin: 0;
    align-self: start;
}

.school-profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.6rem;
    border-bottom: none;
    padding-bottom: 0;
}

.school-emblem {
    width: 120px;
    height: 120px;
    border-radius: 6px;
    border: 2px solid #c9a84c;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    overflow: hidden;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.school-emblem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.school-emblem:hover {
    border-color: #c8a96e;
    transform: scale(1.02);
}

.school-profile-header h2 {
    font-family: 'Cinzel', serif;
    color: #c9a84c;
    margin: 0;
    font-size: 1.4rem;
    border-bottom: none;
    padding-bottom: 0;
}

.school-profile-header p {
    margin: 0.25rem 0 0;
    color: #aaa;
    font-size: 0.85rem;
    font-style: italic;
}

@media screen and (max-width: 600px) {
    .school-profile {
        padding: 1.25rem 1rem;
    }

    .school-profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .tabs {
        gap: 0.35rem;
    }

    .tab-btn {
        min-width: 4rem;
        font-size: 0.78rem;
        padding: 0.45rem 0.6rem;
    }

    .school-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .school-layout .school-infobox {
        width: 100%;
    }
}

@media screen and (max-width: 372px) {
    .school-infobox {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .school-profile {
        padding: 1rem 0.85rem;
    }

    .school-profile > p:first-of-type::first-letter {
        font-size: 2.25em;
        line-height: 0.88;
    }
}

/* School history strip */
.school-history {
    margin-top: 2rem;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 6px;
}

.school-history-label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(201, 168, 76, 0.6);
    margin-bottom: 0.4rem;
}

.school-history-text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: rgba(230, 223, 211, 0.78);
    font-style: italic;
}

/* Per-school accent colours (no CSS variables — validator-friendly) */
.tab-panel--wolf .school-infobox {
    border-top-color: #a8a9ad;
}

.tab-panel--wolf .school-infobox dt {
    color: #a8a9ad;
}

.tab-panel--wolf .school-profile > p:first-of-type::first-letter,
.tab-panel--wolf .school-layout-content > p:first-of-type::first-letter {
    color: #a8a9ad;
}

.tab-panel--wolf .school-emblem {
    border-color: #a8a9ad;
}

.tab-panel--cat .school-infobox {
    border-top-color: #d4820a;
}

.tab-panel--cat .school-infobox dt {
    color: #d4820a;
}

.tab-panel--cat .school-profile > p:first-of-type::first-letter,
.tab-panel--cat .school-layout-content > p:first-of-type::first-letter {
    color: #d4820a;
}

.tab-panel--cat .school-emblem {
    border-color: #d4820a;
}

.tab-panel--bear .school-infobox {
    border-top-color: #8b5e3c;
}

.tab-panel--bear .school-infobox dt {
    color: #8b5e3c;
}

.tab-panel--bear .school-profile > p:first-of-type::first-letter,
.tab-panel--bear .school-layout-content > p:first-of-type::first-letter {
    color: #8b5e3c;
}

.tab-panel--bear .school-emblem {
    border-color: #8b5e3c;
}

.tab-panel--griffin .school-infobox {
    border-top-color: #4a7fa5;
}

.tab-panel--griffin .school-infobox dt {
    color: #4a7fa5;
}

.tab-panel--griffin .school-profile > p:first-of-type::first-letter,
.tab-panel--griffin .school-layout-content > p:first-of-type::first-letter {
    color: #4a7fa5;
}

.tab-panel--griffin .school-emblem {
    border-color: #4a7fa5;
}

.tab-panel--viper .school-infobox {
    border-top-color: #4a7a4a;
}

.tab-panel--viper .school-infobox dt {
    color: #4a7a4a;
}

.tab-panel--viper .school-profile > p:first-of-type::first-letter,
.tab-panel--viper .school-layout-content > p:first-of-type::first-letter {
    color: #4a7a4a;
}

.tab-panel--viper .school-emblem {
    border-color: #4a7a4a;
}

/* Series page */

.series-page.page-inner > h1 + .series-text,
.schools-page.page-inner > h1 + .schools-text {
    max-width: 38rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    color: rgba(230, 223, 211, 0.78);
    font-size: 0.98rem;
    line-height: 1.55;
}

.tabs.tabs--series {
    max-width: min(96vw, 52rem);
    margin-bottom: 1.75rem;
}

.series-entry {
    max-width: 52rem;
    margin-left: auto;
    margin-right: auto;
}

.series-feature {
    display: grid;
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
    gap: 1.75rem 2rem;
    align-items: start;
    padding: 1.5rem 1.65rem;
    margin-bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(200, 169, 110, 0.22);
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.series-poster-frame {
    position: relative;
}

.series-poster {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    aspect-ratio: 2 / 3;
    background: rgba(40, 32, 20, 0.85);
    border-radius: 8px;
    border: 1px solid rgba(200, 169, 110, 0.22);
    overflow: hidden;
    box-sizing: border-box;
}

.series-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    pointer-events: none;
}

#series-lightbox-source .series-poster[role="button"] {
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

#series-lightbox-source .series-poster[role="button"]:hover {
    border-color: rgba(200, 169, 110, 0.5);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

#series-lightbox-source .series-poster[role="button"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.55);
    border-color: rgba(200, 169, 110, 0.55);
}

#series-lightbox .gallery-lightbox-img {
    border-color: rgba(200, 169, 110, 0.45);
}

.series-feature-text h2 {
    font-family: "Cinzel", Georgia, serif;
    font-size: clamp(1.15rem, 2.5vw, 1.45rem);
    color: #c8a96e;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0;
    border-bottom: none;
    letter-spacing: 0.04em;
}

.series-title-imdb {
    color: inherit;
    text-decoration: none;
    transition:
        color 0.2s ease,
        text-shadow 0.2s ease;
}

.series-title-imdb:hover {
    color: #e8d4a8;
    text-decoration: none;
    text-decoration-thickness: 2.5px;
    text-underline-offset: 3px;
}

.series-title-imdb:focus-visible {
    outline: none;
    color: #e8d4a8;
    text-decoration: none;
    text-decoration-thickness: 2.5px;
    text-underline-offset: 3px;
    box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.35);
    border-radius: 2px;
}

.series-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 1rem 0;
    align-items: center;
}

.series-imdb-rating {
    margin-left: 0.45rem;
    padding-left: 0.55rem;
    border-left: 1px solid rgba(200, 169, 110, 0.22);
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: rgba(200, 169, 110, 0.88);
    white-space: nowrap;
}

.series-imdb-rating-star {
    margin-right: 0.15rem;
    color: rgba(200, 169, 110, 0.95);
}

.series-imdb-rating-value {
    color: rgba(230, 223, 211, 0.88);
}

.series-imdb-rating-max {
    color: rgba(230, 223, 211, 0.45);
    font-size: 0.68rem;
}

.series-badge {
    font-size: 0.7rem;
    font-family: "Cinzel", Georgia, serif;
    letter-spacing: 0.06em;
    border: 1px solid rgba(200, 169, 110, 0.32);
    border-radius: 4px;
    padding: 3px 9px;
    color: rgba(200, 169, 110, 0.82);
    background: rgba(0, 0, 0, 0.2);
}

.series-synopsis {
    font-size: 0.92rem;
    color: rgba(230, 223, 211, 0.78);
    line-height: 1.65;
    margin: 0;
}

/* Series page: bordered panel around the trailer embed */
.series-trailer-box {
    margin-top: 1rem;
    border: 1px solid rgba(200, 169, 110, 0.2);
    border-radius: 8px;
    background: rgba(13, 10, 8, 0.68);
    padding: 0.75rem;
}

.series-trailer-title {
    margin: 0 0 0.55rem 0;
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(200, 169, 110, 0.75);
}

.series-trailer-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(200, 169, 110, 0.2);
}

.series-trailer-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.series-subsection {
    margin-top: 1.75rem;
}

.series-subsection:first-of-type {
    margin-top: 1.5rem;
}

.series-section-label {
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.72em;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(200, 169, 110, 0.72);
    margin: 0 0 0.65rem 0;
    border-bottom: 1px solid rgba(200, 169, 110, 0.18);
    padding-bottom: 0.45rem;
}

.series-cast-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(200, 169, 110, 0.14);
    border-radius: 8px;
    background: rgba(12, 10, 8, 0.35);
    overflow: hidden;
}

.series-cast-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1.25rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(200, 169, 110, 0.1);
}

.series-cast-list li:last-child {
    border-bottom: none;
}

.series-cast-part {
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.84rem;
    color: #e8d4a8;
    letter-spacing: 0.02em;
}

.series-cast-actor {
    font-size: 0.8rem;
    color: rgba(230, 223, 211, 0.72);
    text-align: right;
    max-width: 22rem;
}

.series-cast-list--roles .series-cast-actor {
    text-align: right;
}

.series-note-box {
    background: rgba(200, 169, 110, 0.06);
    border: 1px solid rgba(200, 169, 110, 0.2);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 0;
}

.series-note-box p {
    font-size: 0.88rem;
    color: rgba(230, 223, 211, 0.74);
    line-height: 1.65;
    margin: 0;
}

.series-note-box strong {
    color: #c8a96e;
    font-weight: normal;
}

@media screen and (min-width: 721px) {
    .series-feature {
        align-items: stretch;
    }

    .series-poster-frame {
        align-self: stretch;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .series-poster {
        flex: 1 1 auto;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        min-height: 0;
        height: 100%;
        aspect-ratio: unset;
    }
}

@media screen and (max-width: 720px) {
    .series-feature {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.35rem 1.25rem;
    }

    .series-meta-line {
        justify-content: center;
    }

    .series-imdb-rating {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 0.35rem;
    }

    .series-cast-list li {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .series-cast-actor {
        text-align: center;
        max-width: none;
    }

    /* Hide trailers on mobile/tablet narrow screens */
    .series-trailer-box {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .tabs.tabs--series {
        flex-direction: column;
        align-items: stretch;
    }

    .tabs--series .tab-btn {
        width: 100%;
    }
}

/* Games page */

.games-page .games-text {
    text-align: center;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    color: rgba(230, 223, 211, 0.82);
    font-size: 0.98rem;
    line-height: 1.6;
}

/* Game entry cards */
.game-entry {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(200, 169, 110, 0.22);
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    margin-bottom: 2.5rem;
}

.game-entry:last-child {
    margin-bottom: 0;
}

/* Two-column layout: cover on left, info on right */
.game-entry-inner {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 1.75rem 2rem;
    align-items: start;
    padding: 1.5rem 1.65rem;
}

.game-cover-frame {
    position: relative;
}

.game-cover {
    width: 100%;
    max-height: 600px;
    background: rgba(40, 32, 20, 0.85);
    border-radius: 8px;
    border: 1px solid rgba(200, 169, 110, 0.22);
    overflow: hidden;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.game-cover:hover {
    border-color: rgba(200, 169, 110, 0.5);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
    transform: translateY(-2px);
}

.game-cover:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.55);
    border-color: rgba(200, 169, 110, 0.55);
}

.game-cover img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 0;
    pointer-events: none;
}

/* Platform tags below the cover */
.game-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
    justify-content: center;
}

.game-platform-tag {
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    border: 1px solid rgba(200, 169, 110, 0.28);
    border-radius: 4px;
    padding: 3px 8px;
    color: rgba(200, 169, 110, 0.75);
    background: rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

/* Right column text */
.game-info h2 {
    font-family: "Cinzel", Georgia, serif;
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    color: #c8a96e;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0;
    border-bottom: none;
    letter-spacing: 0.04em;
}

.game-info h2 a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.game-info h2 a:hover {
    color: rgba(232, 212, 168, 0.98);
    text-decoration: none;
}

.game-info h2 a:focus-visible {
    outline: 2px solid rgba(200, 169, 110, 0.55);
    outline-offset: 3px;
    border-radius: 2px;
}

.game-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 1rem 0;
    align-items: center;
}

.game-badge {
    font-size: 0.7rem;
    font-family: "Cinzel", Georgia, serif;
    letter-spacing: 0.06em;
    border: 1px solid rgba(200, 169, 110, 0.32);
    border-radius: 4px;
    padding: 3px 9px;
    color: rgba(200, 169, 110, 0.82);
    background: rgba(0, 0, 0, 0.2);
}

.game-rating {
    margin-left: 0.45rem;
    padding-left: 0.55rem;
    border-left: 1px solid rgba(200, 169, 110, 0.22);
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: rgba(200, 169, 110, 0.88);
    white-space: nowrap;
}

.game-rating-star {
    margin-right: 0.15rem;
    color: rgba(200, 169, 110, 0.95);
}

.game-rating-value {
    color: rgba(230, 223, 211, 0.88);
}

.game-rating-label {
    color: rgba(230, 223, 211, 0.706);
    font-size: 0.68rem;
    margin-left: 0.15rem;
}

.game-synopsis {
    font-size: 0.92rem;
    color: rgba(230, 223, 211, 0.78);
    line-height: 1.65;
    margin: 0 0 1.25rem 0;
}

/* Subsections inside a game entry */
.game-subsection {
    margin-top: 1.5rem;
}

.game-section-label {
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.72em;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(200, 169, 110, 0.72);
    margin: 0 0 0.65rem 0;
    border-bottom: 1px solid rgba(200, 169, 110, 0.18);
    padding-bottom: 0.45rem;
}

/* Stat list stacked vertically in the left column */
.game-stats-left {
    list-style: none;
    margin: 0.65rem 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid rgba(200, 169, 110, 0.14);
    border-radius: 6px;
    background: rgba(12, 10, 8, 0.35);
    overflow: hidden;
}

.game-stats-left li {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(200, 169, 110, 0.08);
    font-size: 0.82rem;
    color: rgba(230, 223, 211, 0.78);
    line-height: 1.4;
}

.game-stats-left li:last-child {
    border-bottom: none;
}

.game-stats-left li strong {
    display: block;
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.65rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(200, 169, 110, 0.65);
    margin-bottom: 0.15rem;
}

/* Note box */
.game-note-box {
    background: rgba(200, 169, 110, 0.06);
    border: 1px solid rgba(200, 169, 110, 0.2);
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 1.25rem;
}

.game-note-box p {
    font-size: 0.88rem;
    color: rgba(230, 223, 211, 0.74);
    line-height: 1.65;
    margin: 0;
}

.game-note-box strong {
    color: #c8a96e;
    font-weight: normal;
}

/* Trailer embed inside a game entry */
.game-trailer-box {
    margin-top: 0;
    border: 1px solid rgba(200, 169, 110, 0.2);
    border-radius: 8px;
    background: rgba(13, 10, 8, 0.68);
    padding: 0.75rem;
}

.game-trailer-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(200, 169, 110, 0.2);
}

.game-trailer-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media screen and (min-width: 721px) {
    .game-cover-frame {
        display: flex;
        flex-direction: column;
    }
}

@media screen and (max-width: 720px) {
    .game-entry-inner {
        grid-template-columns: 1fr;
        padding: 1.35rem 1.25rem;
        text-align: center;
    }

    .game-meta-line {
        justify-content: center;
    }

    .game-rating {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 0.35rem;
    }

    .game-cover {
        max-width: 100%;
        max-height: 160px;
    }
}

/* Feedback modal (full-screen overlay) */

.feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    box-sizing: border-box;
}

.feedback-modal[hidden] {
    display: none !important;
}

@keyframes feedbackBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes feedbackPanelIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes feedbackBackdropOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes feedbackPanelOut {
    from { opacity: 1; transform: translateY(0)   scale(1); }
    to   { opacity: 0; transform: translateY(8px) scale(0.98); }
}

.feedback-modal.is-opening .feedback-modal-backdrop {
    animation: feedbackBackdropIn 0.2s ease forwards;
}

.feedback-modal.is-opening .feedback-modal-panel {
    animation: feedbackPanelIn 0.22s cubic-bezier(0.2, 0, 0.3, 1) forwards;
}

.feedback-modal.is-closing .feedback-modal-backdrop {
    animation: feedbackBackdropOut 0.18s ease forwards;
}

.feedback-modal.is-closing .feedback-modal-panel {
    animation: feedbackPanelOut 0.18s ease forwards;
}

.feedback-modal-backdrop {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(0, 0, 0, 0.72);
    cursor: pointer;
}

.feedback-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 34rem;
    max-height: 92vh;
    overflow-y: auto;
    box-sizing: border-box;
    background: rgba(10, 8, 7, 0.88);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 1.1rem;
    padding: 1.85rem 1.75rem 1.65rem;
    backdrop-filter: blur(12px);
    box-shadow:
        0 20px 56px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.feedback-modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    background: rgba(18, 14, 12, 0.7);
    border: 1px solid rgba(200, 169, 110, 0.3);
    border-radius: 50%;
    color: rgba(230, 223, 211, 0.8);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.feedback-modal-close:hover {
    background: rgba(28, 22, 18, 0.98);
    border-color: rgba(232, 212, 168, 0.55);
}

.feedback-modal-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.45);
}

.feedback-modal-title {
    font-family: "Cinzel", Georgia, serif;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: #e8d4a8;
    margin: 0 0 0.35rem 0;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(200, 169, 110, 0.2);
    letter-spacing: 0.04em;
}

.feedback-modal-text {
    font-size: 0.88rem;
    color: rgba(230, 223, 211, 0.78);
    margin: 0.55rem 0 1.15rem 0;
    line-height: 1.5;
}

/* Feedback modal: form fields */
.feedback-modal .form-group {
    margin-bottom: 0.75rem;
}

.feedback-modal .form-group:last-of-type {
    margin-bottom: 0;
}

.feedback-modal .form-group label {
    display: block;
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(200, 169, 110, 0.8);
    margin-bottom: 0.35rem;
}

.feedback-modal .form-group input,
.feedback-modal .form-group textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: rgba(12, 10, 8, 0.55);
    border: 1px solid rgba(200, 169, 110, 0.28);
    border-radius: 6px;
    color: rgba(230, 223, 211, 0.9);
    font-family: "Lora", Georgia, serif;
    font-size: 0.88rem;
    padding: 0.52em 0.75em;
}

.feedback-modal .form-group textarea {
    resize: vertical;
    min-height: 5.25rem;
}

.feedback-modal .form-group input::placeholder,
.feedback-modal .form-group textarea::placeholder {
    color: rgba(138, 128, 117, 0.7);
}

.feedback-modal .form-group input:focus-visible,
.feedback-modal .form-group textarea:focus-visible {
    outline: 1.5px solid rgba(200, 169, 110, 0.7);
    outline-offset: 2px;
}

.feedback-modal .form-group-submit {
    margin-top: 1.15rem;
    margin-bottom: 0;
    display: flex;
    gap: 0.65rem;
}

.feedback-modal .form-group-submit button {
    flex: 1;
    padding: 0.65em 1em;
    background: rgba(18, 14, 12, 0.55);
    border: 1px solid rgba(200, 169, 110, 0.4);
    border-radius: 7px;
    color: rgba(230, 223, 211, 0.9);
    font-family: "Cinzel", Georgia, serif;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition:
        filter 0.2s ease,
        box-shadow 0.2s ease;
}

.feedback-modal .form-group-submit button[type="submit"] {
    background: linear-gradient(135deg, rgba(200, 169, 110, 0.32), rgba(160, 130, 80, 0.26));
    border-color: rgba(200, 169, 110, 0.65);
    color: #e8d4a8;
}

.feedback-modal .form-group-submit button:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 18px rgba(200, 169, 110, 0.35), 0 4px 16px rgba(0,0,0,0.35);
}

.feedback-modal .form-group-submit button:focus-visible {
    outline: 1.5px solid rgba(200, 169, 110, 0.7);
    outline-offset: 2px;
}

.feedback-modal .form-group-submit button:disabled {
    opacity: 0.85;
    cursor: default;
}