/* Import centralized theme system */
@import './theme.css?v=6';

/* Font Faces */
@font-face {
    font-family: 'PressGothic';
    src: url('../fonts/pressgothic.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Dark Theme Override — bridged onto the shared pr-design-system tokens
   so dark matches the game pages (#0e0e0e scale), instead of the old
   local #1a1a1a scale. Literals are only fallbacks. */
[data-theme="dark"] {
    --bg-primary: var(--bg-base, var(--bg-primary-dark));
    --bg-secondary: var(--bg-surface, var(--bg-secondary-dark));
    --bg-tertiary: var(--bg-hover, var(--bg-tertiary-dark));
    --text-primary: #f0f0f0;
    --text-secondary: #d0d0d0;
    --text-muted: #b0b0b0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading, 400);
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-5xl);
}

h2 {
    font-size: var(--font-size-4xl);
}

h3 {
    font-size: var(--font-size-3xl);
}

h4 {
    font-size: var(--font-size-2xl);
}

h5 {
    font-size: var(--font-size-xl);
}

h6 {
    font-size: var(--font-size-lg);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

a {
    color: var(--primary-gold);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-gold-dark);
    text-decoration: underline;
}

/* Header */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background-color var(--transition-normal);
    backdrop-filter: blur(10px);
}

.header .container {
    height: 100%;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo picture {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
    vertical-align: middle;
}

.logo-text {
    font-family: var(--font-family-title);
    font-size: var(--font-size-2xl);
    font-weight: bold;
    color: var(--primary-gold);
    text-transform: uppercase;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    position: relative;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    margin: 0;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-gold);
    background-color: var(--bg-tertiary);
    text-decoration: none;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background-color: var(--primary-gold);
    color: var(--bg-primary);
}

/* Main Content */
/* The header is sticky (in flow), not fixed — no header-height spacer here. */
.main {
    min-height: calc(100vh - var(--header-height));
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: var(--spacing-3xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/banner.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: -1;
}

/* Use WebP if supported, fallback to PNG */
@supports (background-image: url('data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA')) {
    .hero::before {
        background-image: url('../images/banner.webp');
    }
}

/* Use AVIF if supported (best compression) */
@supports (background-image: url('data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQ==')) {
    .hero::before {
        background-image: url('../images/banner.avif');
    }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-family-title);
    font-weight: normal;
    font-size: var(--font-size-5xl);
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
}

.hero-subtitle {
    font-size: var(--font-size-2xl);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle-branded {
    font-family: var(--font-family-title);
}

.hero-description {
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    max-width: var(--text-max-width);
    margin: 0 auto var(--spacing-xl);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--font-size-base);
}

.btn-primary {
    background-color: var(--primary-gold);
    color: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--primary-gold-dark);
    color: var(--bg-primary);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-gold);
    border: 2px solid var(--primary-gold);
}

.btn-secondary:hover {
    background-color: var(--primary-gold);
    color: var(--bg-primary);
    text-decoration: none;
}

