
:root {
    --primary-color: #6B46C1;
    --primary-dark: #553C9A;
    --primary-light: #8B5CF6;
    --primary-lighter: #A78BFA;
    --background-dark: #221235; 
    --background-darker: #45006C;
    --background-thumbnail: #18002f;
    --background-light: #352D4F;
    --text-light: #FFFFFF;
    --text-muted: #B8B3C7;
    --border-color: #4A3F6B; 
    --border-light: #5A4F7A; 
    --hover-color: #7C3AED;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    background-color: var(--background-darker);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
}

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-light);
    border-radius: 6px;
    transition: color 0.3s, background-color 0.3s;
}

.nav-burger:hover {
    color: var(--primary-light);
    background: rgba(255, 255, 255, 0.05);
}

.nav-burger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}

.main-nav.is-open .nav-burger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.main-nav.is-open .nav-burger-bar:nth-child(2) {
    opacity: 0;
}

.main-nav.is-open .nav-burger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.nav-link:hover {
    color: var(--primary-light);
}

.nav-dropdown {
    position: relative;
}

.dropdown-arrow {
    font-size: 0.7rem;
    margin-left: 0.3rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--background-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 180px;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    font-size: 1rem;
}

.dropdown-item:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.dropdown-item:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.dropdown-item .lang-flag {
    margin-right: 0.5rem;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Home page */
.home-hero {
    text-align: center;
    padding: 4rem 2rem;
}

.logo-container {
    margin-bottom: 2rem;
}

.logo {
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
}

.main-title {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 0.3rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.title-divider {
    width: 200px;
    height: 2px;
    background: var(--primary-color);
    margin: 0 auto 2rem;
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1rem;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Home sections */
.home-section {
    margin-top: 4rem;
    padding-top: 2rem;
}

.home-about {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.home-about-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
}

/* About – What do I use? */
.about-setup {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.about-setup-heading {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-align: center;
}

.about-setup-intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.5rem;
}

.about-setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .about-setup-grid {
        grid-template-columns: 1fr;
    }
}

.about-setup-block {
    background: var(--background-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    text-align: left;
}

.about-setup-category {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-lighter);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.about-setup-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.about-setup-item {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 0.35rem 0;
    padding-left: 1.25rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.about-setup-item:not(:has(.about-setup-icon))::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    background: var(--primary-light);
    border-radius: 50%;
}

.about-setup-item:has(.about-setup-icon) {
    padding-left: 0;
    align-items: flex-start;
}

.about-setup-pc-specs {
    display: block;
    padding-left: 1.25rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    position: relative;
}

.about-setup-pc-specs::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1rem;
    width: 5px;
    height: 5px;
    background: var(--primary-light);
    border-radius: 50%;
}

.about-setup-pc-specs-label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
}

.about-setup-pc-specs .about-setup-sublist {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.about-setup-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    margin-top: 0.15em;
}

.about-setup-sublist {
    list-style: none;
    margin: 0.5rem 0 0 0;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.about-setup-sublist li {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.2rem 0;
    position: relative;
    padding-left: 0.75rem;
}

.about-setup-sublist li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: var(--primary-light);
    font-weight: bold;
}

/* Home gallery preview */
.home-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.home-gallery-item {
    display: block;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.home-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.25);
}

