

:root {

    --tdt-cream: #fff8e8;
    --tdt-cream-light: #fffbf0;
    --tdt-beige: #c4b59a;
    --tdt-beige-light: #d8cbb0;
    --tdt-beige-lighter: #e8ddd0;
    --tdt-beige-warm: #d4c5a8;
    --tdt-brown: #8b7355;
    --tdt-brown-light: #a0886b;
    --tdt-dark-red: #6b2828;
    --tdt-dark-red-light: #7a3232;
    --tdt-burgundy: #4a1818;
    --tdt-burgundy-light: #5c2222;
    --tdt-burgundy-warm: #5a1f1f;
    --tdt-mint: #a0fdda;
    --tdt-mint-light: #87fccf;
    --tdt-mint-dark: #7fdec0;
    --tdt-gold: #f5e6c4;
    --tdt-theme-color: #5a1f1f;

    --bg-image: url(../assets/images/2023/02/cropped-site-background-1.jpg);
    --bg-pattern: url(../assets/images/bg.jpg);

    --font-heading: 'Texturina', 'Fondamento', serif;
    --font-body: 'Fanwood Text', 'Quattrocento', serif;

    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 3.5rem;

    --transition-fast: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.7s cubic-bezier(0.4, 0, 0.2, 1);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow-mint: 0 0 20px rgba(160, 253, 218, 0.5);
    --shadow-glow-beige: 0 0 20px rgba(217, 205, 184, 0.3);

    --card-shadow:
        0 0 0 1px var(--tdt-beige-light),
        0 0 0 2px var(--tdt-burgundy-warm),
        0 0 0 4px var(--tdt-beige-light),
        0 0 0 5px var(--tdt-burgundy-warm),
        inset 4px 4px 8px rgba(0, 0, 0, 0.25),
        inset -4px -4px 8px rgba(0, 0, 0, 0.15),
        inset 0 0 20px rgba(0, 0, 0, 0.1),
        var(--shadow-sm);
    --card-shadow-hover:
        0 0 0 1px var(--tdt-beige-light),
        0 0 0 3px var(--tdt-burgundy-warm),
        0 0 0 5px var(--tdt-beige-light),
        0 0 0 6px var(--tdt-burgundy-warm),
        0 0 20px 8px rgba(90, 31, 31, 0.5),
        inset 5px 5px 12px rgba(0, 0, 0, 0.3),
        inset -5px -5px 12px rgba(0, 0, 0, 0.2),
        inset 0 0 25px rgba(0, 0, 0, 0.15),
        var(--shadow-md);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --touch-min: 44px;
}

@font-face {
    font-family: 'Fanwood Text';
    font-style: italic;
    font-weight: 400;
    src: url(https://fonts.wp.com/s/fanwoodtext/v17/3XFzErwl05Ad_vSCF6Fq7xX2R-zV_Pw.ttf) format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Fanwood Text';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.wp.com/s/fanwoodtext/v17/3XFtErwl05Ad_vSCF6Fq7xX2TNzc.ttf) format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Quattrocento';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.wp.com/s/quattrocento/v24/OZpEg_xvsDZQL_LKIF7q4jP3zWj_.ttf) format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Quattrocento';
    font-style: normal;
    font-weight: 700;
    src: url(https://fonts.wp.com/s/quattrocento/v24/OZpbg_xvsDZQL_LKIF7q4jP_eE3vfqnd.ttf) format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Texturina';
    font-style: normal;
    font-weight: 400;
    src: url('../assets/fonts/c4mM1nxpEtL3pXiAulRTkY-HGmNEX1b9NspjMwhAgliHhVrXy2eYGvUl25riW1OD.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'Texturina';
    font-style: normal;
    font-weight: 900;
    src: url('../assets/fonts/c4mM1nxpEtL3pXiAulRTkY-HGmNEX1b9NspjMwhAgliHhVrXy2cxHfUl25riW1OD.woff2') format('woff2');
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--tdt-dark-red);

    background: linear-gradient(
        135deg,
        rgba(90, 31, 31, 0.95) 0%,
        rgba(74, 24, 24, 0.98) 50%,
        rgba(58, 16, 16, 1) 100%
    );
    background-position: left top;
    background-size: auto;
    background-repeat: repeat;
    background-attachment: scroll;
    color: var(--tdt-cream);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar {
    display: none;
}

.tdt-scrollable::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}
.tdt-scrollable::-webkit-scrollbar-track {
    background: var(--tdt-burgundy);
    border-radius: var(--radius-sm);
}
.tdt-scrollable::-webkit-scrollbar-thumb {
    background: var(--tdt-brown);
    border-radius: var(--radius-sm);
    border: 1px solid var(--tdt-beige);
}
.tdt-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--tdt-brown-light);
}
.tdt-scrollable {
    scrollbar-width: thin;
    scrollbar-color: var(--tdt-brown) var(--tdt-burgundy);
}

.webgl-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: multiply;
}

.webgl-header-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
    mix-blend-mode: overlay;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(
            ellipse at 30% 20%,
            rgba(160, 253, 218, 0.08) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse at 70% 80%,
            rgba(245, 230, 196, 0.06) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse at center,
            transparent 0%,
            transparent 40%,
            rgba(90, 31, 31, 0.3) 70%,
            rgba(42, 15, 15, 0.6) 85%,
            rgba(20, 5, 5, 0.85) 100%
        );
    animation: mysticalPulse 20s ease-in-out infinite alternate;
}

@keyframes mysticalPulse {
    0% {
        opacity: 0.7;
        filter: hue-rotate(0deg);
    }
    100% {
        opacity: 0.9;
        filter: hue-rotate(15deg);
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--tdt-cream);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);

    text-shadow:
        2px 2px 0px rgba(90, 31, 31, 0.5),
        4px 4px 8px rgba(0, 0, 0, 0.4),
        0 0 16px rgba(245, 230, 196, 0.3),
        0 0 32px rgba(245, 230, 196, 0.1);
    letter-spacing: 0.05em;
    position: relative;
}

.site-title {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 24px rgba(245, 230, 196, 0.4));
    animation: titleGlow 4s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        text-shadow:
            2px 2px 0px rgba(90, 31, 31, 0.5),
            4px 4px 8px rgba(0, 0, 0, 0.4),
            0 0 16px rgba(245, 230, 196, 0.3),
            0 0 32px rgba(245, 230, 196, 0.1);
    }
    100% {
        text-shadow:
            2px 2px 0px rgba(90, 31, 31, 0.5),
            4px 4px 8px rgba(0, 0, 0, 0.4),
            0 0 24px rgba(245, 230, 196, 0.5),
            0 0 48px rgba(160, 253, 218, 0.2),
            0 0 64px rgba(245, 230, 196, 0.15);
    }
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--tdt-cream);
    max-width: 75ch;
}

code {
    background: rgba(90, 31, 31, 0.6);
    color: var(--tdt-beige-warm);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

a {
    color: var(--tdt-beige-warm);
    text-decoration: none;
    transition: all var(--transition-normal);
}

a:hover, a:focus {
    color: var(--tdt-cream);
    text-shadow: 0 0 8px rgba(255, 245, 221, 0.5);
}

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

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--tdt-burgundy);
    color: var(--tdt-cream);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    top: 0;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.site-header {
    position: relative;
    z-index: 100;
    margin-bottom: var(--spacing-md);
}

.header-bg {

    background:
        linear-gradient(
            to bottom,
            rgba(74, 24, 24, 0.75) 0%,
            rgba(58, 20, 20, 0.6) 50%,
            rgba(74, 24, 24, 0.85) 100%
        ),
        url('../assets/images/cropped-site-background-1.jpg');
    background-repeat: no-repeat, no-repeat;
    background-position: center center, center top;
    background-size: cover, cover;
    background-attachment: fixed, fixed;
    padding: var(--spacing-md) var(--spacing-md);
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.header-top-row {
    display: grid;
    grid-template-columns: 1fr minmax(560px, 1fr) 1fr;
    gap: var(--spacing-md);
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.header-top-row .site-branding {
    grid-column: 2;
    min-width: 560px;
    width: 100%;
    max-width: 100%;
    text-align: center;
    margin: 0 auto;
    justify-self: center;
    box-sizing: border-box;
}

.header-top-row .galleries-cycling-slot {
    position: fixed;
    top: var(--spacing-md, 1rem);
    left: var(--spacing-md, 1rem);
    z-index: 1000;
    min-height: 200px;
    min-width: 200px;
    text-align: left;

    width: auto;
}

.header-top-row .galleries-cycling-slot .gallery-carousel--small {
    max-width: 200px;
    margin-left: 0;
    margin-right: auto;
}

.header-top-row .galleries-cycling-slot .gallery-carousel--small .carousel-wrapper {
    aspect-ratio: 1 / 1;
}

.header-top-row .three-col-title {
    font-size: 1rem;
    margin: var(--spacing-xs) 0 0;
}

.header-top-row .three-col-subtitle {
    font-size: 0.8rem;
    margin: 0;
}

.header-top-row .soundcloud-cycling-wrap {
    position: fixed;
    top: var(--spacing-md, 1rem);
    right: var(--spacing-md, 1rem);
    z-index: 1000;
    max-width: 160px;

    min-width: 100px;
    min-height: 100px;
}

.header-top-row .soundcloud-vignette {
    position: relative;
    width: 100px;
    height: 100px;
    max-width: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
}

@keyframes tdt-soundcloud-beige-glow {
    0%,
    100% {
        box-shadow:
            0 0 0 0 rgba(245, 230, 196, 0.0),
            0 0 10px 2px rgba(245, 230, 196, 0.14);
    }
    50% {
        box-shadow:
            0 0 18px 4px rgba(245, 230, 196, 0.32),
            0 0 40px 10px rgba(245, 230, 196, 0.16);
    }
}

.header-top-row .soundcloud-cycling-wrap.soundcloud-playing .soundcloud-vignette {
    animation: tdt-soundcloud-beige-glow 2s ease-in-out infinite;
}

.header-top-row .soundcloud-vignette::after {
    content: "♪";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--tdt-dark-red);
    font-size: 1.75rem;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.header-top-row .soundcloud-vignette.soundcloud-stopped::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 140%;
    height: 3px;
    background: var(--tdt-dark-red);
    transform: translate(-50%, -50%) rotate(-45deg);
    pointer-events: none;
    z-index: 3;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.header-top-row .soundcloud-embed {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 160px;
    height: 160px;
    margin-left: -80px;
    margin-top: -80px;
}

.soundcloud-click-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    cursor: pointer;
    border-radius: 50%;
    background: transparent;
}

@media (max-width: 1024px) {
    .header-top-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .header-top-row .galleries-cycling-slot {
        order: 2;
        min-height: 180px;
    }

    .header-top-row .site-branding {
        order: 1;
        grid-column: 1;
        min-width: auto;
    }

    .header-top-row .soundcloud-cycling-wrap {
        order: 3;
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .header-bg {
        background-attachment: scroll;
    }

    .header-top-row .galleries-cycling-slot {
        display: none !important;
    }

    .header-top-row .soundcloud-cycling-wrap {
        display: none !important;
    }

    .header-top-row .site-branding {
        grid-column: 1;
        min-width: auto;
        width: 100%;
    }

    .menu-toggle,
    .tab-link,
    .lang-btn {
        min-height: var(--touch-min);
        padding: var(--spacing-sm) var(--spacing-md);
    }
    .menu-toggle {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    .lang-btn {
        padding: var(--spacing-sm) 1rem;
    }
    .archive-toggle-wrap {
        min-height: var(--touch-min);
        padding: var(--spacing-sm) var(--spacing-md);
        white-space: normal;
    }

    .branding-flip:focus-within .branding-flip-front {
        clip-path: circle(0% at 50% 50%);
        opacity: 0;
    }
    .branding-flip:focus-within .branding-flip-back {
        clip-path: circle(150% at 50% 50%);
        opacity: 1;
    }
}

@media screen and (max-width: 768px) {
    .galleries-cycling-slot,
    .galleries-cycling-slot.galleries-slot-hidden {
        opacity: 1 !important;
        transition: none !important;
    }

    .gallery-panel,
    .gallery-panel.active {
        transition: none !important;
    }

    .soundcloud-cycling-wrap,
    .soundcloud-cycling-wrap.soundcloud-hidden {
        opacity: 1 !important;
        transition: none !important;
    }
}

.galleries-cycling-slot.mobile-relocated {
    display: block !important;
    position: static !important;
    text-align: center;
    padding: var(--spacing-md, 1rem) var(--spacing-sm, 0.5rem);
    min-height: auto;
    min-width: auto;
    width: 100%;
    z-index: auto;
}

.galleries-cycling-slot.mobile-relocated .gallery-carousel--small {
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
}

.galleries-cycling-slot.mobile-relocated .three-col-title,
.galleries-cycling-slot.mobile-relocated .three-col-subtitle {
    text-align: center;
}

.soundcloud-cycling-wrap.mobile-relocated {
    display: block !important;
    position: fixed !important;
    top: auto !important;
    bottom: var(--spacing-md, 1rem);
    right: var(--spacing-md, 1rem);
    left: auto;
    z-index: 1000;
    max-width: 160px;
    min-width: 100px;
    min-height: 100px;
    opacity: 1 !important;
    transition: none !important;
}

.soundcloud-cycling-wrap.mobile-relocated .soundcloud-vignette {
    position: relative;
    width: 100px;
    height: 100px;
    max-width: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
}

.soundcloud-cycling-wrap.mobile-relocated.soundcloud-playing .soundcloud-vignette {
    animation: tdt-soundcloud-beige-glow 2s ease-in-out infinite;
}

.soundcloud-cycling-wrap.mobile-relocated .soundcloud-vignette::after {
    content: "♪";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--tdt-dark-red);
    font-size: 1.75rem;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.soundcloud-cycling-wrap.mobile-relocated .soundcloud-vignette.soundcloud-stopped::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 140%;
    height: 3px;
    background: var(--tdt-dark-red);
    transform: translate(-50%, -50%) rotate(-45deg);
    pointer-events: none;
    z-index: 3;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.soundcloud-cycling-wrap.mobile-relocated .soundcloud-embed {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 160px;
    height: 160px;
    margin-left: -80px;
    margin-top: -80px;
}

@media (prefers-reduced-motion: reduce) {
    .header-top-row .soundcloud-cycling-wrap.soundcloud-playing .soundcloud-vignette {
        animation: none;
    }
}

.decorated-container {
    position: relative;

    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4))
            drop-shadow(0 8px 24px rgba(90, 31, 31, 0.3))
            drop-shadow(0 0 40px rgba(245, 230, 196, 0.1));
}

.header-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(
            ellipse at center top,
            rgba(245, 230, 196, 0.15) 0%,
            transparent 60%
        );
    z-index: 1;
    pointer-events: none;
}

.site-branding {
    position: relative;
    z-index: 2;
}

.site-logo {
    max-width: 100px;
    height: auto;
    margin: 0 auto var(--spacing-md);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    animation: logo-idle 4s ease-in-out infinite;
}

@keyframes logo-idle {
    0%   { transform: rotate(0deg); }
    50%  { transform: rotate(180deg); }
    100% { transform: rotate(0deg); }
}

.site-logo.logo-spin-cw {
    animation: logo-burst-cw 2s ease-out;
}
.site-logo.logo-spin-ccw {
    animation: logo-burst-ccw 2s ease-out;
}
@keyframes logo-burst-cw {
    from { transform: rotate(0deg); }
    to   { transform: rotate(720deg); }
}
@keyframes logo-burst-ccw {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-720deg); }
}

.site-tagline {
    max-width: 75ch;
    margin: 0 auto var(--spacing-xs);
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.site-tagline-muted {
    font-size: 1rem;
    color: var(--tdt-beige-warm);
}

.site-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
}

.site-title a {
    color: var(--tdt-cream);
    text-decoration: none;
}

.site-genre {
    font-size: 1.1rem;
    color: var(--tdt-beige-warm);
    font-style: italic;
    max-width: 75ch;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.branding-flip {
    min-height: 320px;
    position: relative;
    margin: 0 auto;
}

.branding-flip-inner {
    position: relative;
    width: 100%;
    min-height: 320px;
}

.branding-flip-front,
.branding-flip-back {
    position: absolute;
    inset: 0;
    transition: clip-path 0.6s ease, opacity 0.6s ease;
}

.branding-flip-front {
    z-index: 2;
    clip-path: circle(150% at 50% 50%);
    opacity: 1;
}

.branding-flip:hover .branding-flip-front {
    clip-path: circle(0% at 50% 50%);
    opacity: 0;
}

.branding-flip-back {
    z-index: 1;
    clip-path: circle(0% at 50% 50%);
    opacity: 0;
}

.branding-flip:hover .branding-flip-back {
    clip-path: circle(150% at 50% 50%);
    opacity: 1;
}

.branding-flip-back-oval {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 4px solid var(--tdt-beige-warm);
    box-shadow:
        0 0 0 2px var(--tdt-burgundy-warm),
        0 0 0 4px var(--tdt-beige-warm),
        0 0 60px 8px rgba(212, 197, 168, 0.45),
        inset 0 0 60px 15px rgba(74, 24, 24, 0.6);
}

.branding-flip-back-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-md);
    background-image:
        linear-gradient(135deg, rgba(84, 32, 32, 0.5) 0%, rgba(46, 28, 28, 0.3) 40%, rgba(45, 28, 28, 0.88) 70%, rgba(54, 0, 1, 0.92) 100%),
        url('../assets/images/kickstarter-copy.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.branding-flip-headline {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 700;
    color: var(--tdt-cream);
    margin: 0 0 var(--spacing-xs);
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 1), 0 3px 10px rgba(0, 0, 0, 0.9);
}

.branding-flip-cta {
    margin: var(--spacing-xs) 0;
}

.branding-flip-subline {
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    font-style: italic;
    color: var(--tdt-beige-warm);
    margin: 0;
    line-height: 1.6;
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 1), 0 3px 10px rgba(0, 0, 0, 0.9);
}

.main-navigation {
    background:
        linear-gradient(to bottom, var(--tdt-dark-red) 0%, var(--tdt-burgundy-warm) 100%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 20px,
            rgba(212, 197, 168, 0.05) 20px,
            rgba(212, 197, 168, 0.05) 40px
        );
    border-top: 4px double var(--tdt-beige-warm);
    border-bottom: 4px double var(--tdt-beige-warm);
    padding: var(--spacing-sm) 0;
    position: relative;
    z-index: 99;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(90, 31, 31, 0.4),
        inset 0 2px 0 rgba(245, 230, 196, 0.15),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    position: relative;
}

.main-navigation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--tdt-gold) 20%,
        var(--tdt-gold) 80%,
        transparent
    );
    opacity: 0.6;
}

.main-navigation::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--tdt-gold) 20%,
        var(--tdt-gold) 80%,
        transparent
    );
    opacity: 0.4;
}

.menu {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md);
}

.menu-item {
    margin: 0;
}