.btn-group {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* Features Section */
.features {
    padding: var(--spacing-3xl) 0;
    background-color: var(--bg-primary);
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-subtitle {
    text-align: center;
    max-width: var(--content-max-width);
    margin: 0 auto;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

.section-cta-link {
    text-align: center;
    margin-top: var(--spacing-2xl);
}

.section-cta-link a {
    color: var(--primary-gold);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
}

.section-cta-link a:hover {
    text-decoration: underline;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--card-standard-width), 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
}

.feature-card {
    background-color: var(--bg-secondary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 1px solid var(--bg-tertiary);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-gold);
}

.feature-icon {
    margin-bottom: var(--spacing-md);
    display: block;
    line-height: 0;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary-gold);
}

.feature-title {
    color: var(--primary-gold);
    margin-bottom: var(--spacing-md);
}

.feature-description {
    color: var(--text-secondary);
}

/* Stats Section */
.stats {
    background-color: var(--bg-secondary);
    padding: var(--spacing-2xl) 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    text-align: center;
}

.stat-card {
    padding: var(--spacing-lg);
}

.stat-number {
    font-size: var(--font-size-4xl);
    font-weight: bold;
    color: var(--primary-gold);
    display: block;
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
}

/* Call to Action */
.cta {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: var(--spacing-3xl) 0;
    text-align: center;
    border-top: 1px solid rgba(213, 182, 64, 0.15);
    position: relative;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
}

.cta h2 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.cta p {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta .btn-secondary {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.cta .btn-secondary:hover {
    background-color: var(--primary-gold);
    color: var(--bg-primary);
    border-color: var(--primary-gold);
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--bg-tertiary);
    padding: var(--spacing-2xl) 0;
    text-align: center;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h3 {
    color: var(--primary-gold);
    margin-bottom: var(--spacing-md);
}

.footer-section h3.project-title {
    font-family: var(--font-family-title);
    font-size: var(--font-size-3xl);
    text-transform: uppercase;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--spacing-sm);
}

.footer-section ul li a {
    color: var(--text-secondary);
}

.footer-bottom {
    border-top: 1px solid var(--bg-tertiary);
    padding-top: var(--spacing-lg);
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1040px) {
    :root {
        --spacing-3xl: 2rem;
        --spacing-2xl: 1.5rem;
    }

    .header-content {
        height: var(--header-height);
        padding: 0;
    }


    /* Hide desktop navigation by default */
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 280px;
        height: calc(100vh - var(--header-height));
        background-color: var(--bg-secondary);
        backdrop-filter: blur(10px);
        border-left: 1px solid var(--bg-tertiary);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: var(--spacing-xl);
        box-shadow: var(--shadow-lg);
        transition: right var(--transition-normal);
        z-index: 1000;
        overflow-y: auto;
    }

    /* Show mobile menu when active */
    .nav-menu.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: var(--spacing-md);
        width: 100%;
        margin-bottom: var(--spacing-xl);
    }

    .nav-link {
        display: block;
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
        text-align: center;
        border: 1px solid var(--bg-tertiary);
        background-color: var(--bg-primary);
        transition: all var(--transition-fast);
    }

    .nav-link:hover,
    .nav-link.active {
        background-color: var(--primary-gold);
        color: var(--bg-primary);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .theme-toggle {
        width: 100%;
        padding: var(--spacing-md);
        font-size: var(--font-size-base);
    }

    /* Mobile menu overlay */
    .nav-menu::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
        z-index: -1;
    }

    .nav-menu.active::before {
        opacity: 1;
        visibility: visible;
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-xl);
    }

    .btn-group {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: var(--button-max-width);
    }

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

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero {
        padding: var(--spacing-2xl) 0;
    }

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* Image placeholder for performance optimization */
.image-placeholder {
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-tertiary);
}

/* Performance optimizations */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Reduce layout shift with aspect ratio containers */
.aspect-ratio-container {
    position: relative;
    overflow: hidden;
}

.aspect-ratio-container::before {
    content: '';
    display: block;
    padding-top: var(--aspect-ratio, 56.25%);
    /* 16:9 default */
}

.aspect-ratio-container>* {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Additional Page Styles */

/* Active navigation link */
.nav-link.active {
    color: var(--primary-gold);
    font-weight: 600;
}

/* Rules Page Styles */
.rules-hero {
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
}

.rules-content {
    padding: var(--spacing-3xl) 0;
}

.rule-section {
    margin-bottom: var(--spacing-3xl);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.rule-card {
    background: var(--bg-secondary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-gold);
    transition: var(--transition-normal);
}

.rule-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.rule-card h3 {
    color: var(--primary-gold);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-lg);
}

.rule-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}


.step-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    position: relative;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 32px;
    bottom: -var(--spacing-xl);
    width: 2px;
    height: var(--spacing-xl);
    background: var(--primary-gold);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-gold);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.step-content h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-xl);
}

.step-content p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.guide-content {
    padding: var(--spacing-3xl) 0;
    background: var(--bg-secondary);
}

.guide-section {
    margin-bottom: var(--spacing-3xl);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.guide-card {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-tertiary);
    transition: var(--transition-normal);
}

.guide-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.guide-card h3 {
    color: var(--primary-gold);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-lg);
}

.guide-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.guide-card ul {
    list-style: none;
    padding: 0;
}

.guide-card li {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-md);
    position: relative;
}

.guide-card li::before {
    content: '▸';
    color: var(--primary-gold);
    position: absolute;
    left: 0;
}

/* FAQ Styles */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.faq-item {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bg-tertiary);
    transition: var(--transition-normal);
}

.faq-item:hover {
    border-color: var(--primary-gold);
    transform: translateY(-1px);
}

.faq-item h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive Design for New Pages */
@media (max-width: 1040px) {
    .step-item {
        flex-direction: column;
        text-align: center;
    }

    .step-item::after {
        display: none;
    }

    .rules-grid,
    .guide-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .step-timeline {
        gap: var(--spacing-lg);
    }
}



/* Universe Page Styles */

/* Stories Section */
.stories-section {
    padding: var(--spacing-3xl) 0;
    background-color: var(--bg-primary);
}

.section-description {
    text-align: center;
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto var(--spacing-2xl);
}

/* Story Modal */
.story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.story-modal.active {
    display: flex;
}