.home-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-commissions {
    text-align: center;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.home-commissions-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Visual Novels Preview */
.visual-novels-preview {
    margin-top: 4rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.vn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.vn-card {
    background: var(--background-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.vn-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.vn-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.vn-thumbnail {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.vn-thumbnail-placeholder {
    width: 100%;
    height: 300px;
    background: var(--background-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.vn-title {
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.vn-date {
    padding: 0 1rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.view-all-link {
    text-align: center;
    margin-top: 2rem;
}

/* Buttons - Utilise maintenant buttons.css */

/* Gallery */
.gallery-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.gallery-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--background-darker);
    border-radius: 8px;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
}

.nsfw-toggles-container {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.nsfw-toggle-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 1600px) {
    .nsfw-toggles-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .nsfw-toggle-item {
        width: 100%;
    }
}

.filter-select {
    padding: 0.5rem 1rem;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.active-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    font-weight: 500;
}

.active-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--primary-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.remove-filter {
    color: var(--text-light);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

.remove-filter:hover {
    color: #ff6b6b;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.filter-toggle input[type="checkbox"] {
    position: relative;
    width: 50px;
    height: 26px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 26px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.filter-toggle input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-light);
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-toggle input[type="checkbox"]:checked::before {
    left: 26px;
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.gallery-container {
    margin-top: 2rem;
}

.gallery-load-more-sentinel {
    height: 1px;
    width: 100%;
    visibility: hidden;
    pointer-events: none;
}

.gallery-year-section {
    margin-bottom: 4rem;
}

.year-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    background: var(--background-darker);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.gallery-image {
    width: 100%;
    height: 100%;
    display: block;
    transition: opacity 0.3s;
    object-fit: contain; /* Affiche l'image complète sans zoom excessif */
    object-position: center; /* Centre l'image */
    max-width: 100%;
    max-height: 100%;
}

.gallery-item:hover .gallery-image {
    opacity: 0.9;
}

.image-tags {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.gallery-item:hover .image-tags {
    opacity: 1;
}

.image-tag {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.image-tag:hover {
    background: var(--hover-color);
}

.character-tag {
    background: var(--primary-light);
}

/* NSFW Blur and Overlay Styles */
/* Wrapper pour les images de la galerie */
.gallery-image-wrapper {
    position: relative;
    width: 100%;
    height: 400px; /* Hauteur fixe pour uniformiser - format portrait (plus long que large) */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-thumbnail); /* Fond pour les images avec object-fit: contain */
}

/* Wrapper spécifique pour les miniatures de sets */
.set-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%; /* Prend la hauteur du parent (.set-thumbnail = 400px) */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-dark); /* Fond pour les images avec object-fit: contain */
}

.gallery-image-wrapper .gallery-link,
.gallery-image-wrapper .set-modal-image-link {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.set-image-wrapper .set-link {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pictogramme vidéo sur les miniatures */
.video-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border-radius: 6px;
    pointer-events: none;
}
.video-badge svg {
    flex-shrink: 0;
}
.video-badge-set {
    top: 0.5rem;
    right: 0.5rem;
}

.nsfw-container {
    position: relative;
}

.nsfw-blurred {
    filter: blur(25px);
    transition: filter 0.3s ease;
}

.nsfw-blurred.no-blur {
    filter: blur(0);
}

.nsfw-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.nsfw-overlay:hover {
    pointer-events: none;
}

.nsfw-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.nsfw-overlay.hidden * {
    pointer-events: none !important;
}

.nsfw-warning {
    text-align: center;
    padding: 1.5rem;
    background: rgba(26, 21, 48, 0.95);
    border-radius: 8px;
    border: 2px solid var(--warning-color);
    max-width: 90%;
    pointer-events: auto;
}

.nsfw-warning-text {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.nsfw-toggle-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nsfw-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Gallery Tabs - Segmented Control Style */
.gallery-tabs {
    display: inline-flex;
    gap: 0;
    justify-content: center;
    padding: 0.25rem;
    background: var(--background-darker);
    border-radius: 12px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-tab {
    padding: 0.875rem 2.25rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    border-radius: 8px;
    min-width: 120px;
}

.gallery-tab:hover:not(.active) {
    color: var(--text-light);
}

.gallery-tab.active {
    color: var(--text-light);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 2px 8px rgba(107, 70, 193, 0.4),
                0 0 0 1px rgba(107, 70, 193, 0.2);
    transform: translateY(-1px);
}

.gallery-tab-content {
    display: none;
}

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

.filter-input {
    padding: 0.5rem 1rem;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 1rem;
    min-width: 250px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

/* Sets */
.sets-container {
    margin-top: 2rem;
}

.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.set-item {
    position: relative;
    background: var(--background-darker);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out; /* Transition définie ici */
}

.set-item:hover {
    transform: translateY(-3px); /* Légère élévation au lieu de scale */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Ombre pour l'effet de profondeur */
}

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

.set-thumbnail {
    position: relative;
    width: 100%;
    height: 400px; /* Hauteur fixe pour uniformiser */
    overflow: hidden; /* Garde le dégradé dans les limites */
    background: var(--background-thumbnail);
    z-index: 1;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.set-image,
.set-image-wrapper video.set-image {
    width: 100%;
    height: 100%;
    display: block;
    transition: opacity 0.3s;
    z-index: 1;
    object-fit: contain; /* Affiche l'image/vidéo complète sans zoom excessif */
    object-position: center; /* Centre l'image */
    max-width: 100%;
    max-height: 100%;
}

.set-item:hover .set-image {
    opacity: 0.9;
}

.set-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2; /* Au-dessus de l'image */
    box-sizing: border-box;
}

.set-item:hover .set-overlay {
    opacity: 1;
}

.set-image-count {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    line-height: 1.2;
}

.set-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.set-tags .image-tag {
    margin-right: 0.5rem;
    margin-bottom: 0.4rem;
}

.set-tags .image-tag:last-child {
    margin-right: 0;
}

.set-info {
    padding: 1rem;
    position: relative;
    z-index: 3;
    width: 100%;
    box-sizing: border-box;
    min-height: 60px; /* Hauteur minimale pour uniformiser */
    display: flex;
    align-items: center; /* Centre le titre verticalement dans la zone */
    cursor: pointer;
}

.set-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
    margin: 0;
}

.set-item-empty {
    display: block;
}

.set-placeholder {
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
}

/* Set Modal */
.set-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    overflow-y: auto;
    padding: 2rem;
}

.set-modal.active {
    display: block;
}

.set-modal-content {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--background-darker);
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.set-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
    z-index: 10;
}

.set-modal-close-symbol {
    display: block;
    transform: translateY(-0.2rem);
    line-height: 1;
    pointer-events: none;
}

.set-modal-close:hover {
    background: var(--background-light);
}

.set-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    padding-right: 3.5rem; /* Espace pour le bouton de fermeture */
    border-bottom: 2px solid var(--border-color);
}

.set-modal-title {
    font-size: 1.8rem;
    color: var(--text-light);
    margin: 0;
}

.set-modal-count {
    color: var(--text-muted);
    font-size: 1rem;
    margin-right: 1rem; /* Espacement supplémentaire avant le bouton de fermeture */
}

.set-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.set-modal-item {
    position: relative;
    background: var(--background-dark);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.set-modal-item:hover {
    transform: scale(1.02);
}

.set-modal-image-link {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.set-modal-image,
.set-modal-image-link video.set-modal-image {
    width: 100%;
    height: auto;
    max-height: 100%;
    display: block;
    transition: opacity 0.3s;
    object-fit: contain;
}

/* Vidéo dans la grille du modal : forcer la taille pour afficher la miniature (première frame) */
.set-modal-item .gallery-image-wrapper .set-modal-image-link video.set-modal-image {
    height: 100%;
    min-height: 200px;
    object-fit: contain;
}

.set-modal-item:hover .set-modal-image {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .set-modal {
        padding: 1rem;
    }
    
    .set-modal-content {
        padding: 1.5rem;
    }
    
    .set-modal-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}

/* Visual Novels Page */
.visual-novels-page {
    max-width: 1400px;
    margin: 0 auto;
}

.vn-filters {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background-darker);
    border-radius: 8px;
    flex-wrap: wrap;
}

.vn-search-container {
    flex: 1;
    min-width: 250px;
}

.vn-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.vn-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.vn-search-input::placeholder {
    color: var(--text-muted);
}

.vn-sort-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vn-sort-label {
    color: var(--text-light);
    font-weight: 500;
}

.vn-sort-select {
    padding: 0.75rem 1rem;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.vn-sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.vn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(560px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.vn-card {
    background: var(--background-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.vn-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

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

.vn-card-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--background-dark);
    position: relative;
}

.vn-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.vn-card:hover .vn-card-image {
    transform: scale(1.05);
}

.vn-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    text-align: center;
    padding: 1rem;
}

.vn-card-content {
    padding: 1.5rem;
}

.vn-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.vn-card-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vn-card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.vn-no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Visual Novel Player */
.visual-novel-page {
    max-width: 1900px;
    margin: 0 auto;
}

.vn-header {
    margin-bottom: 2rem;
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--primary-light);
    text-decoration: none;
}

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

.vn-player {
    margin-top: 2rem;
    background: var(--background-darker);
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    position: relative;
    width: 100%;
    max-width: 1800px;
    aspect-ratio: 16 / 9;
}

.vn-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 4px;
    display: block;
}

/* Bouton plein écran */
.vn-fullscreen-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.vn-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--primary-light);
    transform: scale(1.1);
}

.vn-fullscreen-btn:active {
    transform: scale(0.95);
}

.vn-fullscreen-btn:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.vn-fullscreen-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Style en mode plein écran */
.vn-player:fullscreen,
.vn-player:-webkit-full-screen,
.vn-player:-moz-full-screen,
.vn-player:-ms-fullscreen {
    /* width et height gérés par JavaScript pour respecter 16:9 */
    /* Les dimensions sont forcées via styles inline avec !important */
    border-radius: 0;
    margin: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    overflow: hidden;
    /* Force le conteneur à ne pas s'étirer */
    box-sizing: border-box;
}

.vn-player:fullscreen .vn-iframe,
.vn-player:-webkit-full-screen .vn-iframe,
.vn-player:-moz-full-screen .vn-iframe,
.vn-player:-ms-fullscreen .vn-iframe {
    border-radius: 0;
    position: relative;
    margin: auto;
    display: block;
}

/* Ref Sheets Page */
.ref-sheets-page {
    max-width: 1400px;
    margin: 0 auto;
}

.ref-sheets-filters {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background-darker);
    border-radius: 8px;
    flex-wrap: wrap;
}

.ref-sheets-search-container {
    flex: 1;
    min-width: 250px;
}

.ref-sheets-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.ref-sheets-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.ref-sheets-search-input::placeholder {
    color: var(--text-muted);
}

.ref-sheets-sort-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ref-sheets-sort-label {
    color: var(--text-light);
    font-weight: 500;
}

.ref-sheets-sort-select {
    padding: 0.75rem 1rem;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.ref-sheets-sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.ref-sheets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.ref-sheet-card {
    background: var(--background-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ref-sheet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

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

.ref-sheet-card-thumbnail {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: var(--background-dark);
    position: relative;
}

.ref-sheet-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.ref-sheet-card:hover .ref-sheet-card-image {
    transform: scale(1.05);
}

.ref-sheet-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    text-align: center;
    padding: 1rem;
}

.ref-sheet-card-content {
    padding: 1.5rem;
}

.ref-sheet-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.ref-sheet-card-race {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.ref-sheet-card-affiliation {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.ref-sheets-no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Ref Sheet Detail Page */
.ref-sheet-page {
    max-width: 1200px;
    margin: 0 auto;
}

.ref-sheet-header {
    margin-bottom: 2rem;
}

.ref-sheet-title {
    font-size: 2.5rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

.ref-sheet-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ref-sheet-main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    background: var(--background-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
}

.ref-sheet-image-container {
    width: 100%;
}

.ref-sheet-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.ref-sheet-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ref-sheet-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ref-sheet-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-light);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.ref-sheet-info-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ref-sheet-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ref-sheet-info-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ref-sheet-info-value {
    font-size: 1.1rem;
    color: var(--text-light);
}

.ref-sheet-info-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.5;
}

.ref-sheet-colors {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ref-sheet-color-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ref-sheet-color-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 100px;
}

.ref-sheet-color-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
}

.ref-sheet-color-badge:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.ref-sheet-color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.ref-sheet-color-name {
    color: var(--text-light);
    font-weight: 500;
}

.ref-sheet-color-hex {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.9rem;
}

.ref-sheet-measurements {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ref-sheet-measurement-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ref-sheet-measurement-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 150px;
}

.ref-sheet-measurement-value {
    color: var(--text-light);
    font-size: 1.1rem;
}

.ref-sheet-background {
    margin-top: 1rem;
}

.ref-sheet-background-text {
    color: var(--text-light);
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ref-sheet-relationships-section {
    background: var(--background-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
}

.ref-sheet-relationships {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.ref-sheet-relationship {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ref-sheet-relationship:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.ref-sheet-relationship-pfp {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.ref-sheet-relationship-pfp-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--background-light);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-light);
}

.ref-sheet-relationship-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}

.ref-sheet-relationship-name {
    font-weight: 600;
    color: var(--text-light);
}

.ref-sheet-relationship-type {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ref-sheet-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.ref-sheet-gallery-link {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s, transform 0.3s;
}

.ref-sheet-gallery-link:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
}

/* Footer */
.main-footer {
    background-color: var(--background-darker);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.copyright {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.social-link {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.social-link:hover {
    color: var(--primary-light);
}

.social-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s;
    object-fit: contain;
}

.social-link:hover .social-icon {
    transform: scale(1.1);
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-code {
    font-size: 6rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

/* No results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-burger {
        display: flex;
    }

    .main-nav {
        justify-content: flex-end;
        gap: 0;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1rem;
        margin-top: 0;
        background: var(--background-darker);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
        z-index: 1000;
    }

    .main-nav.is-open .nav-menu {
        display: flex;
    }

    .nav-menu .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 6px;
    }

    .nav-menu .nav-link:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .nav-menu .nav-dropdown .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-top: 0.25rem;
        margin-bottom: 0.5rem;
        margin-left: 1rem;
        min-width: auto;
        border: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
    }

    .nav-menu .dropdown-arrow {
        display: none;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .vn-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .vn-link {
        flex-direction: column;
    }
    
    .vn-item .vn-thumbnail,
    .vn-item .vn-thumbnail-placeholder {
        width: 100%;
    }
    
    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dropdown-menu {
        left: 0;
        transform: none;
        width: 100%;
    }
    
    .vn-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vn-search-container {
        min-width: 100%;
    }
    
    .vn-sort-container {
        width: 100%;
        justify-content: space-between;
    }
    
    .vn-grid {
        grid-template-columns: 1fr;
    }
    
    .ref-sheets-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ref-sheets-search-container {
        min-width: 100%;
    }
    
    .ref-sheets-sort-container {
        width: 100%;
        justify-content: space-between;
    }
    
    .ref-sheets-grid {
        grid-template-columns: 1fr;
    }
    
    .ref-sheet-main {
        grid-template-columns: 1fr;
    }
    
    .ref-sheet-image-container {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .ref-sheet-relationships {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