.tab-link {
    display: block;
    padding: var(--spacing-xs) var(--spacing-md);
    color: var(--tdt-beige-warm);
    font-family: var(--font-heading);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    position: relative;
}

.tab-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--tdt-beige-warm);
    transition: transform var(--transition-normal);
    box-shadow: 0 0 8px rgba(232, 221, 208, 0.5);
}

.tab-link:hover,
.tab-link:focus {
    color: var(--tdt-cream);
    background:
        linear-gradient(135deg, rgba(232, 221, 208, 0.3), rgba(245, 230, 196, 0.2)),
        rgba(232, 221, 208, 0.15);
    box-shadow:
        0 0 20px rgba(232, 221, 208, 0.5),
        0 0 40px rgba(245, 230, 196, 0.3),
        inset 0 1px 2px rgba(255, 248, 232, 0.4),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
    text-shadow:
        0 0 8px rgba(255, 248, 232, 0.6),
        0 0 16px rgba(245, 230, 196, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.tab-link.active {
    color: var(--tdt-cream);
    background: rgba(232, 221, 208, 0.35);
    text-shadow: 0 0 10px rgba(255, 248, 232, 0.5);
    box-shadow: inset 0 2px 4px rgba(255, 248, 232, 0.3);
}

.tab-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

.menu-toggle {
    display: none;
    background: var(--tdt-burgundy);
    color: var(--tdt-cream);
    border: 2px solid var(--tdt-beige);
    padding: var(--spacing-xs) var(--spacing-md);
    font-family: var(--font-heading);
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin: 0 auto var(--spacing-sm);
    transition: all var(--transition-normal);
}

.menu-toggle:hover,
.menu-toggle:focus {
    box-shadow: 0 0 15px rgba(217, 205, 184, 0.5);
    text-shadow: 0 0 8px rgba(255, 245, 221, 0.5);
}

.language-toggle {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    border-top: 1px solid rgba(217, 205, 184, 0.3);
}

.lang-btn {
    background: transparent;
    color: var(--tdt-beige-warm);
    border: 1px solid var(--tdt-beige-warm);
    padding: 4px 12px;
    cursor: pointer;
    font-family: var(--font-heading);
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--tdt-beige-warm);
    color: var(--tdt-burgundy-warm);
    border-color: var(--tdt-beige-warm);
    box-shadow:
        0 0 12px rgba(232, 221, 208, 0.6),
        inset 0 1px 3px rgba(255, 248, 232, 0.4);
}

.archive-toggle-wrap {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    border-top: 1px solid rgba(217, 205, 184, 0.3);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--tdt-beige-warm);
    white-space: nowrap;
}
.archive-toggle-wrap:hover {
    color: var(--tdt-cream);
}
.archive-toggle {
    margin: 0;
    cursor: pointer;
}

body.archived-hidden .archived-section {
    display: none !important;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in;
    min-height: 60vh;
    position: relative;
    z-index: 2;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

@media (max-width: 360px) {
    .container {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }
}

.section-content,
.lore-section,
.rules-content,
.discovery-unified-section {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.section-content input,
.section-content textarea,
.section-content [contenteditable="true"],
.rules-content input,
.rules-content textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

img {
    -webkit-user-drag: none;
    pointer-events: auto;
}

@media print {
    body::before {
        content: "© 2020-2026 The Discording Tales / Des Récits Discordants — All Rights Reserved — Unauthorized reproduction prohibited";
        display: block;
        text-align: center;
        font-size: 10pt;
        color: #740000;
        padding: 10px;
        border-bottom: 2px solid #740000;
        margin-bottom: 20px;
    }
    body::after {
        content: "This document is copyrighted. Reproduction, distribution, or derivative works are prohibited without express written permission.";
        display: block;
        text-align: center;
        font-size: 9pt;
        color: #740000;
        padding: 10px;
        border-top: 2px solid #740000;
        margin-top: 20px;
    }

    .soundcloud-cycling-wrap,
    .cta-button,
    nav,
    .tab-nav {
        display: none !important;
    }
}

.copyright-notice {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(244, 225, 169, 0.2);
    text-align: center;
}

.copyright-notice p {
    font-size: 0.75rem;
    color: rgba(244, 225, 169, 0.7);
    line-height: 1.5;
    margin: 0.25rem 0;
}

.copyright-notice .copyright-legal {
    font-size: 0.65rem;
    color: rgba(244, 225, 169, 0.4);
    max-width: 600px;
    margin: 0.5rem auto 0;
}

.discovery-kickstarter-wrap {
    padding: var(--spacing-lg) var(--spacing-md);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
    margin-top: -13rem;
}

.discovery-kickstarter-oval {
    width: 85%;
    max-width: 520px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 4px solid var(--tdt-beige-warm);
    box-shadow:
        0 0 0 2px var(--tdt-burgundy-warm),
        0 0 0 4px var(--tdt-beige-warm),
        0 0 0 6px var(--tdt-burgundy-warm),
        0 0 0 8px var(--tdt-beige-warm),
        0 0 60px 8px rgba(212, 197, 168, 0.45),
        0 0 100px 20px rgba(212, 197, 168, 0.25),
        inset 0 0 80px 20px rgba(74, 24, 24, 0.7),
        inset 0 0 40px 8px rgba(58, 20, 20, 0.5),
        inset 6px 6px 15px rgba(0, 0, 0, 0.3),
        inset -6px -6px 15px rgba(0, 0, 0, 0.2),
        var(--shadow-md);
}

.discovery-kickstarter-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: clamp(1.5rem, 5vw, 3rem);
    background-image:
        linear-gradient(135deg, rgba(84, 32, 32, 0.5) 0%, rgba(46, 28, 28, 0.25) 40%, rgba(45, 28, 28, 0.88) 70%, rgba(54, 0, 1, 0.92) 100%),
        url('../assets/images/kickstarter-copy.jpg');
    background-size: cover;
    background-position: center var(--oval-bg-y, 50%);
    background-repeat: no-repeat;
}

.discovery-kickstarter-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin: 0 0 var(--spacing-sm);
    color: var(--tdt-cream);
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 1), 0 3px 10px rgba(0, 0, 0, 0.9);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.discovery-kickstarter-tagline {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-style: italic;
    color: var(--tdt-beige-warm);
    max-width: 52ch;
    margin: 0 0 var(--spacing-md);
    line-height: 1.8;
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 1), 0 3px 10px rgba(0, 0, 0, 0.9);
}

.discovery-kickstarter-discord {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--tdt-cream);
    letter-spacing: 3px;
    margin: 0 0 var(--spacing-md);
    text-align: center;
    text-shadow: 0 0 6px rgba(0, 0, 0, 1), 0 2px 6px rgba(0, 0, 0, 1), 0 4px 16px rgba(0, 0, 0, 0.95);
}

.discovery-kickstarter-discord-line1,
.discovery-kickstarter-discord-line2 {
    display: block;
}

.discovery-kickstarter-discord-line2 {
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.discovery-kickstarter-cta {
    margin: var(--spacing-xs) 0 var(--spacing-sm);
}

.discovery-kickstarter-headline {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    font-weight: 700;
    color: var(--tdt-cream);
    margin: var(--spacing-xs) 0 0;
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 1), 0 3px 10px rgba(0, 0, 0, 0.9);
}

.discovery-kickstarter-subline {
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    font-style: italic;
    color: var(--tdt-beige-warm);
    margin: 0;
    line-height: 1.8;
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 1), 0 3px 10px rgba(0, 0, 0, 0.9);
}

@media (max-width: 480px) {
    .discovery-kickstarter-oval {
        aspect-ratio: 3 / 4;
        width: 96%;
    }
}

.discovery-unified-section .container {
    max-width: 900px;
}

.discovery-unified-hero {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.discovery-unified-title {
    margin-bottom: var(--spacing-md);
}

.discovery-unified-tagline {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-style: italic;
    color: var(--tdt-beige-warm);
    max-width: 65ch;
    margin: 0 auto;
    line-height: 1.8;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.discovery-unified-game {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(212, 197, 168, 0.25);
    text-align: center;
}

.discovery-unified-game .unified-two-columns {
    margin-top: var(--spacing-md);
    text-align: left;
}

.discovery-unified-outpost {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(212, 197, 168, 0.25);
    text-align: center;
}

.discovery-unified-outpost .outpost-title {
    margin-bottom: var(--spacing-md);
}

.discovery-unified-outpost .outpost-tagline {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-style: italic;
    color: var(--tdt-beige-warm);
    max-width: 52ch;
    margin: 0 auto var(--spacing-lg);
    line-height: 1.7;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.discovery-unified-outpost .outpost-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
    align-items: center;
    max-width: 560px;
    margin: 0 auto;
}

.section-subtitle {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--tdt-cream);
    text-align: center;
    margin: 0 0 var(--spacing-md);
    text-decoration: underline;
    text-decoration-color: var(--tdt-beige-warm);
    text-underline-offset: 6px;
    text-shadow: 2px 2px 4px rgba(90, 31, 31, 0.3);
}

.discovery-unified-intro {
    margin: 0 auto var(--spacing-md);
    color: var(--tdt-beige-warm);
    line-height: 1.6;
    text-align: center;
    max-width: 55ch;
}

.cta-container {
    margin-top: var(--spacing-lg);
}

.cta-button {
    display: inline-block;
    background: var(--tdt-cream);
    color: var(--tdt-burgundy);
    padding: var(--spacing-md) var(--spacing-lg);
    min-height: var(--touch-min);
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 3px solid var(--tdt-burgundy);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    text-align: center;
}

.cta-button small {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    margin-top: var(--spacing-xs);
    text-transform: none;
    letter-spacing: 1px;
}

.pitch-wrapper {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    position: relative;
    padding: 5rem var(--spacing-md);
    min-height: 120vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image:
        linear-gradient(to bottom, rgba(74, 24, 24, 0.4) 0%, rgba(58, 20, 20, 0.35) 100%),
        url('../assets/images/AllPeople.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    -webkit-mask-image:
        linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image:
        linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-composite: destination-in;
    mask-composite: intersect;
}

@media screen and (max-width: 768px) {
    .pitch-wrapper {
        padding: 2rem var(--spacing-sm);
        min-height: 80vh;
    }
    .pitch-intro,
    .pitch-golden,
    .pitch-question,
    .pitch-depths {
        margin-bottom: 2.5rem;
    }
}

@media screen and (max-width: 480px) {
    .pitch-wrapper {
        padding: 1.5rem var(--spacing-sm);
    }
    .pitch-intro,
    .pitch-golden,
    .pitch-question,
    .pitch-depths {
        margin-bottom: 1.5rem;
    }
}

.pitch-section {
    max-width: 750px;
    margin: 0 auto;
    padding: 0;
    text-align: center;
    position: relative;
    z-index: 2;
}

.pitch-intro {
    font-size: clamp(1rem, 1.35rem, 1.35rem);
    color: var(--tdt-beige-warm);
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 5rem;
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 1), 0 3px 10px rgba(0, 0, 0, 0.9);
}

.pitch-golden {
    font-size: clamp(1.05rem, 1.4rem, 1.4rem);
    color: var(--tdt-cream);
    line-height: 1.7;
    margin-bottom: 5rem;
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 1), 0 3px 10px rgba(0, 0, 0, 0.9);
}

.pitch-question {
    font-size: clamp(1rem, 1.35rem, 1.35rem);
    color: var(--tdt-beige-warm);
    font-style: italic;
    margin-bottom: 5rem;
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 1), 0 3px 10px rgba(0, 0, 0, 0.9);
}

.pitch-depths {
    font-size: clamp(1rem, 1.5rem, 1.5rem);
    color: var(--tdt-beige-warm);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5rem;
    text-shadow: 0 0 4px rgba(0, 0, 0, 1), 0 1px 4px rgba(0, 0, 0, 1), 0 3px 10px rgba(0, 0, 0, 0.9);
}

.pitch-discord {
    font-size: clamp(2rem, 8vw, 3.2rem);
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--tdt-cream);
    letter-spacing: 4px;
    text-shadow: 0 0 6px rgba(0, 0, 0, 1), 0 2px 6px rgba(0, 0, 0, 1), 0 4px 16px rgba(0, 0, 0, 0.95);
}

.cta-button:hover,
.cta-button:focus {
    background: var(--tdt-cream);
    color: var(--tdt-burgundy);
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-lg), 0 0 25px rgba(255, 245, 221, 0.6);
    text-shadow: 0 0 10px rgba(92, 29, 29, 0.3);
}

.features-section {
    padding: var(--spacing-lg) var(--spacing-md);
    background: rgba(92, 29, 29, 0.5);
    margin: var(--spacing-md) 0;
}

.unified-two-columns {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: var(--spacing-lg);
    align-items: start;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.unified-col {
    color: var(--tdt-cream);
}

.unified-intro {
    margin: 0 0 var(--spacing-sm);
    color: var(--tdt-beige-warm);
    line-height: 1.6;
}

.unified-paths {
    margin: 0;
    color: var(--tdt-cream);
    line-height: 1.8;
}

.unified-paths strong {
    display: block;
}

.unified-depth-heading {
    margin: 0 0 var(--spacing-sm);
    color: var(--tdt-cream);
}

.unified-depth-p1,
.unified-depth-p2 {
    margin: 0 0 var(--spacing-md);
    color: var(--tdt-beige-warm);
    line-height: 1.7;
}

.unified-depth-p2 {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .unified-two-columns {
        grid-template-columns: 1fr;
    }
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    text-decoration: underline;
    text-decoration-color: var(--tdt-beige-warm);
    text-underline-offset: 8px;
    text-shadow: 2px 2px 4px rgba(90, 31, 31, 0.3);
}

.features-grid,
.tetrarchs-grid,
.peoples-gallery,
.genres-grid,
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

@media screen and (max-width: 400px) {
    .features-grid,
    .tetrarchs-grid,
    .peoples-gallery,
    .genres-grid,
    .sources-grid {
        grid-template-columns: 1fr;
    }
}

.features-grid {
    margin-top: var(--spacing-lg);
}

.tetrarchs-grid {
    margin: var(--spacing-md) 0;
}
.tetrarchs-grid--hidden {
    display: none !important;
}

.peoples-gallery {
    margin-top: var(--spacing-md);
}

.genres-grid {
    margin-top: var(--spacing-md);
}

.sources-grid {
    margin: var(--spacing-md) 0;
}

.genre-card {
    background:
        linear-gradient(135deg, var(--tdt-beige-lighter) 0%, var(--tdt-beige-warm) 50%, var(--tdt-beige-light) 100%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(212, 197, 168, 0.1) 10px,
            rgba(212, 197, 168, 0.1) 20px
        );
    border: 4px double var(--tdt-burgundy-warm);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), filter var(--transition-normal);
    box-shadow: var(--card-shadow);
    position: relative;

    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3))
            drop-shadow(0 4px 8px rgba(90, 31, 31, 0.4))
            drop-shadow(0 8px 16px rgba(245, 230, 196, 0.15));
    overflow: hidden;
}

.decorated-card {
    position: relative;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.card-content {
    position: relative;
    z-index: 2;
}

.genre-card:hover,
.decorated-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);

    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4))
            drop-shadow(0 8px 16px rgba(90, 31, 31, 0.5))
            drop-shadow(0 12px 24px rgba(245, 230, 196, 0.25))
            drop-shadow(0 0 30px rgba(245, 230, 196, 0.2));

    animation: cardGlow 2s ease-in-out infinite alternate;
}

@keyframes cardGlow {
    0% {
        box-shadow: var(--card-shadow-hover),
                    0 0 20px rgba(245, 230, 196, 0.1);
    }
    100% {
        box-shadow: var(--card-shadow-hover),
                    0 0 40px rgba(245, 230, 196, 0.3),
                    0 0 60px rgba(160, 253, 218, 0.1);
    }
}

.genre-card {
    animation-fill-mode: both;
}

.genre-card h4,
.genre-card h5,
.decorated-card h4 {
    color: #2a0f0f;

    text-shadow:
        1px 1px 0px rgba(90, 31, 31, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.2),
        0 0 8px rgba(245, 230, 196, 0.3),
        0 0 16px rgba(245, 230, 196, 0.1);
    margin-bottom: var(--spacing-sm);
    font-weight: 900;
    letter-spacing: 0.5px;
    position: relative;
    font-size: 1.3rem;
}

.genre-card p,
.genre-card li,
.genre-card strong {
    color: #000000 !important;
    font-weight: 500;
}

.genre-card strong {
    font-weight: 700;
}

.genre-card p {
    line-height: 1.8;
}

.genre-card ul {
    margin-left: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.soundcloud-section {
    width: 100%;
    padding: var(--spacing-md) 0;
    background: var(--tdt-burgundy);
}

.soundcloud-vignette {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow:
        inset 0 0 80px 50px rgba(0, 0, 0, 0.45),
        inset 0 0 140px 80px rgba(74, 24, 24, 0.35),
        0 4px 20px rgba(0, 0, 0, 0.3);
}

.soundcloud-vignette::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 120px 40px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.soundcloud-embed {
    display: block;
    width: 100%;
    height: 450px;
    border: none;
    position: relative;
    z-index: 0;
}

.three-columns-section {
    padding: var(--spacing-lg) var(--spacing-md);
    margin: var(--spacing-md) 0;
    background: rgba(92, 29, 29, 0.4);
}

.three-columns-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.three-col {
    text-align: center;
}

.three-col-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--tdt-cream);
    margin: var(--spacing-md) 0 var(--spacing-xs);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.three-col-subtitle {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--tdt-beige-warm);
    margin: 0;
    line-height: 1.5;
}

.gallery-carousel--small {
    max-width: 100%;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: none;
}

.gallery-carousel--small .carousel-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    background: transparent;
    border-radius: 50%;
    overflow: hidden;
}

.gallery-carousel--small .carousel-prev,
.gallery-carousel--small .carousel-next,
.gallery-carousel--small .carousel-indicators {
    display: none !important;
}

.gallery-carousel--small .carousel-track {
    position: absolute;
    inset: 0;
    display: block;
}

.gallery-carousel--small .carousel-slide {
    position: absolute;
    inset: 0;
    min-width: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.gallery-carousel--small .carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
    display: block;
}

.gallery-carousel--small .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

@media (max-width: 768px) {
    .three-columns-inner {
        grid-template-columns: 1fr;
    }
}

.galleries-cycling-slot {
    position: relative;
    min-height: 340px;
    transition: opacity 0.6s ease;
}

.galleries-cycling-slot.galleries-slot-hidden {
    opacity: 0;
}

.gallery-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.gallery-panel.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