.story-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.story-modal-content {
    position: relative;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-radius: var(--radius-xl);
    max-width: 66vw;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(213, 182, 84, 0.1);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.story-modal-close {
    position: sticky;
    top: var(--spacing-lg);
    float: right;
    margin-right: var(--spacing-lg);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.story-modal-close:hover {
    background: var(--accent-danger);
    color: white;
    border-color: var(--accent-danger);
    transform: rotate(90deg);
}

.story-modal-body {
    padding: var(--spacing-3xl) var(--spacing-2xl);
}

.story-modal-header {
    margin-bottom: var(--spacing-2xl);
    text-align: center;
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid rgba(213, 182, 84, 0.2);
}

.story-modal-title {
    font-family: var(--font-family-title);
    font-size: var(--font-size-4xl);
    color: var(--primary-gold);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(213, 182, 84, 0.3);
}

.story-modal-hero {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
    opacity: 0.8;
}

.story-modal-text {
    line-height: 1.9;
    font-size: var(--font-size-base);
    max-width: 100%;
    margin: 0 auto;
}

.story-modal-text p {
    margin-bottom: var(--spacing-xl);
    color: var(--text-primary);
    text-align: left;
    white-space: pre-wrap;
    font-weight: 400;
}

.story-modal-text p:first-child::first-letter {
    font-size: 3.5em;
    float: left;
    color: var(--primary-gold);
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 4px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(213, 182, 84, 0.3);
}

.story-modal-text p:first-child {
    font-size: var(--font-size-lg);
}

/* Responsive Design for Universe Page */
@media (max-width: 1040px) {
    .story-modal-content {
        margin: var(--spacing-lg);
        max-height: calc(100vh - 2 * var(--spacing-lg));
        max-width: calc(100vw - 2 * var(--spacing-lg));
    }

    .story-modal-body {
        padding: var(--spacing-2xl) var(--spacing-xl);
    }

    .story-modal-title {
        font-size: var(--font-size-3xl);
    }
}

@media (max-width: 768px) {
    .story-modal {
        padding: 0;
    }

    .story-modal-content {
        margin: 0;
        max-width: 100vw;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .story-modal-body {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .story-modal-title {
        font-size: var(--font-size-xl);
    }

    .story-modal-hero {
        font-size: var(--font-size-sm);
    }

    .story-modal-text {
        font-size: var(--font-size-sm);
        line-height: 1.6;
    }

    .story-modal-text p {
        margin-bottom: var(--spacing-md);
    }

    .story-modal-text p:first-child::first-letter {
        font-size: 2.5em;
    }

    .story-modal-close {
        width: 36px;
        height: 36px;
        margin-right: var(--spacing-sm);
    }

    .story-modal-header {
        margin-bottom: var(--spacing-md);
        padding-bottom: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .stories-section {
        padding: var(--spacing-xl) 0;
    }

    .story-modal-body {
        padding: var(--spacing-sm);
    }

    .story-modal-header {
        margin-bottom: var(--spacing-sm);
        padding-bottom: var(--spacing-xs);
    }

    .story-modal-title {
        font-size: var(--font-size-lg);
    }

    .story-modal-hero {
        font-size: var(--font-size-xs);
    }

    .story-modal-text {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .story-modal-text p {
        margin-bottom: var(--spacing-sm);
    }

    .story-modal-text p:first-child::first-letter {
        font-size: 2.2em;
        margin-right: 4px;
    }
}
/* ── Bande légale ────────────────────────────────────────────────────────────
   Rendue par le serveur, en dehors du pied de page. Ce dernier est un web
   component : ses liens vivent dans un shadow DOM que seul JavaScript
   construit. Sans cette bande, une page servie pendant que `components.js`
   échoue — ou lue par un robot — n'offrirait aucun accès aux mentions légales.
   Elle est donc dans `main.css`, le seul feuille chargée par TOUTES les pages,
   et pas dans `vitrine.css` que `404.html` et `rp-geopolitique.html` ignorent.
   ────────────────────────────────────────────────────────────────────────── */
.legal-strip {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 1.25rem;
	padding: 1rem;
	font-size: 0.85rem;
	background-color: var(--bg-secondary, #14161a);
	border-top: 1px solid var(--bg-tertiary, #23262c);
}

.legal-strip a {
	color: var(--text-secondary, #a8adb7);
	text-decoration: none;
}

.legal-strip a:hover,
.legal-strip a:focus-visible {
	color: var(--primary-gold, #d5b654);
	text-decoration: underline;
}

/* ── Pages légales ────────────────────────────────────────────────────────── */
/* Les pages légales occupent la coquille du site, comme le règlement et le
   forum RP. Elles étaient une colonne de 52rem centrée dans 1600 px : le texte
   flottait au milieu du vide pendant que toutes les pages voisines
   remplissaient l'écran. `52rem` n'apparaissait qu'une fois dans cette
   feuille — ces trois pages étaient les seules dans ce cas.

   Élargir le texte n'était pas le remède : 1600 px de longueur de ligne ne se
   lisent pas. La mesure reste à 52rem, et c'est la colonne de gauche qui
   occupe le reste. */
.v-legal-shell {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	align-items: start;
	gap: 2.5rem;
	max-width: var(--v-shell, 1600px);
	margin: 0 auto;
	padding: 0 1.25rem;
}

.v-legal-aside {
	position: sticky;
	top: 84px;
	padding: 2.5rem 0 2rem;
	/* `min-width: 0` : sans lui, un descendant de grille garde `min-width:
	   auto` et un titre long repousserait la colonne du texte. */
	min-width: 0;
}

.v-legal-aside__title {
	display: block;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-muted, #7c828d);
	margin-bottom: 0.75rem;
}

.v-legal-toc {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	border-left: 1px solid var(--bg-tertiary, #23262c);
}

.v-legal-toc a {
	padding: 0.4rem 0 0.4rem 0.9rem;
	margin-left: -1px;
	border-left: 2px solid transparent;
	color: var(--text-secondary, #a8adb7);
	text-decoration: none;
	font-size: 0.92rem;
	line-height: 1.35;
	transition: color 0.15s, border-color 0.15s;
}

.v-legal-toc a:hover,
.v-legal-toc a:focus-visible {
	color: var(--primary-gold, #d5b654);
	border-left-color: var(--primary-gold, #d5b654);
}

.v-legal {
	max-width: 52rem;
	padding: 2.5rem 0 4rem;
	line-height: 1.65;
	min-width: 0;
}

/* Une ancre amène le titre sous l'en-tête collant si rien ne l'en empêche :
   le lecteur clique « Vos droits » et atterrit sur le paragraphe d'avant. */
.v-legal section {
	scroll-margin-top: 96px;
}

/* Sous 1040 px l'aside cesse d'être une colonne : le sommaire passe au-dessus
   du texte, comme celui du règlement. Le seuil est le même à dessein — deux
   valeurs différentes donneraient deux ruptures visibles en redimensionnant. */
@media (max-width: 1040px) {
	.v-legal-shell {
		display: block;
	}

	.v-legal-aside {
		position: static;
		padding: 2rem 0 0;
	}

	.v-legal {
		max-width: 52rem;
		margin: 0 auto;
	}
}

.v-legal h1 {
	color: var(--primary-gold, #d5b654);
	margin-bottom: 0.25rem;
}

.v-legal-date {
	color: var(--text-muted, #7c828d);
	font-size: 0.9rem;
	margin-top: 0;
}

.v-legal section {
	margin-top: 2.5rem;
}

.v-legal h2 {
	font-size: 1.35rem;
	border-bottom: 1px solid var(--bg-tertiary, #23262c);
	padding-bottom: 0.4rem;
}

.v-legal dt {
	font-weight: 600;
	margin-top: 0.9rem;
}

.v-legal dd {
	margin: 0.2rem 0 0 0;
	color: var(--text-secondary, #a8adb7);
}

/* Le tableau des durées est la partie la plus large de ces pages : sur mobile
   il doit défiler dans son propre cadre plutôt que d'élargir le document. */
.v-legal-table {
	display: block;
	overflow-x: auto;
	width: 100%;
	border-collapse: collapse;
	margin-top: 1rem;
	font-size: 0.92rem;
}

.v-legal-table th,
.v-legal-table td {
	border: 1px solid var(--bg-tertiary, #23262c);
	padding: 0.55rem 0.7rem;
	text-align: left;
	vertical-align: top;
}

.v-legal-table th {
	background-color: var(--bg-secondary, #14161a);
	color: var(--primary-gold, #d5b654);
	white-space: nowrap;
}

/* Un défaut de configuration doit se voir sur la page, pas seulement dans les
   logs : ces mentions-là sont obligatoires, et un blanc discret passerait pour
   une mise en page. */
.v-legal-warning {
	border-left: 3px solid #c8553d;
	background-color: rgba(200, 85, 61, 0.09);
	padding: 0.7rem 1rem;
	margin: 1rem 0;
}

.v-legal-note {
	color: var(--text-muted, #7c828d);
	font-size: 0.9rem;
	border-left: 2px solid var(--bg-tertiary, #23262c);
	padding-left: 0.9rem;
}