.galleries-cycling-slot .gallery-carousel--small {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.soundcloud-cycling-wrap {
    transition: opacity 0.6s ease;
}

.soundcloud-cycling-wrap.soundcloud-hidden {
    opacity: 0;

}

.soundcloud-cycling-wrap:not(.soundcloud-hidden) {
    opacity: 1;
}

.gallery-section {
    padding: var(--spacing-lg) var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.gallery-carousel {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.carousel-track {
    display: flex;
    transition: transform var(--transition-normal);
}

.carousel-slide {
    min-width: 100%;
    display: none;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    display: block;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(90, 31, 31, 0.8);
    color: var(--tdt-beige-warm);
    border: 2px solid var(--tdt-beige);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: var(--tdt-beige-warm);
    color: var(--tdt-burgundy-warm);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 15px rgba(232, 221, 208, 0.5);
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(232, 221, 208, 0.5);
    border: 2px solid var(--tdt-beige);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.carousel-indicators button.active {
    background: var(--tdt-beige-warm);
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(232, 221, 208, 0.6);
}

.outpost-form input[type="email"],
.discovery-unified-outpost .outpost-form input[type="email"] {
    flex: 1;
    min-width: 220px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--tdt-cream);
    color: var(--tdt-burgundy);
    border: 3px solid var(--tdt-burgundy-warm);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.outpost-form input[type="email"]::placeholder {
    color: var(--tdt-brown-light);
}

.outpost-form input[type="email"]:focus {
    outline: none;
    border-color: var(--tdt-beige-warm);
    box-shadow: 0 0 0 3px rgba(212, 197, 168, 0.35), inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.outpost-cta {
    white-space: nowrap;
}

.tab-header {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    background: radial-gradient(
        ellipse at center,
        rgba(217, 205, 184, 0.1) 0%,
        transparent 70%
    );
    margin-bottom: var(--spacing-md);
}

.tab-header h2 {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.tab-intro {
    font-size: 1.1rem;
    color: var(--tdt-cream);
    max-width: 75ch;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(90, 31, 31, 0.2);
}

.tab-sub-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}
.tab-sub-nav-link {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--tdt-cream);
    background: rgba(90, 31, 31, 0.5);
    border: 1px solid var(--tdt-beige-warm);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}
.tab-sub-nav-link:hover {
    background: var(--tdt-burgundy-warm);
    color: var(--tdt-beige);
}
.tab-sub-nav-link.active {
    background: var(--tdt-burgundy-warm);
    color: var(--tdt-beige);
    border-color: var(--tdt-beige);
    font-weight: 600;
}

.tab-content.has-subtabs .tab-sub-panel {
    display: none;
}
.tab-content.has-subtabs .tab-sub-panel.active {
    display: block;
}

#cosmology, #peoples, #world-context,
#system-overview, #character-creation, #combat, #magic {
    scroll-margin-top: 6rem;
}

@media screen and (max-width: 768px) {
    #cosmology, #peoples, #world-context,
    #system-overview, #character-creation, #combat, #magic {
        scroll-margin-top: 4rem;
    }
}

.lore-section,
.rules-section {
    padding: var(--spacing-md) var(--spacing-md);
    margin: var(--spacing-md) 0;
    background: linear-gradient(to right, rgba(107, 40, 40, 0.3) 0%, rgba(90, 31, 31, 0.35) 100%);
    border-left: 6px solid var(--tdt-beige-warm);
    border-radius: var(--radius-md);
    box-shadow:
        inset 2px 0 0 0 var(--tdt-burgundy-warm),
        inset 4px 0 0 0 var(--tdt-beige-warm),
        inset 6px 0 0 0 var(--tdt-burgundy-warm),
        inset 4px 4px 10px rgba(0, 0, 0, 0.2),
        inset -4px -4px 10px rgba(0, 0, 0, 0.15),
        inset 0 0 25px rgba(0, 0, 0, 0.1),
        var(--shadow-sm);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.rules-tables-fullwidth {
    width: 100%;
    box-sizing: border-box;
    padding: var(--spacing-md) var(--spacing-lg);
    margin: 0 0 var(--spacing-md) 0;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 1fr);
    gap: var(--spacing-xl);
    align-items: start;
    background: linear-gradient(to right, rgba(107, 40, 40, 0.2) 0%, rgba(90, 31, 31, 0.25) 100%);
}

.rules-tables-fullwidth .rules-table-col {
    min-width: 0;
    overflow-x: auto;
}

.rules-tables-fullwidth .rules-table-col h4 {
    color: var(--tdt-cream);
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
}

.rules-tables-fullwidth .rules-table-col p {
    margin-bottom: var(--spacing-sm);
    color: var(--tdt-cream);
    max-width: none;
}

.rules-tables-fullwidth .rules-table {
    width: 100%;
    min-width: 0;
}

@media (max-width: 720px) {
    .rules-tables-fullwidth {
        grid-template-columns: 1fr;
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
}

.lore-section h3,
.rules-section h3 {
    font-size: 2rem;
    color: var(--tdt-cream);
    margin-bottom: var(--spacing-md);
}

.lore-content,
.rules-content {
    color: var(--tdt-cream);
    line-height: 1.8;
    max-width: 75ch;
    margin-left: auto;
    margin-right: auto;
}

.lore-content h4,
.rules-content h4 {
    color: var(--tdt-cream);
    font-size: 1.5rem;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.lore-content p,
.rules-content p {
    margin-bottom: var(--spacing-sm);
    color: var(--tdt-cream);
}

.lore-content strong,
.rules-content strong {
    color: var(--tdt-cream);
    font-weight: 700;
}

.lore-content em,
.rules-content em {
    color: var(--tdt-beige-warm);
}

.peoples-note {
    margin-top: var(--spacing-lg);
    text-align: center;
    font-style: italic;
    color: var(--tdt-beige-light);
}

.genre-card img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
}

.rules-section#magic {
    border-left-color: var(--tdt-mint);
    box-shadow:
        inset 2px 0 0 0 var(--tdt-burgundy),
        inset 4px 0 0 0 var(--tdt-mint),
        inset 6px 0 0 0 var(--tdt-burgundy),
        0 0 15px 3px rgba(160, 253, 218, 0.3),
        var(--shadow-sm);
}

.rules-section#magic h3,
.rules-section#magic .rules-content h4 {
    color: var(--tdt-mint);
}

.rules-section#magic .rules-content p,
.rules-section#magic .rules-content li,
.rules-section#magic .rules-content strong {
    color: var(--tdt-cream);
}

.rules-section#magic .rules-content em {
    color: var(--tdt-beige-warm);
}

.rules-section#magic .magic-intro {
    margin-bottom: var(--spacing-md);
}

.rules-section#magic .magic-intro p {
    line-height: 1.6;
}

.rules-section#magic {
    --magic-accent: var(--tdt-mint-dark);
    --magic-accent-light: var(--tdt-mint);
    --magic-card-bg: rgba(127, 222, 192, 0.15);
    --magic-border: var(--tdt-beige);
    --accordion-border: var(--magic-border);
    --accordion-accent: var(--magic-accent);
    --accordion-accent-light: var(--magic-accent-light);
    --accordion-card-bg: var(--magic-card-bg);
    --accordion-outline: var(--tdt-mint);
}

.magic-accordion-body.is-open {
    max-height: 2400px;
    transition: max-height var(--transition-slow) ease-in;
}

.magic-accordion-body .magic-table-wrapper {
    padding: var(--spacing-md);
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
}

.magic-orders-list {
    list-style: decimal;
    padding-left: 1.5rem;
}

.magic-tables-wrap {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--magic-border);
}

.magic-tables-wrap h4 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--tdt-mint);
}

.magic-tables-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: var(--spacing-md);
}

.magic-tab-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--tdt-cream);
    background: var(--magic-card-bg);
    border: 1px solid var(--magic-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.magic-tab-link:hover,
.magic-tab-link:focus {
    background: var(--magic-accent);
    border-color: var(--tdt-mint);
    outline: none;
}

.magic-tab-link.active {
    background: var(--magic-accent);
    border-color: var(--tdt-mint);
    color: var(--tdt-cream);
}

.magic-tables-panel {
    display: none;
    padding: var(--spacing-md) 0;
}

.magic-tables-panel.active {
    display: block;
}

.magic-table-wrapper {
    margin-bottom: var(--spacing-md);
}

.magic-table-wrapper h5,
.magic-table-wrapper h6 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
    margin-top: var(--spacing-sm);
    color: var(--tdt-beige-light);
}

.magic-table-wrapper h6:first-child {
    margin-top: 0;
}

.magic-table-note {
    font-size: 0.85rem;
    color: var(--tdt-beige);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.magic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: var(--tdt-cream);
}

.magic-table th,
.magic-table td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--magic-border);
    text-align: left;
}

.magic-table thead th {
    background: var(--magic-accent);
    color: var(--tdt-cream);
    font-weight: 600;
}

.magic-table tbody tr:nth-child(even) {
    background: rgba(127, 222, 192, 0.08);
}

.magic-table tbody tr:hover {
    background: rgba(127, 222, 192, 0.15);
}

.magic-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.magic-table.magic-table--small {
    font-size: 0.85rem;
}

.magic-table.magic-table--small th,
.magic-table.magic-table--small td {
    padding: 0.3rem 0.5rem;
}

.magic-cercles-initiaux {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.magic-cercle-card {
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--magic-border);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--tdt-mint);
}

.magic-cercle-card h6 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--tdt-mint);
    margin: 0 0 var(--spacing-sm) 0;
}

.magic-cercle-card .magic-table {
    font-size: 0.82rem;
}

.combat-section {
    --combat-accent: var(--tdt-dark-red);
    --combat-accent-light: var(--tdt-dark-red-light);
    --combat-card-bg: rgba(90, 31, 31, 0.2);
    --combat-border: var(--tdt-beige);
    --accordion-border: var(--combat-border);
    --accordion-accent: var(--combat-accent);
    --accordion-accent-light: var(--combat-accent-light);
    --accordion-card-bg: var(--combat-card-bg);
    --accordion-outline: var(--tdt-gold);
}

.combat-intro {
    margin-bottom: var(--spacing-md);
}

.combat-intro p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.combat-glossary {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--combat-card-bg);
    border: 1px solid var(--combat-border);
    border-radius: var(--radius-md);
}

.combat-glossary h4 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xs);
    color: var(--tdt-cream);
}

.combat-glossary-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.combat-glossary-list li {
    font-size: 0.95rem;
    color: var(--tdt-cream);
}

.combat-glossary-list strong {
    color: var(--tdt-gold);
    cursor: help;
}

.combat-quickref {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-md);
    background: var(--combat-card-bg);
    border: 1px solid var(--combat-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.combat-quickref h4 {
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
    color: var(--tdt-gold);
}

.combat-quickref ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.95rem;
    color: var(--tdt-cream);
}

.combat-accordion,
.magic-accordion,
.progression-accordion {
    margin: var(--spacing-md) 0;
    border: 1px solid var(--accordion-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.combat-accordion-item,
.magic-accordion-item,
.progression-accordion-item {
    border-bottom: 1px solid var(--accordion-border);
}

.combat-accordion-item:last-child,
.magic-accordion-item:last-child,
.progression-accordion-item:last-child {
    border-bottom: none;
}

.combat-accordion-head,
.magic-accordion-head,
.progression-accordion-head {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--tdt-cream);
    background: var(--accordion-card-bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.combat-accordion-head:hover,
.combat-accordion-head:focus,
.magic-accordion-head:hover,
.magic-accordion-head:focus,
.progression-accordion-head:hover,
.progression-accordion-head:focus {
    background: var(--accordion-accent);
    color: var(--tdt-cream);
    outline: 2px solid var(--accordion-outline);
    outline-offset: 2px;
}

.combat-accordion-head::after,
.magic-accordion-head::after,
.progression-accordion-head::after {
    content: "▼";
    font-size: 0.7rem;
    opacity: 0.8;
    transition: transform var(--transition-fast);
}

.combat-accordion-item[aria-expanded="true"] .combat-accordion-head::after,
.magic-accordion-item[aria-expanded="true"] .magic-accordion-head::after,
.progression-accordion-item[aria-expanded="true"] .progression-accordion-head::after {
    transform: rotate(-180deg);
}

.combat-accordion-body,
.magic-accordion-body,
.progression-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) ease-out;
}

.combat-accordion-body.is-open {
    max-height: 1200px;
    transition: max-height var(--transition-slow) ease-in;
}

.progression-accordion-body.is-open {
    max-height: 2000px;
    transition: max-height var(--transition-slow) ease-in;
}

.combat-accordion-body .rules-content,
.combat-accordion-body > p,
.combat-accordion-body > ul,
.combat-accordion-body > ol,
.magic-accordion-body .rules-content,
.magic-accordion-body > p,
.magic-accordion-body > ul,
.magic-accordion-body > ol,
.progression-accordion-body .rules-content,
.progression-accordion-body > p,
.progression-accordion-body > ul,
.progression-accordion-body > ol,
.progression-accordion-body .progression-card,
.progression-accordion-body .rules-table-wrapper {
    padding: var(--spacing-md);
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
    color: var(--tdt-cream);
    font-size: 0.95rem;
    line-height: 1.6;
}

.progression-accordion-body .rules-table-wrapper:last-child {
    margin-bottom: 0;
}

.combat-accordion-body ul,
.combat-accordion-body ol,
.magic-accordion-body ul,
.magic-accordion-body ol,
.progression-accordion-body ul,
.progression-accordion-body ol {
    padding-left: 1.5rem;
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

.combat-accordion-body li,
.magic-accordion-body li,
.progression-accordion-body li {
    margin-bottom: 0.25rem;
}

.combat-accordion-actions,
.magic-accordion-actions,
.progression-accordion-actions {
    margin: var(--spacing-sm) 0 var(--spacing-md);
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.combat-expand-all,
.combat-collapse-all,
.magic-expand-all,
.magic-collapse-all,
.progression-expand-all,
.progression-collapse-all {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--tdt-cream);
    background: var(--accordion-accent);
    border: 1px solid var(--accordion-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.combat-expand-all:hover,
.combat-collapse-all:hover,
.magic-expand-all:hover,
.magic-collapse-all:hover,
.progression-expand-all:hover,
.progression-collapse-all:hover {
    background: var(--accordion-accent-light);
}

.combat-expand-all:focus,
.combat-collapse-all:focus,
.magic-expand-all:focus,
.magic-collapse-all:focus,
.progression-expand-all:focus,
.progression-collapse-all:focus {
    outline: 2px solid var(--accordion-outline);
    outline-offset: 2px;
}

.progression-section {
    --progression-accent: var(--tdt-brown);
    --progression-accent-light: var(--tdt-brown-light);
    --progression-card-bg: rgba(90, 31, 31, 0.25);
    --progression-border: var(--tdt-beige);
    --accordion-border: var(--progression-border);
    --accordion-accent: var(--progression-accent);
    --accordion-accent-light: var(--progression-accent-light);
    --accordion-card-bg: var(--progression-card-bg);
    --accordion-outline: var(--tdt-gold);
}

.progression-intro {
    margin-bottom: var(--spacing-md);
}

.progression-subsection-note {
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
    color: var(--tdt-beige-light);
}

.progression-card {
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--progression-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.progression-card:last-child {
    margin-bottom: 0;
}

.progression-card h5 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tdt-gold);
    margin-top: 0;
    margin-bottom: var(--spacing-xs);
}

.progression-card p,
.progression-card ul,
.progression-card ol {
    margin: 0 0 0.5rem 0;
    color: var(--tdt-cream);
}

.progression-accordion-actions {
    margin: var(--spacing-sm) 0 var(--spacing-md);
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.progression-expand-all,
.progression-collapse-all {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--tdt-cream);
    background: var(--progression-accent);
    border: 1px solid var(--progression-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.progression-expand-all:hover,
.progression-collapse-all:hover {
    background: var(--progression-accent-light);
}

.progression-expand-all:focus,
.progression-collapse-all:focus {
    outline: 2px solid var(--tdt-gold);
    outline-offset: 2px;
}

.progression-section .progression-table caption,
.progression-section .sequelles-table caption {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--tdt-beige-light);
    caption-side: top;
    margin-bottom: 0.35rem;
    text-align: left;
}

.progression-treatments-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.progression-section .treatments-table {
    font-size: 0.85rem;
}

.progression-section .treatments-table .souffrance-names th {
    font-weight: 600;
    font-size: 0.8rem;
}

.progression-section .sufferings-table tbody tr:nth-child(even),
.progression-section .sequelles-table tbody tr:nth-child(even),
.progression-section .treatments-table tbody tr:nth-child(even) {
    background: rgba(217, 205, 184, 0.08);
}

.combat-tables-wrap {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--combat-border);
}

.combat-tables-wrap h4 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--tdt-gold);
}

.combat-tables-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: var(--spacing-md);
}

.combat-tab-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--tdt-cream);
    background: var(--combat-card-bg);
    border: 1px solid var(--combat-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.combat-tab-link:hover,
.combat-tab-link:focus {
    background: var(--combat-accent);
    border-color: var(--tdt-gold);
    outline: none;
}

.combat-tab-link.active {
    background: var(--combat-accent);
    border-color: var(--tdt-gold);
    color: var(--tdt-gold);
}

.combat-tables-panel {
    display: none;
    padding: var(--spacing-md) 0;
}

.combat-tables-panel.active {
    display: block;
}

.combat-table-wrapper {
    margin-bottom: var(--spacing-md);
}

.combat-table-wrapper h5 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
    color: var(--tdt-beige-light);
}

.combat-table-note {
    font-size: 0.85rem;
    color: var(--tdt-beige);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.combat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: var(--tdt-cream);
}

.combat-table th,
.combat-table td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--combat-border);
    text-align: left;
}

.combat-table thead th {
    background: var(--combat-accent);
    color: var(--tdt-cream);
    font-weight: 600;
}

.combat-table tbody tr:nth-child(even) {
    background: rgba(90, 31, 31, 0.2);
}

.combat-table tbody tr:hover {
    background: rgba(90, 31, 31, 0.35);
}

.combat-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.combat-weapons-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.combat-weapons-filter label {
    font-size: 0.9rem;
    color: var(--tdt-beige-light);
}

.combat-weapon-search,
.combat-weapon-type {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    background: var(--combat-card-bg);
    border: 1px solid var(--combat-border);
    border-radius: var(--radius-sm);
    color: var(--tdt-cream);
}

.combat-weapon-search:focus,
.combat-weapon-type:focus {
    outline: 2px solid var(--tdt-gold);
    outline-offset: 1px;
}

.combat-weapon-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: var(--spacing-md);
}

.combat-weapon-tab {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    font-family: var(--font-body);
    color: var(--tdt-cream);
    background: var(--combat-card-bg);
    border: 1px solid var(--combat-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.combat-weapon-tab:hover,
.combat-weapon-tab:focus {
    background: var(--combat-accent);
    outline: none;
}

.combat-weapon-tab.active {
    background: var(--combat-accent);
    border-color: var(--tdt-gold);
    color: var(--tdt-gold);
}

.combat-weapon-panel {
    display: none;
}

.combat-weapon-panel.active {
    display: block;
}

.tdt-popover {
    position: fixed;
    z-index: 9999;
    max-width: 360px;
    max-height: 80vh;
    overflow: auto;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--tdt-beige-lighter) 0%, var(--tdt-beige-warm) 50%, var(--tdt-beige-light) 100%);
    border: 2px solid var(--tdt-burgundy-warm);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--tdt-beige-light);
    color: #0d0606;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}
.tdt-popover p,
.tdt-popover li {
    color: #0d0606;
}
.tdt-popover.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.tdt-popover .tdt-popover-inner {
    position: relative;
}
.tdt-popover h5 {
    margin: 0 0 var(--spacing-sm) 0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: #2a0a0a;
}
.tdt-popover .peoples-back-section {
    margin-bottom: var(--spacing-sm);
}
.tdt-popover .peoples-back-section h6 {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 0.85rem;
    color: #2a0a0a;
}
.tdt-popover .lore-table,
.tdt-popover .peoples-attr-table,
.tdt-popover .peoples-phys-table {
    font-size: 0.8rem;
    background: rgba(70, 0, 0, 0.2);
    color: #0d0606;
}
.tdt-popover .lore-table th,
.tdt-popover .lore-table td,
.tdt-popover .peoples-attr-table th,
.tdt-popover .peoples-attr-table td,
.tdt-popover .peoples-phys-table th,
.tdt-popover .peoples-phys-table td {
    padding: 2px 6px;
    color: #0d0606;
}

.tdt-popover .peoples-flip-back-inner {
    transform: none;
}

.tdt-popover * {
    color: inherit;
}
.tdt-popover h5,
.tdt-popover h6 {
    color: #2a0a0a;
}

.tdt-popover .peoples-popover-races {
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(70, 0, 0, 0.2);
}
.tdt-popover .peoples-popover-races li {
    cursor: help;
}

.tdt-popover .tdt-popover-race h6 {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 0.95rem;
    color: #2a0a0a;
}
.tdt-popover .tdt-popover-race p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #0d0606;
}

[data-peuple],
[data-tetrarch] {
    cursor: help;
}
.peoples-races-mini li {
    cursor: help;
}

[data-tip] {
    position: relative;
}

[data-tip]:hover::after,
[data-tip]:focus::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
    margin-bottom: 0.35rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--tdt-cream);
    background: var(--tdt-burgundy);
    border: 1px solid var(--combat-border);
    border-radius: var(--radius-sm);
    white-space: normal;
    max-width: 280px;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

[data-tip]:focus::after {
    outline: 2px solid var(--tdt-gold);
}

@media (max-width: 768px) {
    .combat-tables-nav {
        flex-direction: column;
    }

    .combat-tab-link {
        width: 100%;
        text-align: left;
    }

    .combat-weapon-tabs {
        flex-direction: column;
    }

    .combat-weapon-tab {
        width: 100%;
    }

    .combat-accordion-body .rules-content,
    .combat-accordion-body > p,
    .combat-accordion-body > ul,
    .combat-accordion-body > ol {
        padding: var(--spacing-sm);
    }

    .progression-accordion-body .rules-content,
    .progression-accordion-body > p,
    .progression-accordion-body .progression-card,
    .progression-accordion-body .rules-table-wrapper {
        padding: var(--spacing-sm);
    }

    .combat-table {
        font-size: 0.8rem;
    }

    .combat-table th,
    .combat-table td {
        padding: 0.3rem 0.4rem;
    }

    .magic-tables-nav {
        flex-direction: column;
    }

    .magic-tab-link {
        width: 100%;
        text-align: left;
    }

    .magic-accordion-body .rules-content,
    .magic-accordion-body > p,
    .magic-accordion-body > ul,
    .magic-accordion-body > ol,
    .magic-accordion-body .magic-table-wrapper {
        padding: var(--spacing-sm);
    }

    .magic-table {
        font-size: 0.8rem;
    }

    .magic-table th,
    .magic-table td {
        padding: 0.3rem 0.4rem;
    }

    .magic-cercles-initiaux {
        grid-template-columns: 1fr;
    }

    .tdt-popover {
        max-width: calc(100vw - 1.5rem);
    }

    .outpost-form input[type="email"] {
        min-width: 0;
        width: 100%;
    }
    .outpost-cta {
        white-space: normal;
    }

    .genre-card {
        overflow: visible;
    }

    .tab-header h2 {
        font-size: 2rem;
    }
}

body.entrance-active {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100vh !important;
}

body.entrance-active > :not(#static-loader) {
    display: none !important;
}

#entrance-hover-zone {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vmin;
    height: 60vmin;
    border-radius: 50%;
    z-index: 1;
    cursor: pointer;

    background: transparent;
}

.entrance-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#entrance-fill {

    opacity: 1;
}

.entrance-map-layer {
    background-image: url("../assets/images/Map_Naked.webp");
    background-size: 240%;
    background-position: 20% 30%;
    background-repeat: no-repeat;
    animation: entranceMapPan 60s ease-in-out infinite;
}

.entrance-creusalite-layer {
    background-image: url("../assets/images/Creusalité_NoBorders.webp");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

.entrance-overlay-layer {
    background: radial-gradient(
        circle at center,
        #3d0000 0%,
        #1a0505 50%,
        #000000 100%
    );
    opacity: 1;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#static-loader:has(#entrance-hover-zone:hover) .entrance-overlay-layer,
#static-loader.touch-hovering .entrance-overlay-layer {
    opacity: 0;
}

#static-loader.entrance-revealing .entrance-overlay-layer {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.entrance-vignette-layer {
    background: radial-gradient(
        circle at center,
        transparent 0%,
        transparent 35%,
        rgba(0, 0, 0, 0.4) 60%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

@keyframes entranceMapPan {
    0% {
        background-position: 20% 30%;
        background-size: 240%;
    }
    12.5% {
        background-position: 70% 25%;
        background-size: 260%;
    }
    25% {
        background-position: 85% 60%;
        background-size: 250%;
    }
    37.5% {
        background-position: 50% 80%;
        background-size: 270%;
    }
    50% {
        background-position: 15% 70%;
        background-size: 245%;
    }
    62.5% {
        background-position: 30% 40%;
        background-size: 265%;
    }
    75% {
        background-position: 60% 20%;
        background-size: 255%;
    }
    87.5% {
        background-position: 80% 50%;
        background-size: 240%;
    }
    100% {
        background-position: 20% 30%;
        background-size: 240%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .entrance-map-layer {
        animation: none;
        background-position: 50% 50%;
        background-size: 200%;
    }
}

#static-loader.entrance-revealing .entrance-map-layer {
    animation: entranceMapZoomIn 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes entranceMapZoomIn {
    0% {

        background-size: 240%;
        background-position: 50% 50%;
    }
    100% {

        background-size: 800%;
        background-position: 50% 45%;
    }
}

@keyframes keyholeLogoRotate {
    0%   { transform: rotate(0deg); }
    50%  { transform: rotate(180deg); }
    100% { transform: rotate(0deg); }
}

#enter-portfolio-btn {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 1rem !important;
    margin: 0 !important;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit !important;
    font: inherit !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;

    animation: eyeIrisCalm 12s ease-in-out infinite;
}

#enter-portfolio-btn .entrance-logo-wrap {
    display: inline-block;
    position: relative;
    max-width: 250px;
    animation: keyholePulse 2s ease-in-out infinite,
               keyholeLogoRotate 4s ease-in-out infinite;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#enter-portfolio-btn .entrance-logo-wrap img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#enter-portfolio-btn .entrance-logo-coin {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    pointer-events: none;
}

#static-loader:has(#entrance-hover-zone:hover) #enter-portfolio-btn,
#static-loader.touch-hovering #enter-portfolio-btn {
    opacity: 1 !important;
}

#static-loader:has(#entrance-hover-zone:hover) #enter-portfolio-btn .entrance-logo-wrap,
#static-loader.touch-hovering #enter-portfolio-btn .entrance-logo-wrap {
    opacity: 1;

    animation: keyholeDiscovery 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards,
               keyholeGlow 2s ease-in-out infinite alternate 0.8s,
               keyholeLogoRotate 4s ease-in-out infinite 0.8s;
}

#static-loader:not(:has(#entrance-hover-zone:hover)) #enter-portfolio-btn.was-hovered .entrance-logo-wrap {
    opacity: 1;
    animation: keyholeReverse 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards,
               keyholePulse 2s ease-in-out infinite 0.8s,
               keyholeLogoRotate 4s ease-in-out infinite 0.8s;
}

#enter-portfolio-btn:active {
    opacity: 0.6;
}

#static-loader #enter-portfolio-btn.entrance-exiting,
#static-loader.touch-hovering #enter-portfolio-btn.entrance-exiting {
    animation: fadeOut 1.5s ease-in-out forwards !important;
    pointer-events: none !important;
    opacity: 1;
}

#static-loader #enter-portfolio-btn.entrance-exiting .entrance-logo-wrap,
#static-loader.touch-hovering #enter-portfolio-btn.entrance-exiting .entrance-logo-wrap {
    animation: spinFadeOut 1.5s ease-in-out forwards !important;
    transition: none !important;
}

@keyframes keyholeDiscovery {
    0% {
        filter:
            drop-shadow(0 0 12px rgba(61, 0, 0, 0.8))
            drop-shadow(0 0 24px rgba(61, 0, 0, 0.6))
            drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    }
    20% {
        filter:
            drop-shadow(0 0 20px rgba(61, 0, 0, 0.7))
            drop-shadow(0 0 40px rgba(90, 26, 26, 0.5))
            drop-shadow(0 0 60px rgba(160, 130, 90, 0.3))
            drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    }
    40% {
        filter:
            drop-shadow(0 0 28px rgba(90, 26, 26, 0.6))
            drop-shadow(0 0 56px rgba(160, 130, 90, 0.4))
            drop-shadow(0 0 80px rgba(222, 184, 135, 0.3))
            drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    }
    60% {
        filter:
            drop-shadow(0 0 36px rgba(160, 130, 90, 0.5))
            drop-shadow(0 0 72px rgba(222, 184, 135, 0.4))
            drop-shadow(0 0 100px rgba(245, 222, 179, 0.3))
            drop-shadow(0 0 16px rgba(255, 248, 240, 0.4))
            drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    }
    80% {
        filter:
            drop-shadow(0 0 44px rgba(222, 184, 135, 0.6))
            drop-shadow(0 0 88px rgba(245, 222, 179, 0.5))
            drop-shadow(0 0 120px rgba(245, 235, 210, 0.3))
            drop-shadow(0 0 24px rgba(255, 248, 240, 0.5))
            drop-shadow(0 0 48px rgba(255, 248, 240, 0.2))
            drop-shadow(2px 2px 6px rgba(0, 0, 0, 0.5));
    }
    100% {
        filter:
            drop-shadow(0 0 48px rgba(245, 222, 179, 0.6))
            drop-shadow(0 0 96px rgba(245, 235, 210, 0.4))
            drop-shadow(0 0 140px rgba(255, 248, 240, 0.2))
            drop-shadow(0 0 24px rgba(255, 248, 240, 0.6))
            drop-shadow(0 0 48px rgba(255, 248, 240, 0.3))
            drop-shadow(2px 2px 6px rgba(0, 0, 0, 0.5));
    }
}

@keyframes keyholeReverse {
    0% {
        filter:
            drop-shadow(0 0 48px rgba(245, 222, 179, 0.6))
            drop-shadow(0 0 96px rgba(245, 235, 210, 0.4))
            drop-shadow(0 0 140px rgba(255, 248, 240, 0.2))
            drop-shadow(0 0 24px rgba(255, 248, 240, 0.6))
            drop-shadow(0 0 48px rgba(255, 248, 240, 0.3))
            drop-shadow(2px 2px 6px rgba(0, 0, 0, 0.5));
    }
    25% {
        filter:
            drop-shadow(0 0 40px rgba(245, 222, 179, 0.4))
            drop-shadow(0 0 80px rgba(245, 235, 210, 0.3))
            drop-shadow(0 0 120px rgba(255, 248, 240, 0.1))
            drop-shadow(0 0 16px rgba(255, 248, 240, 0.3))
            drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.4));
    }
    50% {
        filter:
            drop-shadow(0 0 32px rgba(222, 184, 135, 0.3))
            drop-shadow(0 0 64px rgba(245, 235, 210, 0.2))
            drop-shadow(0 0 96px rgba(255, 248, 240, 0.1))
            drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    }
    75% {
        filter:
            drop-shadow(0 0 24px rgba(160, 130, 90, 0.4))
            drop-shadow(0 0 48px rgba(222, 184, 135, 0.2))
            drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    }
    100% {
        filter:
            drop-shadow(0 0 12px rgba(61, 0, 0, 0.6))
            drop-shadow(0 0 24px rgba(61, 0, 0, 0.4))
            drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    }
}

@keyframes keyholeGlow {
    0%, 100% {
        filter:
            drop-shadow(0 0 48px rgba(245, 222, 179, 0.6))
            drop-shadow(0 0 96px rgba(245, 235, 210, 0.4))
            drop-shadow(0 0 140px rgba(255, 248, 240, 0.2))
            drop-shadow(0 0 24px rgba(255, 248, 240, 0.6))
            drop-shadow(0 0 48px rgba(255, 248, 240, 0.3))
            drop-shadow(2px 2px 6px rgba(0, 0, 0, 0.5));
    }
    50% {

        filter:
            drop-shadow(0 0 50px rgba(255, 245, 220, 0.9))
            drop-shadow(0 0 100px rgba(255, 248, 230, 0.7))
            drop-shadow(0 0 150px rgba(255, 252, 245, 0.5))
            drop-shadow(0 0 30px rgba(255, 255, 250, 0.9))
            drop-shadow(0 0 60px rgba(255, 255, 250, 0.6))
            drop-shadow(2px 2px 12px rgba(0, 0, 0, 0.7));
    }
}

@keyframes keyholePulse {
    0%, 100% {

        filter: drop-shadow(0 0 24px rgba(61, 0, 0, 0.6))
                drop-shadow(0 0 48px rgba(61, 0, 0, 0.4))
                drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    }
    50% {

        filter: drop-shadow(0 0 40px rgba(255, 220, 150, 0.9))
                drop-shadow(0 0 80px rgba(255, 200, 120, 0.7))
                drop-shadow(0 0 120px rgba(255, 235, 180, 0.5))
                drop-shadow(0 0 20px rgba(255, 248, 220, 0.8))
                drop-shadow(2px 2px 10px rgba(0, 0, 0, 0.7));
    }
}

@keyframes goldenFlash {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    10% {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
    30% {
        width: 200px;
        height: 200px;
        opacity: 1;
    }
    60% {
        width: 800px;
        height: 800px;
        opacity: 1;
    }
    80% {
        width: 1500px;
        height: 1500px;
        opacity: 1;
    }
    100% {
        width: 3000px;
        height: 3000px;
        opacity: 1;
    }
}

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

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

@keyframes spinFadeOut {
    from { opacity: 1; transform: rotate(0deg); }
    to   { opacity: 0; transform: rotate(360deg); }
}

@keyframes eyeIrisCalm {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(8vw, -3vh); }
    25% { transform: translate(-6vw, -4vh); }
    35% { transform: translate(-10vw, 2vh); }
    50% { transform: translate(-4vw, 5vh); }
    65% { transform: translate(9vw, 4vh); }
    80% { transform: translate(7vw, -2vh); }
    90% { transform: translate(-3vw, -4vh); }
}

@media (hover: none) and (pointer: coarse), (max-width: 768px) {

    #enter-portfolio-btn {
        animation: none !important;
        transform: translate(0, 0) !important;
    }

    .entrance-overlay-layer {
        opacity: 0 !important;
        transition: none !important;
    }

    #enter-portfolio-btn .entrance-logo-wrap {
        max-width: 125px;
        opacity: 1 !important;
        animation: keyholeGlow 2s ease-in-out infinite alternate,
                   keyholeLogoRotate 4s ease-in-out infinite !important;
    }

    .entrance-vignette-layer {
        background: radial-gradient(
            circle at center,
            transparent 0%,
            transparent 30%,
            rgba(0, 0, 0, 0.3) 55%,
            rgba(0, 0, 0, 0.8) 100%
        );
    }
}

.creation-intro {
    margin-bottom: var(--spacing-md);
}

.creation-flow {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
    margin-bottom: var(--spacing-lg);
    counter-reset: creation-step;
}

.creation-flow li {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: var(--spacing-sm);
    counter-increment: creation-step;
    color: var(--tdt-cream);
}

.creation-flow li::before {
    content: counter(creation-step);
    position: absolute;
    left: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tdt-burgundy-warm);
    color: var(--tdt-cream);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
}

.creation-flow li:last-of-type::before {
    content: "→";
    background: var(--tdt-dark-red);
}

.creation-table-wrap {
    overflow-x: auto;
    margin: var(--spacing-sm) 0 var(--spacing-md);
    -webkit-overflow-scrolling: touch;
}

.creation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    color: var(--tdt-cream);
}

.creation-table caption {
    text-align: left;
    font-style: italic;
    color: var(--tdt-beige-warm);
    margin-bottom: var(--spacing-xs);
    font-size: 0.9rem;
}

.creation-table th,
.creation-table td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--tdt-beige);
    text-align: left;
}

.creation-table thead th {
    background: var(--tdt-burgundy-warm);
    color: var(--tdt-cream);
    font-weight: 600;
}

.creation-table tbody tr:nth-child(even) {
    background: rgba(90, 31, 31, 0.25);
}

.creation-table--compact th,
.creation-table--compact td {
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
}

#character-creation .genre-card .creation-table,
#character-creation .genre-card .creation-table td {
    color: #2a0f0f;
}

#character-creation .genre-card .creation-table thead th {
    color: var(--tdt-cream);
}

#character-creation .genre-card .creation-table caption {
    color: #2a0f0f;
    opacity: 0.9;
}

#character-creation .genre-card .creation-details summary {
    color: #2a0f0f;
    font-weight: 600;
}

#character-creation .genre-card .creation-details[open] summary {
    color: #1a0808;
}

.creation-details {
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.creation-details summary {
    cursor: pointer;
    color: var(--tdt-beige-warm);
    font-weight: 600;
    list-style: none;
    padding: 0.25rem 0;
}

.creation-details summary::-webkit-details-marker {
    display: none;
}

.creation-details summary::before {
    content: "▸ ";
}

.creation-details[open] summary::before {
    content: "▾ ";
}

.creation-details .creation-table-wrap,
.creation-details .creation-table {
    margin-top: var(--spacing-sm);
}

.creation-pillars-card {
    margin-top: var(--spacing-md);
}

.creation-pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.creation-pillar {
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(180deg, var(--tdt-beige-lighter) 0%, var(--tdt-beige-warm) 100%);
    border: 2px solid var(--tdt-burgundy-warm);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.creation-pillar-label {
    display: block;
    font-weight: 700;
    color: var(--tdt-burgundy-warm);
    margin-bottom: 0.25rem;
}

.creation-pillar p {
    margin: 0;
    font-size: 0.9rem;
    color: #2a0f0f;
}

@media (max-width: 560px) {
    .creation-pillars {
        grid-template-columns: 1fr;
    }
}

.revelation-complete-list {
    margin-top: var(--spacing-sm);
}

.revelation-complete-list li {
    margin-bottom: var(--spacing-xs);
}

.play-panels-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--spacing-md);
    width: 100%;
}
.play-panels-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-top: 0.25rem;
}
.play-panel-btn {
    padding: 0.5rem 1rem;
    background: #643030;
    color: #F3E2A9;
    border: 2px solid #674B1B;
    border-radius: 4px;
    font-family: 'Quintessential', cursive, serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 0 0 1px #ffebc6;
    white-space: nowrap;
}
.play-panel-btn:hover {
    background: #fff6df;
    color: #4d3000;
    transform: translateY(-2px);
    box-shadow: 0 0 15px 5px #ffebc6, 0 4px 8px rgba(0, 0, 0, 0.3);
}
.play-panel-btn.active {
    background: #fff6df;
    color: #4d3000;
    box-shadow: 0 0 15px 5px #ffebc6, 0 4px 8px rgba(0, 0, 0, 0.3);
}
.play-panels-container {
    flex: 1;
    min-width: 0;
    min-height: 80vh;
    overflow: hidden;
    position: relative;
}
.play-panel {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 80vh;
    overflow: auto;
    padding-bottom: 1.5rem;
    box-sizing: border-box;
}
.play-panel.active {
    display: flex;
    position: relative;
}

#play-panel-zine.play-panel {
    width: 100%;
    min-width: 0;
}
#play-panel-zine.play-panel .zine-content {
    padding: var(--spacing-md);
    width: 100%;
    max-width: none;
    min-width: 0;
    color: var(--tdt-cream);
    line-height: 1.65;
    gap: var(--spacing-md);
}
#play-panel-zine.play-panel .zine-content.zine-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.zine-content.zine-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--spacing-lg);
    min-height: 0;
}

.zine-sidebar {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding-right: var(--spacing-md);
    border-right: 1px solid rgba(217, 205, 184, 0.3);
}
.zine-pages-nav {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) 0;
}
.zine-page-radio {

    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.zine-page-nav-label {
    display: block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--tdt-beige-light);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background var(--transition-normal), color var(--transition-normal);
    white-space: nowrap;
}
.zine-page-nav-label:hover {
    background: rgba(90, 31, 31, 0.5);
    color: var(--tdt-cream);
}
.zine-page-radio:checked + .zine-page-nav-label {
    background: var(--tdt-burgundy-warm);
    color: var(--tdt-cream);
    font-weight: 600;
}

.zine-pages-container {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    overflow: auto;
}
.zine-content .zine-page.zine-page-panel {
    display: none;
    margin-bottom: 0;
}
.zine-content .zine-page.zine-page-panel.zine-page-active {
    display: block;
    margin-bottom: var(--spacing-lg);
}

#play-panel-zine .zine-section-card.genre-card {
    background: rgba(74, 24, 24, 0.35);
    border: 1px solid rgba(217, 205, 184, 0.25);
    filter: none !important;
    transform: none !important;
    box-shadow: none !important;
}
#play-panel-zine .zine-section-card.genre-card:hover {
    background: rgba(90, 31, 31, 0.4);
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}
#play-panel-zine .zine-section-card .zine-section-card-body p,
#play-panel-zine .zine-section-card .zine-section-card-body li,
#play-panel-zine .zine-section-card .zine-section-card-body strong {
    color: var(--tdt-cream) !important;
}
#play-panel-zine .zine-section-card .zine-section-card-body strong {
    color: var(--tdt-beige-light) !important;
}
.zine-section-card {
    margin-bottom: var(--spacing-md);
    box-shadow: none !important;
}
.zine-section-card:hover {
    box-shadow: none !important;
}
.zine-section-card:last-child {
    margin-bottom: 0;
}
.zine-section-card-header {
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid rgba(217, 205, 184, 0.25);
    margin-bottom: var(--spacing-sm);
}
.zine-section-card-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--tdt-gold);
    text-shadow: none;
}
.zine-section-card-body p,
.zine-section-card-body ul,
.zine-section-card-body ol {
    margin-bottom: var(--spacing-sm);
}
.zine-section-card-body p:last-child,
.zine-section-card-body ul:last-child,
.zine-section-card-body ol:last-child {
    margin-bottom: 0;
}

.zine-callout {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--tdt-gold);
}
#play-panel-zine .zine-callout .zine-section-card-body p,
#play-panel-zine .zine-callout .zine-section-card-body li,
#play-panel-zine .zine-callout .zine-section-card-body strong {
    color: var(--tdt-cream) !important;
}
#play-panel-zine .zine-callout .zine-section-card-body strong {
    color: var(--tdt-gold) !important;
}
.zine-callout-formula {
    background: rgba(90, 31, 31, 0.45);
    border-left-color: var(--tdt-gold);
}
.zine-callout-formula .zine-section-card.genre-card {
    background: transparent;
    border-color: transparent;
}
.zine-callout-example {
    background: rgba(90, 31, 31, 0.35);
    border-left-color: var(--tdt-beige-light);
}
.zine-callout-example .zine-section-card.genre-card {
    background: transparent;
    border-color: transparent;
}
.zine-callout-tip {
    background: rgba(74, 24, 24, 0.4);
    border-left-color: var(--tdt-beige-warm);
}
.zine-callout-tip .zine-section-card.genre-card {
    background: transparent;
    border-color: transparent;
}

.zine-peoples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: var(--spacing-sm);
}
.zine-peoples-card {
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    background: rgba(74, 24, 24, 0.4);
    border: 1px solid rgba(217, 205, 184, 0.25);
    border-radius: var(--radius-sm);
    box-shadow: none !important;
}
.zine-peoples-card:hover {
    box-shadow: none !important;
    background: rgba(90, 31, 31, 0.5);
}
.zine-peoples-name {
    font-weight: 600;
    color: var(--tdt-cream);
}
.zine-peoples-badge {
    font-size: 0.85rem;
    color: var(--tdt-beige-light);
}

#play-panel-zine .zine-dice-code {
    font-family: ui-monospace, monospace;
    background: rgba(0, 0, 0, 0.35);
    color: var(--tdt-gold);
    padding: 0.15em 0.35em;
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    border: 1px solid rgba(217, 205, 184, 0.2);
}

#play-panel-zine .zine-page.zine-page-panel h1 {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-md);
    color: var(--tdt-gold);
}
#play-panel-zine .zine-page.zine-page-panel h2 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 0;
    color: var(--tdt-gold);
}
#play-panel-zine .zine-page.zine-page-panel p,
#play-panel-zine .zine-page.zine-page-panel li {
    color: var(--tdt-cream);
}
#play-panel-zine .zine-page.zine-page-panel em {
    color: var(--tdt-beige-light);
}
#play-panel-zine .zine-page.zine-page-panel table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-sm) 0;
    font-size: 0.95rem;
}
#play-panel-zine .zine-page.zine-page-panel th,
#play-panel-zine .zine-page.zine-page-panel td {
    padding: 0.35rem 0.6rem;
    border: 1px solid rgba(217, 205, 184, 0.25);
    text-align: left;
    color: var(--tdt-cream);
}
#play-panel-zine .zine-page.zine-page-panel thead th {
    background: var(--tdt-burgundy-warm);
    color: var(--tdt-cream);
}
#play-panel-zine .zine-page.zine-page-panel tbody tr:nth-child(even) {
    background: rgba(74, 24, 24, 0.3);
}
#play-panel-zine .zine-page.zine-page-panel code:not(.zine-dice-code) {
    color: var(--tdt-beige-light);
}
#play-panel-zine .zine-page.zine-page-panel ul,
#play-panel-zine .zine-page.zine-page-panel ol {
    color: var(--tdt-cream);
    padding-left: 1.5rem;
}
#play-panel-zine .zine-page.zine-page-panel li::marker {
    color: var(--tdt-beige-light);
}

#play-panel-chat .gm-chat-wrapper {
    height: 100%;
    min-height: 0;
    max-width: none;
    width: 100%;
}
#play-panel-chat .gm-chat-messages {
    max-height: none;
    flex: 1;
    min-height: 0;
}

#play-panel-sheet .play-character-sheet-root {
    margin-top: 0;
    flex: 1 1 0;
    min-height: 100%;
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
@media screen and (max-width: 768px) {
    #play-panel-sheet .play-character-sheet-root {
        overflow-x: auto;
    }
}

.play-character-sheet-root {
    margin-top: var(--spacing-lg);
    width: 100%;
}
#play-panel-sheet .play-character-sheet-root {
    margin-top: 0;
}
#play-panel-sheet .play-character-sheet-root .play-character-sheet-embedded {
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}
#play-panel-sheet .play-character-sheet-root .play-character-sheet-embedded .play-character-sheet-card {
    flex: 1;
    min-height: 100%;
    max-height: none;
}
.play-character-sheet-embedded {
    width: 100%;
}

.gm-chat-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-height: 320px;
}
.gm-chat-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(206, 182, 141, 0.25);
}
.gm-chat-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    background: transparent;
    border: 1px solid rgba(206, 182, 141, 0.4);
    border-radius: 4px;
    color: var(--tdt-beige-light);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.gm-chat-toolbar-btn:hover {
    background: rgba(206, 182, 141, 0.15);
    color: var(--tdt-cream);
    border-color: var(--tdt-beige-warm);
}
.gm-chat-toolbar-btn .gm-chat-icon-brush {
    display: block;
}
.gm-chat-disclaimer {
    font-size: 0.7rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    transition: color 0.3s ease;
}
.gm-chat-disclaimer--backend {
    color: var(--tdt-mint, #a0fdda);
    opacity: 0.7;
}
.gm-chat-disclaimer--fallback {
    color: #d4a050;
    opacity: 0.9;
}

.mini-chat-preview {
    max-width: 700px;
    margin: 2rem auto 1.5rem;
    padding: 0 var(--spacing-md);
}
.mini-chat-widget {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(212, 197, 168, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.mini-chat-widget .gm-chat-messages {
    max-height: 220px;
    min-height: 60px;
    flex: 1;
}
.mini-gm-chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(60, 20, 20, 0.6);
}
.mini-gm-chat-input-row input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.7rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 197, 168, 0.3);
    border-radius: var(--radius-sm);
    color: var(--tdt-cream);
    font-size: 0.9rem;
}
.mini-gm-chat-input-row input::placeholder { color: rgba(255, 235, 205, 0.5); }
.mini-gm-chat-input-row input:focus {
    outline: none;
    border-color: var(--tdt-mint);
    box-shadow: 0 0 0 2px rgba(160, 253, 218, 0.2);
}
.mini-gm-chat-input-row button {
    padding: 0.4rem 0.9rem;
    background: #643030;
    color: #F3E2A9;
    border: 1px solid rgba(212, 197, 168, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 0 0 1px #ffebc6;
}
.mini-gm-chat-input-row button:hover:not(:disabled) {
    background: #fff6df;
    color: #4d3000;
    transform: translateY(-1px);
    box-shadow: 0 0 12px 3px #ffebc6, 0 3px 6px rgba(0, 0, 0, 0.3);
}
.mini-gm-chat-input-row button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.mini-chat-play-btn {
    display: block;
    text-align: center;
    margin-top: 0.6rem;
    padding: 0.55rem 1.2rem;
    background: linear-gradient(135deg, rgba(100, 48, 48, 0.85), rgba(80, 30, 30, 0.95));
    color: var(--tdt-beige-warm);
    border: 1px solid rgba(212, 197, 168, 0.3);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.mini-chat-play-btn:hover {
    background: linear-gradient(135deg, #fff6df, #ffebc6);
    color: #4d3000;
    transform: translateY(-1px);
    box-shadow: 0 0 15px 5px rgba(255, 235, 198, 0.3), 0 4px 8px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.gm-chat-no-character-buttons {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: stretch;
    gap: 0.75rem;
    width: 100%;
}
.gm-chat-no-character-btn {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    background: rgba(90, 31, 31, 0.5);
    color: var(--tdt-beige-light);
    border: 1px solid var(--tdt-beige);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-align: center;
}
.gm-chat-no-character-btn:hover {
    background: rgba(107, 40, 40, 0.8);
    color: var(--tdt-cream);
    border-color: var(--tdt-beige-warm);
}
.gm-chat-action-buttons {
    margin-bottom: 0.5rem;
}
.gm-chat-kill-create-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    background: rgba(80, 30, 30, 0.6);
    color: var(--tdt-beige-light);
    border: 1px solid rgba(139, 69, 69, 0.6);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.gm-chat-kill-create-btn:hover {
    background: rgba(100, 40, 40, 0.9);
    color: #f3e2a9;
}
.gm-chat-messages {
    flex: 1;
    min-height: 90px;
    max-height: min(75vh, calc(90vh - 220px));
    overflow-y: auto;
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    color: var(--tdt-cream);
    font-size: 1rem;
    line-height: 1.5;
}
.gm-chat-messages .msg {
    margin-bottom: var(--spacing-sm);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}
.gm-chat-messages .msg.user {
    background: rgba(90, 31, 31, 0.5);
    margin-left: 1.5rem;
    border-left: 3px solid var(--tdt-beige-warm);
}
.gm-chat-messages .msg.assistant {
    background: rgba(107, 40, 40, 0.4);
    margin-right: 1.5rem;
    border-left: 3px solid var(--tdt-mint);
}
.gm-chat-messages .msg .role {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.gm-chat-messages .msg.assistant .gm-chat-body--md {
    line-height: 1.55;
    word-wrap: break-word;
}
.gm-chat-messages .msg.assistant .gm-chat-body--md > *:first-child { margin-top: 0; }
.gm-chat-messages .msg.assistant .gm-chat-body--md > *:last-child { margin-bottom: 0; }

.gm-chat-messages .msg.assistant .gm-chat-body--md h1,
.gm-chat-messages .msg.assistant .gm-chat-body--md h2,
.gm-chat-messages .msg.assistant .gm-chat-body--md h3,
.gm-chat-messages .msg.assistant .gm-chat-body--md h4,
.gm-chat-messages .msg.assistant .gm-chat-body--md h5,
.gm-chat-messages .msg.assistant .gm-chat-body--md h6 {
    margin: 1rem 0 0.5rem;
    font-weight: 700;
    color: var(--tdt-beige-warm);
    text-shadow: 0 0 4px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
    -webkit-text-stroke: 0.5px rgba(0,0,0,0.35);
    border-bottom: 1px solid rgba(212, 197, 168, 0.4);
    padding-bottom: 0.2em;
}
.gm-chat-messages .msg.assistant .gm-chat-body--md h1 { font-size: 1.35em; }
.gm-chat-messages .msg.assistant .gm-chat-body--md h2 { font-size: 1.2em; }
.gm-chat-messages .msg.assistant .gm-chat-body--md h3 { font-size: 1.1em; }
.gm-chat-messages .msg.assistant .gm-chat-body--md h4,
.gm-chat-messages .msg.assistant .gm-chat-body--md h5,
.gm-chat-messages .msg.assistant .gm-chat-body--md h6 { font-size: 1em; }

.gm-chat-messages .msg.assistant .gm-chat-body--md strong,
.gm-chat-messages .msg.assistant .gm-chat-body--md b {
    font-weight: 700;
    color: var(--tdt-beige-light);
    text-shadow: 0 0 3px rgba(0,0,0,0.4);
}
.gm-chat-messages .msg.assistant .gm-chat-body--md em,
.gm-chat-messages .msg.assistant .gm-chat-body--md i { font-style: italic; color: var(--tdt-beige-warm); }
.gm-chat-messages .msg.assistant .gm-chat-body--md u { text-decoration: underline; text-underline-offset: 2px; }

.gm-chat-messages .msg.assistant .gm-chat-body--md p { margin: 0.5em 0; }
.gm-chat-messages .msg.assistant .gm-chat-body--md ul,
.gm-chat-messages .msg.assistant .gm-chat-body--md ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}
.gm-chat-messages .msg.assistant .gm-chat-body--md li { margin-bottom: 0.25em; }

.gm-chat-messages .msg.assistant .gm-chat-body--md table {
    width: 100%;
    margin: 0.75em 0;
    border-collapse: collapse;
    font-size: 0.95em;
}
.gm-chat-messages .msg.assistant .gm-chat-body--md th,
.gm-chat-messages .msg.assistant .gm-chat-body--md td {
    border: 1px solid rgba(212, 197, 168, 0.35);
    padding: 0.4em 0.6em;
    text-align: left;
}
.gm-chat-messages .msg.assistant .gm-chat-body--md th {
    background: rgba(0,0,0,0.25);
    color: var(--tdt-mint);
    font-weight: 600;
    text-shadow: 0 0 3px rgba(0,0,0,0.4);
}
.gm-chat-messages .msg.assistant .gm-chat-body--md tr:nth-child(even) { background: rgba(0,0,0,0.15); }

.gm-chat-messages .msg.assistant .gm-chat-body--md blockquote {
    margin: 0.5em 0;
    padding: 0.4em 0 0.4em 1em;
    border-left: 3px solid var(--tdt-mint);
    color: var(--tdt-beige-light);
    font-style: italic;
}
.gm-chat-messages .msg.assistant .gm-chat-body--md hr {
    margin: 1em 0;
    border: none;
    border-top: 1px solid rgba(212, 197, 168, 0.3);
}
.gm-chat-messages .msg.assistant .gm-chat-body--md code {
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
    font-size: 0.9em;
    word-break: break-word;
    max-width: 100%;
    background: rgba(0,0,0,0.3);
    padding: 0.15em 0.35em;
    border-radius: 4px;
}
.gm-chat-messages .msg.assistant .gm-chat-body--md pre {
    margin: 0.5em 0;
    padding: 0.75em;
    overflow-x: auto;
    max-width: 100%;
    background: rgba(0,0,0,0.35);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.9em;
}
.gm-chat-messages .msg.assistant .gm-chat-body--md pre code { padding: 0; background: none; }
.gm-chat-messages .msg.assistant .gm-chat-body--md a {
    color: var(--tdt-mint);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.gm-chat-messages .msg.assistant .gm-chat-body--md a:hover { color: var(--tdt-mint-light); }

.gm-chat-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}
.gm-chat-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--tdt-cream);
    font-size: 0.9rem;
    cursor: pointer;
}
.gm-chat-checkbox-label input { margin: 0; }
.gm-pending-roll-hint {
    font-size: 0.9rem;
    color: var(--tdt-mint);
    padding: 0.4rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.gm-pending-roll-hint-text {
    flex: 1;
    min-width: 0;
}
.gm-pending-roll-hint .gm-roll-btn {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    background: #643030;
    color: #F3E2A9;
    border: 2px solid #674B1B;
    border-radius: 4px;
    font-family: 'Quintessential', cursive, serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.gm-pending-roll-hint .gm-roll-btn:hover:not(:disabled) {
    background: #fff6df;
    color: #4d3000;
    transform: translateY(-1px);
}
.gm-pending-roll-hint .gm-roll-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.gm-creation-no-buttons-hint {
    font-size: 0.9rem;
    color: var(--tdt-mint);
    padding: 0.4rem 0;
    margin-bottom: 0.25rem;
}

.gm-chat-messages .msg.assistant .gm-roll-request-inline {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25em 0;
    padding: 0.35em 0.5em;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    border: 1px solid rgba(212, 197, 168, 0.3);
}
.gm-chat-messages .msg.assistant .gm-roll-request-inline .gm-roll-text {
    font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
    font-size: 0.95em;
    color: var(--tdt-mint);
    font-weight: 600;
}
.gm-chat-messages .msg.assistant .gm-roll-inline-btn {
    flex-shrink: 0;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    background: #643030;
    color: #F3E2A9;
    border: 2px solid #674B1B;
    border-radius: 4px;
    font-family: 'Quintessential', cursive, serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.gm-chat-messages .msg.assistant .gm-roll-inline-btn:hover {
    background: #fff6df;
    color: #4d3000;
    transform: translateY(-1px);
}

.gm-chat-messages .msg.assistant .gm-creation-block.gm-creation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}
.gm-chat-messages .msg.assistant .gm-creation-option-btn {
    flex-shrink: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    background: #643030;
    color: #F3E2A9;
    border: 2px solid #674B1B;
    border-radius: 4px;
    font-family: 'Quintessential', cursive, serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 0 0 1px #ffebc6;
}
.gm-chat-messages .msg.assistant .gm-creation-option-btn:hover {
    background: #fff6df;
    color: #4d3000;
    transform: translateY(-1px);
    box-shadow: 0 0 15px 5px #ffebc6, 0 4px 8px rgba(0, 0, 0, 0.3);
}
.gm-chat-messages .msg.assistant .gm-creation-block.gm-creation-input {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    align-items: center;
}
.gm-chat-messages .msg.assistant .gm-creation-input-field {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--tdt-beige-warm);
    border-radius: var(--radius-sm);
    color: var(--tdt-cream);
    font-size: 1rem;
    font-family: inherit;
}
.gm-chat-messages .msg.assistant .gm-creation-input-field::placeholder {
    color: rgba(255, 235, 205, 0.5);
}
.gm-chat-messages .msg.assistant .gm-creation-input-field:focus {
    outline: none;
    border-color: var(--tdt-mint);
    box-shadow: 0 0 0 2px rgba(160, 253, 218, 0.2);
}
.gm-chat-messages .msg.assistant .gm-creation-input-submit {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: #643030;
    color: #F3E2A9;
    border: 2px solid #674B1B;
    border-radius: 4px;
    font-family: 'Quintessential', cursive, serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 0 0 1px #ffebc6;
}
.gm-chat-messages .msg.assistant .gm-creation-input-submit:hover {
    background: #fff6df;
    color: #4d3000;
    transform: translateY(-2px);
    box-shadow: 0 0 15px 5px #ffebc6, 0 4px 8px rgba(0, 0, 0, 0.3);
}

.gm-chat-messages .msg.user .gm-chat-body--roll {
    font-size: 0.95em;
}
.gm-chat-messages .msg.user .gm-roll-result-card {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid rgba(212, 197, 168, 0.25);
    padding: 0.75rem 0.85rem;
    margin: 0;
}
.gm-chat-messages .msg.user .gm-roll-outcome {
    font-weight: 700;
    font-size: 1.05em;
    color: var(--tdt-beige-light);
    margin: 0 0 0.6rem 0;
    padding: 0.4rem 0.5rem;
    background: rgba(90, 31, 31, 0.4);
    border-radius: 6px;
    border-left: 4px solid var(--tdt-mint);
    text-shadow: 0 0 4px rgba(0,0,0,0.4);
}
.gm-chat-messages .msg.user .gm-roll-dice-table {
    width: 100%;
    margin: 0.5rem 0 0.75rem 0;
    border-collapse: collapse;
    font-size: 0.9em;
}
.gm-chat-messages .msg.user .gm-roll-dice-table th,
.gm-chat-messages .msg.user .gm-roll-dice-table td {
    border: 1px solid rgba(212, 197, 168, 0.3);
    padding: 0.35rem 0.5rem;
    text-align: left;
    vertical-align: middle;
}
.gm-chat-messages .msg.user .gm-roll-dice-table th {
    width: 6em;
    font-weight: 600;
    color: var(--tdt-mint);
    background: rgba(0,0,0,0.3);
}
.gm-chat-messages .msg.user .gm-roll-dice-table td {
    color: var(--tdt-beige-light);
}
.gm-chat-messages .msg.user .gm-dice-faces {
    font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
    font-size: 1.05em;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.gm-chat-messages .msg.user .gm-dice-kept {
    color: var(--tdt-mint);
}
.gm-chat-messages .msg.user .gm-roll-effects-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.9em;
}
.gm-chat-messages .msg.user .gm-roll-effects-table td {
    border: 1px solid rgba(212, 197, 168, 0.2);
    border-top: none;
    padding: 0.3rem 0.5rem;
    color: rgba(255, 235, 205, 0.95);
}
.gm-chat-messages .msg.user .gm-roll-effects-table tr:first-child td {
    border-top: 1px solid rgba(212, 197, 168, 0.2);
}
.gm-chat-messages .msg.user .gm-roll-effect-cell {
    background: rgba(0,0,0,0.15);
}
.gm-chat-messages .msg.user .gm-roll-effect-cell:empty {
    display: none;
}

.gm-last-rolled {
    animation: gm-last-rolled-pulse 2s ease-out;
}
@keyframes gm-last-rolled-pulse {
    0% { box-shadow: 0 0 0 2px var(--tdt-mint); }
    40% { box-shadow: 0 0 0 2px var(--tdt-mint); }
    100% { box-shadow: none; }
}

.gm-chat-input-row {
    display: flex;
    gap: 0.5rem;
}
.gm-chat-input-row input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--tdt-beige-warm);
    border-radius: var(--radius-sm);
    color: var(--tdt-cream);
    font-size: 1rem;
}
.gm-chat-input-row input::placeholder { color: rgba(255, 235, 205, 0.5); }
.gm-chat-input-row input:focus {
    outline: none;
    border-color: var(--tdt-mint);
    box-shadow: 0 0 0 2px rgba(160, 253, 218, 0.2);
}

.gm-chat-input-row button {
    padding: 0.5rem 1rem;
    background: #643030;
    color: #F3E2A9;
    border: 2px solid #674B1B;
    border-radius: 4px;
    font-family: 'Quintessential', cursive, serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 0 0 1px #ffebc6;
}
.gm-chat-input-row button:hover:not(:disabled) {
    background: #fff6df;
    color: #4d3000;
    transform: translateY(-2px);
    box-shadow: 0 0 15px 5px #ffebc6, 0 4px 8px rgba(0, 0, 0, 0.3);
}
.gm-chat-input-row button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gm-chat-has-character.gm-chat-input--creation-disabled .gm-chat-input-row {
    opacity: 0.55;
    pointer-events: none;
}
.gm-chat-has-character.gm-chat-input--creation-disabled .gm-chat-input-row input,
.gm-chat-has-character.gm-chat-input--creation-disabled .gm-chat-input-row button {
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
}

.gm-chat-mode-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.5rem 0;
    margin-bottom: 0.25rem;
}
.gm-chat-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--tdt-beige-light);
    cursor: pointer;
}
.gm-chat-mode-option input[type="radio"] {
    margin: 0;
}

.gm-chat-test-roll {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(206, 182, 141, 0.3);
    margin-bottom: 0.25rem;
}
.gm-chat-test-roll-label {
    font-size: 0.875rem;
    color: var(--tdt-beige-light);
}
.gm-chat-test-roll-select {
    padding: 0.35rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--tdt-beige-warm);
    border-radius: 4px;
    color: var(--tdt-cream);
    font-size: 0.875rem;
    max-width: 12rem;
}
.gm-chat-test-roll-dice {
    font-size: 0.875rem;
    color: var(--tdt-beige-light);
    font-weight: 600;
}

.gm-chat-test-roll-btn.gm-chat-send-style,
.gm-chat-test-roll-btn {
    padding: 0.5rem 1rem;
    background: #643030;
    color: #F3E2A9;
    border: 2px solid #674B1B;
    border-radius: 4px;
    font-family: 'Quintessential', cursive, serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 0 0 1px #ffebc6;
}
.gm-chat-test-roll-btn:hover {
    background: #fff6df;
    color: #4d3000;
    transform: translateY(-2px);
    box-shadow: 0 0 15px 5px #ffebc6, 0 4px 8px rgba(0, 0, 0, 0.3);
}

.gm-chat-no-character-prompt-actions {
    margin-top: 0.75rem;
}
.gm-chat-create-from-msg-btn.gm-chat-send-style,
.gm-chat-create-from-msg-btn {
    padding: 0.5rem 1rem;
    background: #643030;
    color: #F3E2A9;
    border: 2px solid #674B1B;
    border-radius: 4px;
    font-family: 'Quintessential', cursive, serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 0 0 1px #ffebc6;
}
.gm-chat-create-from-msg-btn:hover {
    background: #fff6df;
    color: #4d3000;
    transform: translateY(-2px);
    box-shadow: 0 0 15px 5px #ffebc6, 0 4px 8px rgba(0, 0, 0, 0.3);
}

.gm-chat-messages .status {
    color: var(--tdt-beige-light);
    font-style: italic;
    padding: 0.5rem;
}
.gm-chat-messages .status.gm-status-thinking {
    color: var(--tdt-mint);
    animation: gm-thinking-pulse 1.2s ease-in-out infinite;
}
@keyframes gm-thinking-pulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}
.gm-chat-messages .gm-msg-streaming .gm-stream-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--tdt-mint);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: gm-cursor-blink 0.8s step-end infinite;
}
@keyframes gm-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.gm-llm-status {
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.35rem;
    transition: opacity 0.4s ease, background 0.3s ease;
}
.gm-llm-status--loading {
    background: rgba(160, 253, 218, 0.10);
    border: 1px solid rgba(160, 253, 218, 0.25);
    color: var(--tdt-mint);
}
.gm-llm-status--loading .gm-llm-status-text {
    animation: gm-thinking-pulse 1.6s ease-in-out infinite;
}
.gm-llm-status--ready {
    background: rgba(160, 253, 218, 0.12);
    border: 1px solid rgba(160, 253, 218, 0.3);
    color: var(--tdt-mint);
    opacity: 1;
    transition: opacity 0.6s ease 1.8s;
}
.gm-llm-status--error {
    background: rgba(200, 60, 60, 0.15);
    border: 1px solid rgba(200, 60, 60, 0.35);
    color: #f0a0a0;
}

.gm-llm-status-bar-track {
    margin-top: 0.35rem;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.gm-llm-status-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--tdt-mint) 0%, rgba(160, 253, 218, 0.6) 100%);
    transition: width 0.4s ease;
}

.gm-chat-no-character-btn:disabled,
.gm-chat-no-character-btn.gm-btn-llm-loading {
    opacity: 0.5;
    cursor: wait;
    pointer-events: none;
}
.gm-chat-input-row button:disabled.gm-btn-llm-loading,
.gm-chat-input-row button.gm-btn-llm-loading {
    opacity: 0.5;
    cursor: wait;
}

.gm-chat-messages .error {
    background: rgba(200, 60, 60, 0.12);
    border: 1px solid rgba(200, 60, 60, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    color: #f0a0a0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.rules-content ul {
    margin-left: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.rules-content li {
    margin-bottom: var(--spacing-xs);
    color: var(--tdt-cream);
}

.rules-content code {
    background: rgba(160, 253, 218, 0.2);
    color: var(--tdt-mint);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.worldlore-ruleset-block {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: var(--spacing-md);
    color: var(--tdt-cream);
}

.worldlore-intro {
    text-align: center;
    color: var(--tdt-cream);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.worldlore-heading {
    text-align: center;
    font-size: 1.8rem;
    color: var(--tdt-cream);
    margin: var(--spacing-xl) 0 var(--spacing-md);
    text-decoration: underline;
}

.worldlore-heading:first-of-type {
    margin-top: var(--spacing-md);
}

.worldlore-columns {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: flex-start;
    margin: var(--spacing-md) 0;
}

.worldlore-block {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: flex-start;
    margin: var(--spacing-md) 0;
}

.worldlore-block-images-stack .worldlore-figure + .worldlore-figure {
    margin-top: var(--spacing-md);
}

.worldlore-block-callout .worldlore-block-left {
    flex: 0 1 38%;
    min-width: 240px;
}

.worldlore-block-callout .worldlore-block-right {
    flex: 1 1 54%;
    min-width: 280px;
}

.worldlore-block-1 .worldlore-block-left {
    flex: 0 1 38%;
    min-width: 240px;
}

.worldlore-block-1 .worldlore-block-right {
    flex: 1 1 54%;
    min-width: 280px;
}

.worldlore-block-matrix-full {
    display: block;
}

.worldlore-block-matrix-full .worldlore-matrix-2x2 {
    max-width: 100%;
}

.worldlore-block-2 .worldlore-block-left {
    flex: 1 1 54%;
    min-width: 280px;
}

.worldlore-block-2 .worldlore-block-right {
    flex: 0 1 38%;
    min-width: 240px;
}

.worldlore-block-matrix {
    display: flex;
    align-items: flex-start;
}

.worldlore-block-matrix .worldlore-matrix-2x2 {
    flex: 1;
    margin-top: 0;
}

.worldlore-matrix-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.worldlore-matrix-cell {
    border-left: 1px solid rgba(30, 30, 30, 0.4);
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-xs);
}

.worldlore-matrix-cell .worldlore-pair-title {
    margin-bottom: 0.2em;
}

.worldlore-matrix-cell .worldlore-pair-p {
    font-size: 0.9rem;
    margin: 0;
}

.worldlore-col {
    flex: 1 1 280px;
    min-width: 0;
}

.worldlore-col-images {
    flex: 0 1 40%;
    max-width: 500px;
}

.worldlore-col-text {
    flex: 1 1 50%;
}

.worldlore-col-narrow {
    flex: 0 0 125px;
}

.worldlore-struggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: stretch;
    margin: var(--spacing-md) 0;
}

.worldlore-struggle-left {
    flex: 1 1 32%;
    min-width: 240px;
}

.worldlore-dice-block {
    margin-top: var(--spacing-md);
}

.worldlore-struggle-center {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.worldlore-figure-strip img {
    width: 125px;
    height: auto;
    max-height: 420px;
    object-fit: contain;
}

.worldlore-struggle-right {
    flex: 1 1 32%;
    min-width: 240px;
}

.worldlore-figure {
    margin: 0 0 var(--spacing-sm);
}

.worldlore-figure img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
}

.worldlore-figure-rounded img {
    border-radius: var(--radius-md);
}

.worldlore-figure-inline {
    text-align: center;
    margin: var(--spacing-sm) 0;
}

.worldlore-figure-rencontres {
    text-align: center;
    margin: var(--spacing-lg) auto;
    max-width: 1024px;
}

.worldlore-figure-rencontres img {
    border-radius: var(--radius-md);
}

.worldlore-coin-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.worldlore-figure-coin {
    margin: 0 auto var(--spacing-sm);
}

.worldlore-figure-coin img {
    width: 193px;
    height: auto;
}

.worldlore-wheels {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-lg);
    margin: var(--spacing-md) auto;
    max-width: 900px;
}

.worldlore-figure-wheel {
    margin: 0;
    flex: 0 0 auto;
}

.worldlore-figure-wheel img {
    max-width: 280px;
    width: 100%;
    height: auto;
}

.worldlore-p {
    color: var(--tdt-beige-light);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 var(--spacing-sm);
}

.worldlore-p strong {
    color: var(--tdt-cream);
}

.worldlore-p em {
    color: var(--tdt-beige-warm);
    font-style: italic;
}

.worldlore-strong {
    margin-bottom: var(--spacing-xs);
}

.worldlore-freeforming {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--tdt-mint);
    margin: var(--spacing-sm) 0;
}

.worldlore-pairs {
    margin-top: var(--spacing-md);
}

.worldlore-pair {
    border-left: 1px solid rgba(30, 30, 30, 0.4);
    padding-left: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.worldlore-pair-title {
    font-size: 1.1rem;
    color: var(--tdt-mint);
    margin: 0 0 0.25em;
    text-decoration: underline;
}

.worldlore-pair-p {
    font-size: 1rem;
    margin: 0;
    color: var(--tdt-beige-light);
}

.worldlore-h4 {
    font-size: 1.1rem;
    color: var(--tdt-cream);
    margin: var(--spacing-sm) 0 0.25em;
}

.worldlore-list {
    list-style: none;
    padding-left: 0;
    margin: 0 0 var(--spacing-sm);
}

.worldlore-list li {
    color: var(--tdt-beige-light);
    font-size: 1rem;
    margin-bottom: 0.25em;
}

.worldlore-center-block {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

.worldlore-center-block .worldlore-p,
.worldlore-center-block .worldlore-h4 {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.worldlore-center-block .worldlore-list {
    text-align: center;
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
}

.worldlore-mint {
    color: var(--tdt-mint);
}

.worldlore-much-more {
    margin-top: var(--spacing-lg);
}

.worldlore-large {
    font-size: 1.2rem;
    color: var(--tdt-cream);
}

.system-overview-dashboard {
    --accordion-border: rgba(212, 197, 168, 0.4);
    --accordion-accent: rgba(90, 31, 31, 0.6);
    --accordion-card-bg: rgba(0, 0, 0, 0.2);
    --accordion-outline: var(--tdt-beige-warm);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xl);
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

.system-overview-nav {
    flex: 0 0 200px;
    min-width: 180px;
    position: sticky;
    top: 7rem;
    align-self: flex-start;
}

.system-overview-nav-title {
    font-size: 1rem;
    color: var(--tdt-cream);
    margin: 0 0 var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--tdt-beige-warm);
}

.system-overview-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.system-overview-nav-list li {
    margin-bottom: 0.35rem;
}

.system-overview-nav-link {
    display: block;
    padding: 0.35rem 0.5rem;
    color: var(--tdt-beige-light);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.system-overview-nav-link:hover,
.system-overview-nav-link:focus {
    background: rgba(160, 253, 218, 0.15);
    color: var(--tdt-mint);
}

.system-overview-content {
    flex: 1 1 500px;
    min-width: 0;
}

.system-overview-accordion {
    margin: var(--spacing-md) 0;
    border: 1px solid var(--accordion-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.system-overview-accordion-item {
    border-bottom: 1px solid var(--accordion-border);
}

.system-overview-accordion-item:last-of-type {
    border-bottom: none;
}

.system-overview-accordion-head {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--tdt-cream);
    background: var(--accordion-card-bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.system-overview-accordion-head:hover,
.system-overview-accordion-head:focus {
    background: var(--accordion-accent);
    color: var(--tdt-cream);
    outline: 2px solid var(--accordion-outline);
    outline-offset: 2px;
}

.system-overview-accordion-head::after {
    content: "▼";
    font-size: 0.7rem;
    opacity: 0.8;
    transition: transform var(--transition-fast);
}

.system-overview-accordion-item .system-overview-accordion-head[aria-expanded="true"]::after,
.system-overview-accordion-item:has(.system-overview-accordion-body.is-open) .system-overview-accordion-head::after {
    transform: rotate(-180deg);
}

.system-overview-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) ease-out;
}

.system-overview-accordion-body.is-open {
    max-height: 4000px;
    transition: max-height var(--transition-slow) ease-in;
}

.system-overview-accordion-body .worldlore-ruleset-block,
.system-overview-accordion-body .worldlore-block,
.system-overview-accordion-body .worldlore-struggle-row,
.system-overview-accordion-body .worldlore-center-block,
.system-overview-accordion-body .worldlore-wheels {
    padding: var(--spacing-md);
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
}

.system-overview-accordion-actions {
    margin: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    display: flex;
    gap: var(--spacing-sm);
}

.system-overview-expand-all,
.system-overview-collapse-all {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    color: var(--tdt-beige-light);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--tdt-beige);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.system-overview-expand-all:hover,
.system-overview-collapse-all:hover {
    background: var(--accordion-accent);
    color: var(--tdt-cream);
}

.callout {
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.callout-freeforming {
    background: rgba(160, 253, 218, 0.08);
    border-left-color: var(--tdt-mint);
    text-align: center;
}

.callout-freeforming .worldlore-p,
.callout-freeforming .worldlore-strong {
    text-align: center;
}

.callout-struggle {
    background: rgba(212, 197, 168, 0.12);
    border-left-color: var(--tdt-beige-warm);
}

.callout-traits {
    background: rgba(160, 253, 218, 0.08);
    border-left-color: var(--tdt-mint);
}

.system-overview-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1rem;
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.system-overview-flow-step {
    padding: 0.5rem 1rem;
    background: rgba(160, 253, 218, 0.15);
    border: 1px solid var(--tdt-mint);
    border-radius: var(--radius-sm);
}

.system-overview-flow-label {
    font-weight: 600;
    color: var(--tdt-mint);
}

.system-overview-flow-arrow {
    color: var(--tdt-beige-warm);
    font-size: 1.2rem;
}

.worldlore-matrix-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.system-overview-card {
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid rgba(212, 197, 168, 0.3);
}

.system-overview-cards-section {
    width: 100%;
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
    background: linear-gradient(to right, rgba(107, 40, 40, 0.2) 0%, rgba(90, 31, 31, 0.25) 100%);
    border-radius: var(--radius-md);
}

.system-overview-cards-block {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.system-overview-cards-block:last-child {
    margin-bottom: 0;
}

.system-overview-cards-title {
    font-size: 1.5rem;
    color: var(--tdt-cream);
    margin: 0 0 var(--spacing-sm);
}

.system-overview-cards-intro {
    color: var(--tdt-beige-light);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.attributes-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.attribute-card {
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 197, 168, 0.35);
    border-radius: var(--radius-md);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.attribute-card:hover {
    box-shadow: 0 0 12px rgba(160, 253, 218, 0.2);
    transform: translateY(-2px);
}

.attribute-card-abbrev {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: var(--tdt-burgundy-warm);
    color: var(--tdt-cream);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.attribute-card-name {
    font-size: 1.1rem;
    color: var(--tdt-cream);
    margin: 0 0 var(--spacing-sm);
}

.attribute-card-aptitudes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.aptitude-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background: rgba(212, 197, 168, 0.2);
    color: var(--tdt-beige-light);
    border-radius: var(--radius-sm);
}

.aptitude-badge.aptitude-principal {
    background: rgba(160, 253, 218, 0.2);
    color: var(--tdt-mint);
}

.attributes-tree-wrap {
    min-width: 0;
    margin: var(--spacing-md) 0;
}

.attributes-tree {
    border: 1px solid rgba(212, 197, 168, 0.4);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 252, 248, 0.05);
    color: var(--tdt-cream);
}

.attributes-tree-node {
    margin: var(--spacing-xs) 0;
    color: var(--tdt-cream);
}

.attributes-tree-toggle {
    display: inline-block;
    width: 1.2em;
    margin-right: var(--spacing-xs);
    cursor: pointer;
    font-size: 0.85em;
    color: var(--tdt-beige-light);
    transition: color var(--transition-fast);
    user-select: none;
}

.attributes-tree-toggle:hover {
    color: var(--tdt-mint);
}

.attributes-tree-node[aria-expanded="true"] > .attributes-tree-toggle::before {
    content: '▼';
}

.attributes-tree-node[aria-expanded="false"] > .attributes-tree-toggle::before {
    content: '▶';
}

.attributes-tree-node[aria-expanded="false"] > .attributes-tree-children {
    display: none;
}

.attributes-tree-node[data-attribute] {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid rgba(212, 197, 168, 0.15);
}

.attributes-tree-node[data-attribute]:last-child {
    border-bottom: none;
}

.attributes-tree-attr-abbrev {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    background: var(--tdt-burgundy-warm);
    color: var(--tdt-cream);
    border-radius: var(--radius-sm);
    margin-right: var(--spacing-xs);
    vertical-align: middle;
}

.attributes-tree-attr-name {
    font-weight: 700;
    color: var(--tdt-cream);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    transition: color var(--transition-fast);
}

.attributes-tree-attr-name:hover {
    color: var(--tdt-gold);
}

.attributes-tree-node[data-attribute] > .attributes-tree-children {
    margin-left: var(--spacing-md);
    padding-left: var(--spacing-sm);
    border-left: 2px solid var(--tdt-burgundy-warm);
    margin-top: var(--spacing-xs);
}

.attributes-tree-aptitude-node {
    margin: var(--spacing-xs) 0;
}

.attributes-tree-aptitude-name {
    font-weight: 600;
    color: var(--tdt-beige-light);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    transition: color var(--transition-fast);
}

.attributes-tree-aptitude-name:hover {
    color: var(--tdt-gold);
}

.attributes-tree-aptitude-name.aptitude-principal {
    color: var(--tdt-mint);
}

.attributes-tree-aptitude-name.aptitude-principal:hover {
    color: #c0ffe8;
}

.attributes-tree-aptitude-name-secondary {
    text-decoration: none !important;
    color: var(--tdt-beige);
    opacity: 0.85;
}

.attributes-tree-aptitude-name-secondary:hover {
    color: var(--tdt-beige-light);
}

.attributes-tree-toggle-link {
    cursor: pointer;
}

.attributes-tree-toggle-link::before {
    content: '↗' !important;
    font-size: 0.9em;
}

.attributes-tree-toggle-link:hover {
    color: var(--tdt-mint);
}

.attributes-tree-see-link {
    font-size: 0.8em;
    color: var(--tdt-beige);
    opacity: 0.7;
    margin-left: var(--spacing-sm);
    cursor: pointer;
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

.attributes-tree-see-link:hover {
    color: var(--tdt-mint);
    opacity: 1;
}

.attributes-tree-highlight {
    animation: attributes-tree-highlight-pulse 1.5s ease-out;
}

@keyframes attributes-tree-highlight-pulse {
    0% {
        background-color: rgba(160, 253, 218, 0.3);
    }
    100% {
        background-color: transparent;
    }
}

.attributes-tree-weight {
    font-size: 0.75em;
    color: var(--tdt-beige);
    opacity: 0.7;
    margin-left: var(--spacing-xs);
    font-family: 'Courier New', monospace;
}

.attributes-tree-aptitude-node > .attributes-tree-children {
    margin-left: var(--spacing-md);
    padding-left: var(--spacing-sm);
    border-left: 2px solid rgba(160, 253, 218, 0.3);
    margin-top: var(--spacing-xs);
}

.attributes-tree-action-node {
    margin: var(--spacing-xs) 0;
}

.attributes-tree-action-name {
    font-weight: 500;
    color: var(--tdt-beige-light);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    transition: color var(--transition-fast);
}

.attributes-tree-action-name:hover {
    color: var(--tdt-gold);
}

.attributes-tree-linked-attr {
    font-size: 0.7em;
    color: var(--tdt-beige);
    opacity: 0.6;
    margin-left: var(--spacing-xs);
    font-family: 'Courier New', monospace;
}

.attributes-tree-action-node > .attributes-tree-children {
    margin-left: var(--spacing-md);
    padding-left: var(--spacing-sm);
    border-left: 2px solid rgba(212, 197, 168, 0.2);
    margin-top: var(--spacing-xs);
}

.attributes-tree-competence-node {
    margin: var(--spacing-xs) 0;
}

.attributes-tree-competence-name {
    font-weight: 400;
    color: var(--tdt-beige-light);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    font-size: 0.9em;
    transition: color var(--transition-fast);
}

.attributes-tree-competence-name:hover {
    color: var(--tdt-gold);
}

.attributes-tree-competence-node > .attributes-tree-children {
    margin-left: var(--spacing-md);
    padding-left: var(--spacing-sm);
    border-left: 1px solid rgba(212, 197, 168, 0.15);
    margin-top: var(--spacing-xs);
}

.attributes-tree-masteries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: var(--spacing-xs) 0;
}

.attributes-tree-mastery {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    background: rgba(212, 197, 168, 0.15);
    color: var(--tdt-beige);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(212, 197, 168, 0.2);
    position: relative;
    cursor: default;
}

.attributes-tree-mastery.has-tooltip {
    cursor: help;
    border-bottom: 1px dotted var(--tdt-beige);
}

.attributes-tree-mastery.has-tooltip:hover {
    background: rgba(212, 197, 168, 0.25);
}

.attributes-tree-mastery.has-tooltip::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.6rem;
    background: rgba(31, 31, 31, 0.95);
    color: var(--tdt-beige);
    font-size: 0.7rem;
    line-height: 1.3;
    border-radius: var(--radius-sm);
    border: 1px solid var(--tdt-gold);
    white-space: nowrap;
    max-width: 250px;
    white-space: normal;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    margin-bottom: 0.3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.attributes-tree-mastery.has-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

.attributes-tree-mastery.has-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--tdt-gold);
    margin-bottom: -6px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.attributes-tree-mastery.has-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

.attributes-tree-attr-content,
.attributes-tree-aptitude-content,
.attributes-tree-action-content,
.attributes-tree-competence-content {
    margin-top: var(--spacing-xs);
    margin-left: 1.7em;
    padding: var(--spacing-sm) var(--spacing-md);
    border-left: 3px solid var(--tdt-burgundy-warm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.88em;
    color: var(--tdt-beige-light);
}

.attributes-tree-attr-content[hidden],
.attributes-tree-aptitude-content[hidden],
.attributes-tree-action-content[hidden],
.attributes-tree-competence-content[hidden] {
    display: none !important;
}

.attributes-tree-desc-body {
    margin: 0;
    line-height: 1.5;
}

.attributes-tree-desc-body p {
    margin: 0;
}

@media (max-width: 768px) {
    .attributes-tree {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .attributes-tree-node[data-attribute] > .attributes-tree-children,
    .attributes-tree-aptitude-node > .attributes-tree-children,
    .attributes-tree-action-node > .attributes-tree-children,
    .attributes-tree-competence-node > .attributes-tree-children {
        margin-left: var(--spacing-sm);
        padding-left: var(--spacing-xs);
    }

    .attributes-tree-attr-content,
    .attributes-tree-aptitude-content,
    .attributes-tree-action-content,
    .attributes-tree-competence-content {
        margin-left: 0.5em;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

.conflicts-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.conflict-card {
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 197, 168, 0.35);
    border-radius: var(--radius-md);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.conflict-card:hover {
    box-shadow: 0 0 12px rgba(160, 253, 218, 0.2);
    transform: translateY(-2px);
}

.conflict-card-type {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    font-weight: 600;
    font-size: 1rem;
    background: var(--tdt-mint);
    color: var(--tdt-burgundy);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.conflict-card-aptitude {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
    background: rgba(212, 197, 168, 0.3);
    color: var(--tdt-beige-light);
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.conflict-card-object,
.conflict-card-obstacle {
    font-size: 0.9rem;
    color: var(--tdt-beige-light);
    margin: 0.35rem 0;
    line-height: 1.5;
}

@media screen and (max-width: 900px) {
    .system-overview-nav {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .worldlore-columns {
        flex-direction: column;
    }
    .worldlore-block {
        flex-direction: column;
    }
    .worldlore-block-callout .worldlore-block-left,
    .worldlore-block-callout .worldlore-block-right,
    .worldlore-block-1 .worldlore-block-left,
    .worldlore-block-1 .worldlore-block-right,
    .worldlore-block-2 .worldlore-block-left,
    .worldlore-block-2 .worldlore-block-right {
        flex: 1 1 100%;
        min-width: 0;
    }
    .worldlore-block-2 .worldlore-block-left {
        order: 1;
    }
    .worldlore-block-2 .worldlore-block-right {
        order: 2;
    }
    .worldlore-matrix-2x2 {
        grid-template-columns: 1fr;
    }
    .worldlore-struggle-row {
        flex-direction: column;
    }
    .worldlore-struggle-left,
    .worldlore-struggle-center,
    .worldlore-struggle-right {
        flex: 1 1 100%;
        min-width: 0;
    }
    .worldlore-struggle-center {
        order: 0;
    }
    .worldlore-figure-strip img {
        max-height: 320px;
    }
    .worldlore-col {
        flex: 1 1 100%;
        min-width: 0;
    }
    .worldlore-col-images,
    .worldlore-col-text,
    .worldlore-col-narrow {
        flex: 1 1 100%;
        max-width: none;
    }
    .worldlore-wheels {
        flex-direction: column;
        align-items: center;
    }
    .worldlore-figure-wheel img {
        max-width: 240px;
    }
    .worldlore-matrix-cards {
        grid-template-columns: 1fr;
    }
    .attributes-cards {
        grid-template-columns: 1fr;
    }
    .conflicts-cards {
        grid-template-columns: 1fr;
    }
}

.about-section {
    padding: var(--spacing-md) var(--spacing-md);
    margin: var(--spacing-md) 0;
    background: rgba(92, 29, 29, 0.4);
    border-radius: var(--radius-md);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.about-section h3 {
    font-size: 2rem;
    color: var(--tdt-mint);
    margin-bottom: var(--spacing-md);
}

.genres-intro {
    text-align: center;
    max-width: 75ch;
    margin: 0 auto var(--spacing-md);
    color: var(--tdt-cream);
    font-size: 1.1rem;
}

.genre-card-full {
    grid-column: 1 / -1;
    max-width: 900px;
    margin: 0 auto;
}

.genre-example {
    font-style: italic;
    color: var(--tdt-beige-warm);
    opacity: 0.9;
    margin-top: var(--spacing-xs);
}

.inspirations-intro {
    text-align: center;
    max-width: 75ch;
    margin: 0 auto var(--spacing-md);
    color: var(--tdt-cream);
    font-size: 1.1rem;
}

.inspirations-content h4 {
    color: var(--tdt-cream);
    font-size: 1.8rem;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.inspirations-table-wrapper {
    overflow-x: auto;
    margin: var(--spacing-md) 0;
    -webkit-overflow-scrolling: touch;
}

.inspirations-table {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-collapse: collapse;
    background: rgba(70, 0, 0, 0.4);
    border: 2px solid var(--tdt-beige);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.inspirations-table thead {
    background: rgba(217, 205, 184, 0.2);
}

.inspirations-table th {
    color: var(--tdt-cream);
    font-family: var(--font-heading);
    padding: var(--spacing-sm);
    text-align: left;
    font-weight: 900;
    border-bottom: 2px solid var(--tdt-beige);
}

.inspirations-table td {
    color: var(--tdt-cream);
    padding: var(--spacing-sm);
    border-bottom: 1px solid rgba(139, 115, 85, 0.2);
}

.inspirations-table tbody tr:hover {
    background: rgba(217, 205, 184, 0.1);
    box-shadow: inset 0 0 15px rgba(217, 205, 184, 0.3);
}

.inspirations-table em {
    color: var(--tdt-beige-warm);
    font-style: italic;
}

.table-note {
    text-align: center;
    font-style: italic;
    color: var(--tdt-beige-warm);
    padding: var(--spacing-md);
}

.inspirations-expandable {
    margin: var(--spacing-md) 0;
    border: 1px solid var(--tdt-beige);
    border-radius: var(--radius-md);
    background: rgba(70, 0, 0, 0.3);
    overflow: hidden;
}

.inspirations-expandable summary {
    list-style: none;
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--tdt-cream);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    user-select: none;
}

.inspirations-expandable summary::-webkit-details-marker {
    display: none;
}

.inspirations-expandable summary::before {
    content: "▸ ";
    display: inline-block;
    margin-right: 0.35em;
    transition: transform var(--transition-fast);
}

.inspirations-expandable[open] summary::before {
    transform: rotate(90deg);
}

.inspirations-expandable[open] summary {
    border-bottom: 1px solid rgba(139, 115, 85, 0.3);
    margin-bottom: 0;
}

.inspirations-expandable > .inspirations-table-wrapper,
.inspirations-expandable > .inspirations-list,
.inspirations-expandable > .inspirations-keywords,
.inspirations-expandable > .inspirations-langs-scripts {
    padding: var(--spacing-md);
}

.inspirations-langs-scripts {
    color: var(--tdt-cream);
    font-size: 0.95rem;
    line-height: 1.6;
}

.inspirations-langs-heading {
    margin: var(--spacing-sm) 0 0.25em;
    color: var(--tdt-mint);
}

.inspirations-langs-heading:first-child {
    margin-top: 0;
}

.inspirations-langs-list {
    margin: 0 0 var(--spacing-sm);
    color: var(--tdt-cream);
}

.inspirations-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    color: var(--tdt-cream);
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: 50vh;
    overflow-y: auto;
}

.inspirations-list li {
    padding: 0.25em 0;
    border-bottom: 1px solid rgba(139, 115, 85, 0.15);
}

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

.inspirations-list em {
    color: var(--tdt-beige-warm);
    font-style: italic;
}

.inspirations-list a {
    color: var(--tdt-mint);
    text-decoration: underline;
}

.inspirations-list a:hover {
    color: var(--tdt-mint-light);
}

.inspirations-keywords {
    padding: 0;
}

.inspirations-keyword-category {
    margin: 0.5em 0;
    border: 1px solid rgba(139, 115, 85, 0.25);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
}

.inspirations-keyword-category summary {
    padding: 0.4em var(--spacing-sm);
    font-size: 0.95rem;
    color: var(--tdt-mint);
}

.inspirations-keyword-category summary::before {
    content: "▸ ";
    font-size: 0.85em;
}

.inspirations-keyword-category[open] summary::before {
    transform: rotate(90deg);
}

.inspirations-keyword-category p {
    margin: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--tdt-cream);
    font-size: 0.9rem;
    line-height: 1.5;
}

.inspirations-keyword-category em {
    color: var(--tdt-beige-warm);
    font-style: italic;
}

.rules-table-wrapper,
.lore-table-wrapper {
    overflow-x: auto;
    margin: var(--spacing-md) 0;
    -webkit-overflow-scrolling: touch;
}
.rules-table-wrapper::-webkit-scrollbar,
.lore-table-wrapper::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}
.rules-table-wrapper::-webkit-scrollbar-track,
.lore-table-wrapper::-webkit-scrollbar-track {
    background: var(--tdt-burgundy);
    border-radius: var(--radius-sm);
}
.rules-table-wrapper::-webkit-scrollbar-thumb,
.lore-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--tdt-brown);
    border-radius: var(--radius-sm);
    border: 1px solid var(--tdt-beige);
}
.rules-table,
.lore-table {
    width: 100%;
    min-width: 320px;
    margin: 0 auto;
    border-collapse: collapse;
    background: rgba(70, 0, 0, 0.4);
    border: 2px solid var(--tdt-beige);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.rules-table thead,
.lore-table thead {
    background: rgba(217, 205, 184, 0.2);
}
.rules-table th,
.rules-table td,
.lore-table th,
.lore-table td {
    color: var(--tdt-cream);
    padding: var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid rgba(139, 115, 85, 0.2);
}
.rules-table th,
.lore-table th {
    font-family: var(--font-heading);
    font-weight: 900;
    border-bottom: 2px solid var(--tdt-beige);
}
.rules-table tbody tr:hover,
.lore-table tbody tr:hover {
    background: rgba(217, 205, 184, 0.1);
}

.peoples-intro {
    margin: 0;
    max-width: 75ch;
}

.peoples-top {
    margin-bottom: var(--spacing-md);
}

.peoples-tree-origin-name {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}
.peoples-tree-origin-name:hover {
    color: var(--tdt-gold, #c9a227);
}

.peoples-tree-wrap {
    min-width: 0;
    margin: var(--spacing-md) 0;
}

.peoples-tree {
    border: 1px solid var(--tdt-beige);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    background: var(--tdt-cream);
    color: #1a0808;
}
.peoples-tree-node {
    margin: var(--spacing-xs) 0;
    color: #1a0808;
}
.peoples-tree-node strong {
    color: var(--tdt-burgundy);
    font-weight: 700;
}
.peoples-tree-name {
    font-weight: 600;
    color: var(--tdt-burgundy);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}
.peoples-tree-morality {
    font-size: 0.85em;
    color: var(--tdt-brown);
    margin-left: var(--spacing-xs);
}
.peoples-tree-morality em {
    font-style: normal;
    opacity: 0.9;
}
.peoples-tree-node[data-origin] > .peoples-tree-children {
    margin-left: var(--spacing-md);
    border-left: 2px solid var(--tdt-burgundy-warm);
    padding-left: var(--spacing-sm);
}
.peoples-tree-toggle {
    display: inline-block;
    width: 1em;
    margin-right: var(--spacing-xs);
    cursor: pointer;
    font-size: 0.85em;
    color: var(--tdt-burgundy);
}
.peoples-tree-node[aria-expanded="true"] > .peoples-tree-toggle::before {
    content: '▼';
}
.peoples-tree-node[aria-expanded="false"] > .peoples-tree-toggle::before {
    content: '▶';
}
.peoples-tree-node[aria-expanded="false"] > .peoples-tree-children {
    display: none;
}
.peoples-tree-races {
    display: block;
    margin-top: var(--spacing-xs);
    margin-left: var(--spacing-md);
    padding-left: var(--spacing-sm);
    border-left: 1px solid var(--tdt-burgundy-warm);
    font-size: 0.9em;
    color: var(--tdt-brown);
}
.peoples-tree-race {
    display: block;
    margin-top: 2px;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.peoples-tree-people-content[hidden],
.peoples-tree-race-content[hidden],
.peoples-tree-origin-content[hidden] {
    display: none !important;
}

.peoples-tree-people-content .peoples-flip-back-inner {
    transform: none;
}

.peoples-tree-people-content,
.peoples-tree-people-content *,
.peoples-tree-race-content,
.peoples-tree-race-content *,
.peoples-tree-origin-content,
.peoples-tree-origin-content * {
    box-shadow: none !important;
    text-shadow: none !important;
}

.peoples-tree-people-content {
    margin-top: var(--spacing-xs);
    margin-left: var(--spacing-md);
    padding: 0.35rem 0.6rem;
    border-left: 3px solid var(--tdt-brown);
    background: var(--tdt-beige-lighter);
    border-radius: 0 6px 6px 0;
    font-size: 0.88em;
    color: #2c2419;
}
.peoples-tree-people-content * {
    color: inherit;
}
.peoples-tree-people-content .peoples-back-section {
    margin-bottom: 0 !important;
    margin-top: 0.2rem;
}
.peoples-tree-people-content .peoples-back-section:first-child {
    margin-top: 0;
}
.peoples-tree-people-content .peoples-back-section:last-child {
    margin-bottom: 0 !important;
}
.peoples-tree-people-content .lore-table-wrapper {
    margin: 0.15rem 0;
}
.peoples-tree-people-content h5,
.peoples-tree-people-content h6 {
    margin: 0 0 0.15rem;
    color: #3d2e24;
    font-weight: 600;
    font-size: 0.9rem;
}
.peoples-tree-people-content p {
    margin: 0 0 0.2em;
    line-height: 1.4;
}
.peoples-tree-people-content p:last-child {
    margin-bottom: 0;
}
.peoples-tree-people-content .peoples-relations-section p span {
    font-weight: 600 !important;
}
.peoples-tree-people-content .lore-table,
.peoples-tree-people-content .peoples-attr-table,
.peoples-tree-people-content .peoples-phys-table {
    margin: 0 0 0.15rem;
    font-size: 0.85em;
    background: rgba(255, 252, 248, 0.6);
    border: 1px solid var(--tdt-brown);
    border-radius: 4px;
    color: #2c2419;
}
.peoples-tree-people-content .peoples-attr-table th,
.peoples-tree-people-content .peoples-attr-table td {
    padding: 2px 4px;
    text-align: center;
}
.peoples-tree-people-content .lore-table th,
.peoples-tree-people-content .lore-table td,
.peoples-tree-people-content .peoples-attr-table th,
.peoples-tree-people-content .peoples-attr-table td,
.peoples-tree-people-content .peoples-phys-table th,
.peoples-tree-people-content .peoples-phys-table td {
    color: #2c2419;
    border-color: rgba(139, 115, 85, 0.25);
}
.peoples-tree-people-content .lore-table th,
.peoples-tree-people-content .peoples-attr-table th,
.peoples-tree-people-content .peoples-phys-table th {
    background: rgba(139, 115, 85, 0.12);
    color: #3d2e24;
}
.peoples-tree-people-content .peoples-competences-table {
    margin: 0 0 0.15rem;
    font-size: 0.85em;
}
.peoples-tree-people-content .peoples-competences-table th {
    font-weight: 700;
    text-align: left;
    padding: 2px 6px 2px 0;
    width: 1%;
    white-space: nowrap;
    color: #3d2e24;
}
.peoples-tree-people-content .peoples-competences-table td {
    padding: 2px 0;
    color: #2c2419;
}
.peoples-tree-race-row {
    display: block;
    margin-top: 2px;
}
.peoples-tree-race-content {
    margin-top: var(--spacing-xs);
    margin-left: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-left: 3px solid var(--tdt-brown);
    background: var(--tdt-beige-lighter);
    border-radius: 0 6px 6px 0;
    font-size: 0.88em;
    color: #2c2419;
}
.peoples-tree-race-content * {
    color: inherit;
}
.peoples-tree-race-body p {
    margin: 0;
    line-height: 1.5;
    color: #2c2419;
}

.peoples-tree-origin-content {
    margin-top: var(--spacing-xs);
    margin-left: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-left: 3px solid var(--tdt-brown);
    background: var(--tdt-beige-lighter);
    border-radius: 0 6px 6px 0;
    font-size: 0.88em;
    color: #2c2419;
}
.peoples-tree-origin-content * {
    color: inherit;
}
.peoples-tree-origin-body {
    margin: 0;
    line-height: 1.5;
    color: #2c2419;
}

.peoples-gallery--hidden {
    display: none !important;
}

.peoples-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}
.peoples-flip-card {
    position: relative;
    perspective: 1000px;
    min-height: 280px;
    transition: transform var(--transition-normal);
    transform-style: preserve-3d;
}
.peoples-flip-card.flipped {
    transform: rotateY(180deg);
}
.peoples-flip-front,
.peoples-flip-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    overflow: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    background: linear-gradient(135deg, var(--tdt-beige-lighter) 0%, var(--tdt-beige-warm) 50%, var(--tdt-beige-light) 100%);
    border: 1px solid var(--tdt-burgundy-warm);
}
.peoples-flip-back {
    transform: rotateY(180deg);
}
.peoples-flip-back-inner {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}
.peoples-origin-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--tdt-burgundy-warm);
    color: var(--tdt-cream);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
}
.peoples-morality-line {
    margin: var(--spacing-xs) 0;
    font-size: 0.95rem;
}
.peoples-morality-line em {
    font-style: normal;
    color: var(--tdt-brown);
}
.peoples-races-mini {
    list-style: none;
    margin: var(--spacing-xs) 0;
    padding-left: 0;
    font-size: 0.9rem;
}
.peoples-races-mini li {
    padding-left: var(--spacing-sm);
    position: relative;
}
.peoples-races-mini li::before {
    content: '•';
    color: var(--tdt-burgundy-warm);
    position: absolute;
    left: 0;
}
.peoples-hook {
    margin-top: auto;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--tdt-brown);
}
.peoples-flip-btn {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--tdt-burgundy-warm);
    color: var(--tdt-cream);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: background var(--transition-fast);
}
.peoples-flip-btn:hover {
    background: var(--tdt-dark-red);
}
.peoples-flip-back-btn {
    margin-top: auto;
}
.peoples-back-section {
    margin-bottom: var(--spacing-md);
}
.peoples-back-section h6 {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 0.95rem;
    color: var(--tdt-burgundy);
}
.peoples-attr-table,
.peoples-phys-table {
    font-size: 0.9rem;
    width: 100%;
}
.peoples-attr-table th,
.peoples-phys-table th,
.peoples-attr-table td,
.peoples-phys-table td {
    padding: 2px 6px;
}
.attr-sex-diff td:nth-child(2) {
    font-variant-numeric: tabular-nums;
}

.peoples-flip-card.peoples-hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .peoples-gallery {
        grid-template-columns: 1fr;
    }
    .peoples-flip-card {
        min-height: 260px;
    }
}

.genre-card ul {
    list-style: none;
    margin-left: 0;
}

.genre-card li {
    margin-bottom: var(--spacing-xs);
    padding-left: var(--spacing-sm);
    position: relative;
}

.genre-card li::before {
    content: '•';
    color: var(--tdt-burgundy-warm);
    position: absolute;
    left: 0;
}

.site-footer {
    background-color: var(--tdt-dark-red);
    border-top: 2px solid var(--tdt-beige);
    padding: var(--spacing-md);
    text-align: center;
    margin-top: var(--spacing-lg);
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    color: var(--tdt-beige-warm);
    margin-bottom: var(--spacing-sm);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

.social-links a {
    color: var(--tdt-beige-warm);
    transition: all var(--transition-normal);
    padding: var(--spacing-sm);
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
}

.social-links a:hover {
    color: var(--tdt-cream);
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(255, 245, 221, 0.6);
}

@media screen and (max-width: 768px) {
    :root {
        font-size: 14px;
    }

    .discovery-kickstarter-title {
        font-size: 2.25rem;
    }

    .discovery-kickstarter-tagline {
        font-size: 1rem;
    }

    .menu-toggle {
        display: block;
    }

    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .menu.active {
        display: flex;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .outpost-form {
        flex-direction: column;
    }

    .outpost-form input[type="email"],
    .outpost-form .outpost-cta {
        width: 100%;
        min-width: 0;
    }

    .site-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .tab-sub-nav {
        gap: var(--spacing-xs);
    }
    .tab-sub-nav-link {
        font-size: 0.85rem;
        padding: var(--spacing-xs);
    }
    .rules-table,
    .lore-table {
        font-size: 0.9rem;
    }
    .rules-table th,
    .rules-table td,
    .lore-table th,
    .lore-table td {
        padding: var(--spacing-xs);
    }
    .inspirations-expandable summary {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 1rem;
        min-height: var(--touch-min);
        display: flex;
        align-items: center;
    }
    .inspirations-table {
        font-size: 0.9rem;
    }
    .inspirations-table th,
    .inspirations-table td {
        padding: var(--spacing-xs);
    }
    .inspirations-list {
        font-size: 0.9rem;
        max-height: 45vh;
    }

    #play-panel-zine .zine-content.zine-layout {
        flex-direction: column;
    }
    .zine-sidebar {
        flex-shrink: 0;
        padding-right: 0;
        padding-bottom: var(--spacing-sm);
        border-right: none;
        border-bottom: 1px solid rgba(217, 205, 184, 0.3);
    }
    .zine-pages-nav {
        flex-direction: row;
        flex-wrap: wrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .zine-page-nav-label {
        white-space: nowrap;
        min-height: var(--touch-min);
        padding: var(--spacing-sm) var(--spacing-md);
        display: inline-flex;
        align-items: center;
    }
    .zine-peoples-grid {
        grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    }

    .play-panels-layout {
        flex-direction: column;
    }
    .play-panels-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-sm);
    }
    .play-panel-btn {
        flex: 1 1 auto;
        min-width: 80px;
        min-height: var(--touch-min);
    }

    .gm-chat-toolbar-btn,
    .gm-chat-no-character-btn,
    .gm-chat-kill-create-btn,
    .gm-roll-inline-btn,
    .gm-creation-option-btn,
    .gm-creation-input-submit,
    .gm-chat-input-row button {
        min-height: var(--touch-min);
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .outpost-form .outpost-cta,
    .outpost-form button[type="submit"] {
        min-height: var(--touch-min);
    }

    .inspirations-expandable summary {
        min-height: var(--touch-min);
        display: flex;
        align-items: center;
    }

    .peoples-tree-races {
        margin-left: var(--spacing-sm);
        padding-left: var(--spacing-xs);
    }
    .peoples-tree-people-content,
    .peoples-tree-race-content,
    .peoples-tree-origin-content {
        margin-left: var(--spacing-sm);
        padding: 0.3rem 0.4rem;
    }
    .peoples-tree-people-content .lore-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .peoples-tree-people-content .peoples-competences-table th {
        white-space: normal;
    }

    .system-overview-accordion-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .attributes-tree-mastery.has-tooltip::after {
        max-width: min(250px, calc(100vw - 2rem));
        left: 0;
        transform: none;
    }
    .attributes-tree-mastery.has-tooltip::before {
        left: 1rem;
        transform: none;
    }

    .creation-pillars {
        grid-template-columns: 1fr;
    }

    .gm-chat-no-character-buttons {
        flex-wrap: wrap;
    }

    .worldlore-figure-coin img {
        width: min(193px, 100%);
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .discovery-kickstarter-title {
        font-size: 1.75rem;
    }

    .discovery-kickstarter-tagline {
        font-size: 0.95rem;
    }

    .cta-button {
        font-size: 1.1rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .tab-sub-nav {
        gap: 0.25rem;
    }
    .tab-sub-nav-link {
        font-size: 0.8rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .rules-table th,
    .rules-table td,
    .lore-table th,
    .lore-table td,
    .inspirations-table th,
    .inspirations-table td {
        padding: 0.25rem 0.35rem;
    }
    .combat-table th,
    .combat-table td,
    .magic-table th,
    .magic-table td {
        padding: 0.25rem 0.35rem;
    }

    .lore-content,
    .rules-content,
    .inspirations-expandable .inspirations-keywords p,
    .inspirations-list {
        font-size: clamp(0.875rem, 1em, 1rem);
    }
    .conflict-card-object,
    .conflict-card-obstacle {
        font-size: 0.875rem;
    }
}

.hidden {
    display: none !important;
}

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

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

.webgl-bg-canvas,
.webgl-header-canvas {

    width: 100% !important;
    height: 100% !important;

    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

@supports not (background: url('#test')) {
    .webgl-bg-canvas,
    .webgl-header-canvas {
        display: none;
    }

    body {
        background:
            linear-gradient(
                135deg,
                rgba(90, 31, 31, 0.95) 0%,
                rgba(74, 24, 24, 0.98) 50%,
                rgba(58, 16, 16, 1) 100%
            ),
            repeating-linear-gradient(
                45deg,
                transparent,
                transparent 20px,
                rgba(196, 181, 154, 0.05) 20px,
                rgba(196, 181, 154, 0.05) 40px
            );
    }

    .header-bg {
        background:
            linear-gradient(
                to bottom,
                rgba(92, 29, 29, 0.85) 0%,
                rgba(70, 0, 0, 0.7) 50%,
                rgba(92, 29, 29, 0.95) 100%
            ),
            repeating-linear-gradient(
                90deg,
                transparent,
                transparent 30px,
                rgba(245, 230, 196, 0.1) 30px,
                rgba(245, 230, 196, 0.1) 60px
            );
    }
}

@media screen and (max-width: 768px) {

    .webgl-bg-canvas,
    .webgl-header-canvas {
        opacity: 0.2;
    }

    .decorated-card,
    .genre-card {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3))
                drop-shadow(0 4px 8px rgba(90, 31, 31, 0.3));
    }

    .cardGlow,
    .titleGlow {
        animation-duration: 3s;
    }

    h1, h2, h3, h4, h5, h6 {
        text-shadow:
            1px 1px 2px rgba(90, 31, 31, 0.4),
            0 0 12px rgba(245, 230, 196, 0.2);
    }

    .site-title {
        text-shadow:
            2px 2px 4px rgba(0, 0, 0, 0.4),
            0 0 16px rgba(245, 230, 196, 0.3);
    }
}

@media screen and (max-width: 480px) {

    .webgl-bg-canvas,
    .webgl-header-canvas {
        display: none;
    }

    body {
        background:
            linear-gradient(
                135deg,
                rgba(90, 31, 31, 0.98) 0%,
                rgba(74, 24, 24, 1) 100%
            );
    }

    .decorated-card::before,
    .decorated-card::after,
    .card-decoration-top,
    .card-decoration-bottom {
        opacity: 0.2;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .webgl-bg-canvas,
    .webgl-header-canvas {

        image-rendering: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .webgl-bg-canvas,
    .webgl-header-canvas {

        opacity: 0.3;
    }

    .titleGlow,
    .cardGlow,
    .mysticalPulse {
        animation: none;
    }

    .tab-link:hover,
    .decorated-card:hover {
        transform: none;
    }
}

@media print {
    .webgl-bg-canvas,
    .webgl-header-canvas {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .decorated-card,
    .genre-card {
        box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
        border: 1px solid #ccc;
    }
}
