/* =============================================
   ARKUNIR ARCHIVES — Design System
   Wiki-style, dark medieval/gaming theme
   ============================================= */

/* --- CSS Variables --- */
:root {
    /* Colors */
    --bg-primary: #0f1118;
    --bg-secondary: #161822;
    --bg-tertiary: #1c1f2e;
    --bg-card: #1a1d2b;
    --bg-card-hover: #20233a;
    --bg-elevated: #222640;

    --border: #2a2e45;
    --border-light: #353a55;
    --border-focus: #c9a84c;

    --gold: #c9a84c;
    --gold-light: #e2c76b;
    --gold-dim: #8a7333;
    --gold-glow: rgba(201, 168, 76, 0.15);

    --text-primary: #e8e6e1;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b80;
    --text-heading: #f0ece0;

    --accent-blue: #5b8af5;
    --accent-red: #e05252;
    --accent-green: #4caf6a;
    --accent-purple: #9b6dff;

    --wiki-link: #6ba3e8;
    --wiki-link-hover: #8fc0ff;
    --wiki-link-red: #d45c5c;
    --wiki-link-red-hover: #f07070;

    /* Sizing */
    --sidebar-width: 320px;
    --navbar-height: 60px;
    --content-max-width: 900px;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;
    --banner-aspect: 1/2;

    /* Transitions */
    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;

    /* Shadows */
    --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-gold: 0 0 20px rgba(201, 168, 76, 0.1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--gold);
    color: var(--bg-primary);
}

a {
    color: var(--wiki-link);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--wiki-link-hover);
}

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

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Cinzel', 'Georgia', serif;
    color: var(--text-heading);
    line-height: 1.3;
    margin-bottom: 0.5em;
    scroll-margin-top: calc(var(--navbar-height) + 20px);
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 0;
}

h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-top: 2rem;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 1.5rem;
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.2rem;
}

p {
    margin-bottom: 1rem;
}

code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-tertiary);
    padding: 0.15em 0.4em;
    border-radius: var(--border-radius-sm);
    font-size: 0.9em;
    color: var(--gold-light);
}

pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1em;
    overflow-x: auto;
    margin: 1em 0;
}

pre code {
    background: none;
    padding: 0;
}

blockquote {
    border-left: 3px solid var(--gold);
    padding: 0.5em 1em;
    margin: 1.5em 0;
    background: var(--gold-glow);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    color: var(--text-secondary);
}

hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 3rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

th,
td {
    border: 1px solid var(--border);
    padding: 0.6em 0.8em;
    text-align: left;
}

th {
    background: var(--bg-tertiary);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: var(--gold-light);
    font-size: 0.9rem;
}

td {
    background: var(--bg-card);
}

tr:hover td {
    background: var(--bg-card-hover);
}

/* --- Wiki Links --- */
.wiki-link {
    color: var(--wiki-link);
    border-bottom: 1px dotted var(--wiki-link);
    transition: all var(--transition);
}

.wiki-link:hover {
    color: var(--wiki-link-hover);
    border-bottom-color: var(--wiki-link-hover);
}

.wiki-link-red {
    color: var(--wiki-link-red) !important;
    border-bottom-color: var(--wiki-link-red) !important;
}

.wiki-link-red:hover {
    color: var(--wiki-link-red-hover) !important;
    border-bottom-color: var(--wiki-link-red-hover) !important;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: rgba(15, 17, 24, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.navbar-inner {
    max-width: 1600px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1.2rem;
    gap: 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold) !important;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-brand i {
    font-size: 1.3rem;
    color: var(--gold-light);
}

.navbar-brand:hover {
    color: var(--gold-light) !important;
}

.navbar-search {
    flex: 1;
    max-width: 420px;
    margin: 0 auto;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap i {
    position: absolute;
    left: 0.8rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-input-wrap input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.5rem 1rem 0.5rem 2.2rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition);
    outline: none;
}

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

.search-input-wrap input:focus {
    border-color: var(--gold-dim);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.search-dropdown.active {
    display: block;
    animation: slideUp 0.2s ease-out;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-tertiary);
}

.search-result-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--bg-primary);
}

.search-result-thumb.is-skin {
    object-fit: contain;
    padding: 2px;
}

.search-result-thumb-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
}

.search-result-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.navbar-mobile-toggle {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
}

.navbar-search-mobile-btn {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.navbar-mobile-toggle:hover,
.navbar-search-mobile-btn:hover {
    color: var(--gold);
    border-color: var(--gold-dim);
    background: var(--bg-card-hover);
}

/* --- User Menu --- */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.3rem 0.8rem 0.3rem 0.3rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    font-size: 0.85rem;
}

.user-menu-toggle:hover {
    border-color: var(--gold-dim);
    background: var(--bg-card-hover);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--bg-primary);
}

.user-menu-toggle .fa-chevron-down {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.user-menu.open .fa-chevron-down {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.4rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 2005;
    pointer-events: none;
}

.user-menu.open .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.user-menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.user-menu-dropdown a:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.user-menu-dropdown a i {
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}

.user-menu-dropdown hr {
    margin: 0.3rem 0;
    border-top-color: var(--border);
}

.text-danger {
    color: var(--accent-red) !important;
}

.user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =============================================
   LAYOUT
   ============================================= */
.layout {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
    margin-top: var(--navbar-height);
    position: relative;
}

.layout::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    z-index: -1;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: var(--navbar-height) !important;
    height: calc(100vh - var(--navbar-height));
    margin-top: 0 !important;
    padding-top: 0 !important;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 0 0 1.2rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-section {
    padding: 1.5rem 1rem 0 1rem;
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 0;
}

.sidebar-title i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.sidebar-nav li a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav li a i {
    width: 16px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.6;
}

.sidebar-recent li a {
    font-size: 0.82rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-empty {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    font-style: italic;
}

.sidebar-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 2rem;
    padding-bottom: 6rem;
    max-width: calc(100% - var(--sidebar-width));
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: var(--bg-primary);
    border-color: var(--gold);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: var(--shadow-gold);
    color: var(--bg-primary);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.btn-danger:hover {
    background: #c44141;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
}

.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-slow);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

/* =============================================
   HOMEPAGE
   ============================================= */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, var(--gold-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: 2.8rem;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

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

.hero-stat-value {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    display: block;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--text-heading);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: none;
    padding-bottom: 0;
}

.section-title i {
    color: var(--gold);
    font-size: 1rem;
}

/* --- Page List --- */
.page-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.page-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
}

.page-item:hover {
    border-color: var(--gold-dim);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.page-item-thumb {
    width: 80px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-item-thumb canvas {
    max-height: 100%;
    max-width: 100%;
}

.page-item-content {
    flex: 1;
    min-width: 0;
}

.page-item-title {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.2rem;
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 0;
}

.page-item-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-item-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.page-item-meta i {
    margin-right: 0.2rem;
    opacity: 0.7;
}

/* =============================================
   WIKI PAGE
   ============================================= */
.wiki-page {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    align-items: flex-start;
}

.wiki-main {
    flex: 1;
    min-width: 0;
}

.wiki-sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.wiki-sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
}

@media (max-width: 900px) {
    .wiki-sidebar {
        width: 100%;
        position: static;
        order: -1;
    }
}

.wiki-page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.wiki-page-header h1 {
    margin-bottom: 0.3rem;
}

.wiki-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.wiki-page-meta i {
    margin-right: 0.3rem;
    color: var(--gold-dim);
}

.wiki-page-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

/* --- Table of Contents --- */
.content-toc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1rem 0.6rem 0;
    margin: 2rem 0;
    display: block;
    max-width: 550px;
    box-shadow: var(--shadow-sm);
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.toc-header h4 {
    margin: 0;
    padding-left: 1.1rem;
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.content-toc .toc-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 15px !important;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.toc-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.toc-item:hover {
    background: transparent;
}

.toc-num {
    color: var(--gold);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    opacity: 0.7;
    min-width: 10px;
}

.toc-link {
    text-decoration: none;
    transition: color 0.1s;
}

.toc-item:hover .toc-link {
    color: #fff !important;
}

/* --- Wiki Content --- */
.wiki-content {
    line-height: 1.8;
}

.wiki-content img {
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    margin: 1em 0;
}

.wiki-content h2 {
    margin-top: 2rem;
}

.wiki-content ul,
.wiki-content ol {
    margin: 0.5em 0 1em 1.5em;
}

.wiki-content li {
    margin-bottom: 0.3em;
}

/* --- Tags --- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all var(--transition);
    text-decoration: none;
}

.tag:hover {
    border-color: var(--gold-dim);
    color: var(--gold-light);
    background: var(--gold-glow);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* =============================================
   GALLERY
   ============================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 4 / 3;
    cursor: pointer;
    transition: all var(--transition);
}

.gallery-item:hover {
    border-color: var(--gold-dim);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    font-size: 0.8rem;
    color: var(--text-primary);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

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

/* --- Lightbox Styles Moved to Bottom for Consolidation --- */

/* =============================================
   SEARCH
   ============================================= */
.search-page-input {
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 1rem 1.2rem 1rem 3rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.1rem;
    outline: none;
    transition: all var(--transition);
}

.search-page-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-glow);
}

.search-page-wrap {
    position: relative;
    margin-bottom: 2rem;
}

.search-page-wrap i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

.search-results-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.search-highlight {
    background: var(--gold-glow);
    color: var(--gold-light);
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

/* =============================================
   FORMS (Login, Setup, Editor inputs)
   ============================================= */
.form-page {
    max-width: 440px;
    margin: 3rem auto;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
}

.form-card h1 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.form-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 0.6rem 0.8rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition);
}

select.form-control option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-error {
    background: rgba(224, 82, 82, 0.1);
    border: 1px solid rgba(224, 82, 82, 0.3);
    color: var(--accent-red);
    padding: 0.6rem 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.form-success {
    background: rgba(76, 175, 106, 0.1);
    border: 1px solid rgba(76, 175, 106, 0.3);
    color: var(--accent-green);
    padding: 0.6rem 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* =============================================
   ADMIN DASHBOARD
   ============================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1.2rem;
    text-align: center;
    transition: all var(--transition);
}

.dashboard-stat:hover {
    border-color: var(--gold-dim);
    box-shadow: var(--shadow-gold);
}

.dashboard-stat-icon {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 0.4rem;
}

.dashboard-stat-value {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-heading);
}

.dashboard-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Admin Table --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--border);
    background: transparent;
    transition: background 0.2s, color 0.2s;
}

.admin-table th[data-sortable] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

.admin-table th[data-sortable]:hover {
    background: rgba(212, 175, 55, 0.05);
    color: var(--gold-light);
}

.admin-table th[data-sortable]::after {
    content: '\f0dc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.2;
    font-size: 0.7rem;
    transition: all 0.2s;
    pointer-events: none;
}

.admin-table th[data-sortable].sort-asc::after {
    content: '\f0de';
    opacity: 1;
    color: var(--gold);
}

.admin-table th[data-sortable].sort-desc::after {
    content: '\f0dd';
    opacity: 1;
    color: var(--gold);
}

.admin-table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    background: transparent;
}

.admin-table tr:hover td {
    background: var(--bg-card);
}

.admin-table .status-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-published {
    background: rgba(76, 175, 106, 0.15);
    color: var(--accent-green);
}

.table-search-wrap {
    margin-bottom: 1.2rem;
    position: relative;
    max-width: 350px;
}

.table-search-wrap i {
    position: absolute;
    left: 1rem;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 2;
}

.table-search-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.table-search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
    outline: none;
}

.suggestion-bulb {
    color: #ffd700;
    font-size: 0.85rem;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4));
    animation: bulb-pulse 2s infinite;
}

@keyframes bulb-pulse {
    0% {
        opacity: 0.7;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

.page-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    margin: 0 auto;
    transition: all 0.2s;
    background: transparent;
    position: relative;
}

/* Larger hit area */
.page-marker::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
}

.page-marker.marked {
    background-color: #ff4757 !important;
    background: #ff4757 !important;
    border-color: #ff4757 !important;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.8) !important;
    transform: scale(1.15);
    opacity: 1 !important;
}

.page-marker:hover {
    border-color: var(--accent-red);
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.4);
    transform: scale(1.1);
}

.table-limit-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.table-limit-select:focus {
    border-color: var(--gold);
}

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pagination-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--gold);
    color: var(--gold-light);
    background: var(--bg-tertiary);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 10px;
}

.pagination-page {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.pagination-page.active {
    background: var(--gold-glow);
    border-color: var(--gold);
    color: var(--gold-light);
    font-weight: 600;
}

/* --- Editor Layout Container --- */
.editor-page-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem 1rem;
}

/* =============================================
   EDITOR PAGE
   ============================================= */
.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.editor-toolbar .form-control {
    flex: 1;
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 600;
    padding: 0.5rem 0.8rem;
}

.editor-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.editor-container .ql-toolbar {
    background: var(--bg-tertiary);
    border: none;
    border-bottom: 1px solid var(--border);
}

.editor-container .ql-container {
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
    min-height: 400px;
}

.editor-container .ql-editor {
    padding: 1.5rem;
    line-height: 1.8;
}

.editor-container .ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: italic;
}

/* Quill Editor Dark Mode SVG Icon Fixes */
.editor-container .ql-stroke {
    stroke: var(--text-heading) !important;
}

.editor-container .ql-fill {
    fill: var(--text-heading) !important;
}

.editor-container .ql-picker {
    color: var(--text-heading) !important;
}

.editor-container .ql-picker-options {
    background-color: var(--bg-card) !important;
    border-color: var(--border) !important;
}

.editor-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* =============================================
   SKIN VIEWER (INFOBOX)
   ============================================= */
.skin-viewer-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin: 1rem 0;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all var(--transition);
}

.skin-viewer-card:hover {
    border-color: var(--gold-dim);
    box-shadow: var(--shadow-gold);
}

.skin-viewer-container {
    width: 100%;
    display: flex;
    justify-content: center;
    background: radial-gradient(circle at center, var(--bg-elevated) 0%, var(--bg-card) 100%);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.skin-canvas {
    display: block;
    cursor: grab;
}

.skin-canvas:active {
    cursor: grabbing;
}

.skin-viewer-info {
    width: 100%;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    gap: 0.5rem;
    /* Espace minimum entre le nom et le bouton */
    overflow: hidden;
    /* Sécurité */
}

.skin-viewer-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--gold-light);
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Coupe le texte avec ... s'il est trop long */
    flex: 1;
    /* Prend tout l'espace disponible sans pousser le bouton */
}

.skin-viewer-namemc {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.skin-viewer-namemc:hover {
    background: var(--gold-glow);
    color: var(--gold);
    border-color: var(--gold-dim);
}

/* --- Infobox Custom Rows --- */
.infobox-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.infobox-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.infobox-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 0.1rem;
}

.infobox-value {
    text-align: right;
    max-width: 65%;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 5px;
    font-family: inherit;
    line-height: 1.4;
}

/* List support in infobox values */
.infobox-value ul,
.infobox-value ol {
    list-style-position: outside;
    list-style-type: disc !important;
    text-align: left;
    padding-left: 1.2rem;
    margin: 0.4rem 0 0.4rem 0;
}

.infobox-value li {
    margin-bottom: 0.3rem;
}

.infobox-value p {
    margin-bottom: 0.4rem;
}

.infobox-value p:last-child {
    margin-bottom: 0;
}

/* Interactivity */
/* 
    document.addEventListener('click', (e) => {
            // Prevent scrolling to top for empty hash links
            const link = e.target.closest('a');
            if (link && link.getAttribute('href') === '#') {
                e.preventDefault();
            }

            // Target images in specific containers
            const clickableImage = e.target.closest('.wiki-content img, .gallery-grid img, .page-item-thumb img, .infobox img');
            if (clickableImage && !e.target.closest('a') && !e.target.closest('.wiki-gallery-embed, .gallery-item')) { 
                openLightbox(clickableImage.src, clickableImage.alt);
                return;
            }

            if (lightbox.classList.contains('active')) {
                if (e.target === lightbox || e.target === closeBtn || e.target.closest('#lightbox-close')) {
                    closeLightbox();
                }
            }
        });
*/

.page-item-thumb img {
    cursor: zoom-in;
}

/* =============================================
   MINECRAFT BANNER RENDERER
   ============================================= */
.mc-banner-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.mc-banner-canvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    border-radius: 3px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mc-banner-canvas:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(201, 168, 76, 0.15);
}

/* Banner in wiki content (inline, medium size) */
.wiki-content .mc-banner-wrap {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
}

.wiki-content .mc-banner-canvas {
    width: 120px;
    height: 240px;
}

/* Banner in infobox (sidebar, larger) */
.mc-banner-infobox {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
}

.mc-banner-infobox .mc-banner-canvas {
    width: 100px;
    height: 200px;
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.5));
}

/* Banner designer modal */
.banner-designer-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: radial-gradient(circle, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.banner-designer-preview .mc-banner-canvas {
    width: 140px;
    height: 280px;
}

.banner-layer-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.banner-layer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
}

.banner-layer .layer-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.banner-layer .layer-name {
    flex: 1;
    color: var(--text-secondary);
}

.banner-layer .btn-remove-layer {
    background: none;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 2px 6px;
}

.banner-layer .btn-remove-layer:hover {
    opacity: 1;
}

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin-bottom: 0.8rem;
}

.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.15);
    z-index: 1;
}

.color-swatch.selected {
    border-color: var(--gold);
    box-shadow: 0 0 8px var(--gold-glow);
    transform: scale(1.1);
}

/* --- Wiki Gallery Embed --- */
.wiki-gallery-embed {
    max-width: 400px;
    margin: 2rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-slow);
    box-shadow: var(--shadow-md);
    position: relative;
}

.wiki-gallery-embed:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--gold-dim);
    box-shadow: var(--shadow-lg), 0 0 20px var(--gold-glow);
}

.gallery-embed-img-wrap {
    position: relative;
    width: 100%;
    max-height: 350px;
    overflow: hidden;
    background: transparent;
    line-height: 0;
}

.gallery-embed-img-wrap img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0;
    object-fit: contain;
    transition: transform 0.6s ease;
}

.wiki-gallery-embed:hover .gallery-embed-img-wrap img {
    transform: scale(1.1);
}

.gallery-embed-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.wiki-gallery-embed:hover .gallery-embed-overlay {
    opacity: 1;
}

.youtube-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff0000;
    font-size: 3rem;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
    pointer-events: none;
}

.gallery-embed-caption {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.gallery-embed-title {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 1rem !important;
    margin: 0 0 0.4rem 0 !important;
    font-weight: 700;
}

.gallery-embed-desc {
    font-size: 0.85rem !important;
    color: var(--text-secondary);
    line-height: 1.4 !important;
    margin: 0 !important;
}

@media (max-width: 600px) {
    .wiki-gallery-embed {
        max-width: 100%;
        margin: 1.5rem 0;
    }
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 1.5rem;
    margin-top: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

.footer-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-sub {
    color: var(--text-muted);
    font-size: 0.82rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.2rem;
    opacity: 0.8;
}

.footer-sub a {
    color: var(--text-muted);
    transition: all var(--transition);
    border-bottom: 1px transparent;
}

.footer-sub b {
    color: var(--gold-dim);
}

.footer-sub a:hover {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

@media (max-width: 768px) {
    .footer {
        padding: 2.5rem 1.2rem;
        margin-top: 2rem;
    }

    .footer-sub {
        gap: 0.6rem;
        font-size: 0.78rem;
    }
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-container.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.2s;
}

.lightbox-close:hover {
    background: var(--accent-red);
    transform: rotate(90deg);
}

.lightbox-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10001;
    border: 1px solid rgba(255, 255, 255, 0.15);
    user-select: none;
}

.lightbox-nav-btn.prev {
    left: 20px;
}

.lightbox-nav-btn.next {
    right: 20px;
}

.lightbox-nav-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-50%) scale(1.1);
}


.lightbox-caption {
    color: white;
    margin-top: 1.5rem;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    text-align: center;
}


/* =============================================
   SEARCH LAUNCHPAD
   ============================================= */
.search-launchpad {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.search-launchpad.active {
    opacity: 1;
    pointer-events: auto;
}

.launchpad-content {
    width: 100%;
    max-width: 800px;
    margin: 0 20px;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.search-launchpad.active .launchpad-content {
    transform: translateY(0);
}

.launchpad-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.launchpad-icon {
    font-size: 1.5rem;
    color: var(--gold);
}

#launchpad-input {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 100%;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.launchpad-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.launchpad-close:hover {
    color: white;
}

.launchpad-results {
    margin-top: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.launchpad-placeholder {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.launchpad-placeholder i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

.launchpad-placeholder p {
    font-size: 1rem;
    margin: 0;
}

.launchpad-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: var(--border-radius);
    transition: all 0.2s;
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.launchpad-result-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold-dim);
    transform: translateX(4px);
    color: var(--text-primary);
}

.launchpad-result-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-primary);
    flex-shrink: 0;
}

.launchpad-result-thumb.is-skin {
    object-fit: contain;
    padding: 3px;
}

.launchpad-result-info {
    flex: 1;
    min-width: 0;
}

.launchpad-result-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.launchpad-result-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .search-launchpad {
        padding-top: 5vh;
    }

    .launchpad-content {
        margin: 0 12px;
    }

    .launchpad-header {
        padding: 1rem;
        gap: 1rem;
        border-radius: 12px;
    }

    #launchpad-input {
        font-size: 1.15rem;
    }

    .launchpad-close {
        top: 15px;
        right: 15px;
    }

    .launchpad-result-item {
        padding: 0.75rem 1rem;
        gap: 0.8rem;
    }

    .launchpad-result-thumb {
        width: 40px;
        height: 40px;
    }

    .launchpad-result-title {
        font-size: 0.95rem;
    }
}

/* =============================================
   MOBILE FAB
   ============================================= */
.mobile-fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 8000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

.mobile-fab-main {
    width: 60px;
    height: 60px;
    background: var(--gold-gradient);
    border: none;
    border-radius: 50%;
    color: #000;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 25px var(--gold-glow);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-fab-container.active .mobile-fab-main {
    transform: rotate(135deg);
}

.mobile-fab-menu {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    transition: all 0.3s ease;
    align-items: flex-end;
    padding-right: 6px; /* (60 - 48)/2 = 6px pour aligner parfaitement l'icône de 48px avec le main button de 60px */
}

.mobile-fab-container.active .mobile-fab-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.mobile-fab-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: white;
}

.mobile-fab-item span {
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    backdrop-filter: blur(4px);
}

.fab-item-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    transition: all 0.2s;
}

.mobile-fab-item:hover .fab-item-icon {
    border-color: var(--gold);
    transform: scale(1.1);
}

@media (min-width: 1025px) {
    .mobile-fab-container {
        display: none;
    }
}

/* =============================================
   MINECRAFT BANNERS (PREMIUM)
   ============================================= */
.mc-banner-container {
    position: relative;
    display: inline-block;
    line-height: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mc-banner-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
            rgba(255, 255, 255, 0.15) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            rgba(0, 0, 0, 0.1) 60%,
            rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    mix-blend-mode: soft-light;
}

.mc-banner-shadow {
    position: absolute;
    top: 5px;
    left: 5px;
    right: -5px;
    bottom: -5px;
    background: rgba(0, 0, 0, 0.4);
    filter: blur(8px);
    z-index: -1;
    border-radius: 2px;
}

.mc-banner-flag-pole {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 110%;
    height: 4px;
    background: #4a3728;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.mc-banner-hero-wrap {
    position: relative;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* =============================================
   ADAPTIVE LAYOUTS (MC BANNERS)
   ============================================= */
.ent-card.is-mc-layout {
    flex-direction: row;
    height: 220px;
    align-items: stretch;
}

.ent-card.is-mc-layout .ent-card-banner {
    width: 170px;
    height: 100%;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3) !important;
}

.ent-card.is-mc-layout .ent-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.2rem;
}

.ent-card.is-mc-layout .ent-card-logo {
    bottom: 12px;
    right: -10px;
    left: auto;
    transform: scale(0.85);
}

.ent-card.is-mc-layout .ent-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 500px) {
    .ent-card.is-mc-layout {
        flex-direction: column;
        height: auto;
    }

    .ent-card.is-mc-layout .ent-card-banner {
        width: 100%;
        height: 140px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

/* =============================================
   MODALS
   ============================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 15000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.7);
}

.modal-overlay.active {
    display: flex !important;
}

.modal {
    width: 95%;
    max-width: 600px;
    border-radius: 12px;
    position: relative;
    border: 1px solid var(--gold);
    background: var(--bg-card);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--shadow-gold);
    overflow: hidden;
}

.modal-header {
    padding: 1.2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.modal-close:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.2rem;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

/* =============================================
   SELECTION TOOLBAR (QUILL)
   ============================================= */
.selection-toolbar {
    position: absolute;
    display: none;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    gap: 2px;
    transform: translateX(-50%);
}

.selection-toolbar.active {
    display: flex;
}

.selection-toolbar-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.selection-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gold);
}

.selection-toolbar-btn.active {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
}

.selection-toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}
@media (max-width: 900px) {
    .layout::before {
        display: none;
    }
    .sidebar {
        position: fixed;
        top: var(--navbar-height) !important;
        left: -100%;
        width: 280px;
        height: calc(100vh - var(--navbar-height));
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 5px 0 20px rgba(0,0,0,0.5);
        margin-top: 0 !important;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar-overlay.active {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(3px);
        z-index: 999;
        display: block !important;
    }
    .mobile-fab-container {
        bottom: 85px; /* Moved up to clear the editor action bar or other mobile menus */
        right: 20px;
        z-index: 9999;
    }
    .mobile-fab-main {
        box-shadow: 0 5px 20px rgba(212, 175, 55, 0.8);
        border: 2px solid #fff;
        color: #fff;
        transform: scale(1.1); /* Légèrement plus grand pour être plus visible */
    }
    .mobile-fab-container.active .mobile-fab-main {
        transform: scale(1.1) rotate(135deg);
    }
    .main-content {
        max-width: 100%;
        padding: 1rem;
        padding-bottom: 4rem;
    }
    .navbar-mobile-toggle {
        display: flex;
    }
    .navbar-search {
        display: none !important;
    }
    #btn-login {
        display: none !important;
    }
    .mobile-only-link {
        display: block !important;
    }
    .navbar-inner {
        justify-content: space-between;
    }
}

/* =============================================
   LINK PREVIEW CARD (HOVER)
   ============================================= */
.link-preview-card {
    position: fixed;
    z-index: 99999;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    width: 320px;
    max-width: 90vw;
    display: none;
    flex-direction: row;
    gap: 1rem;
    padding: 1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    backdrop-filter: blur(10px);
}

.link-preview-card.visible {
    display: flex;
    opacity: 1;
}

.link-preview-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--border-radius-sm);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.link-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-thumb .placeholder-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.link-preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.link-preview-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--gold);
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
}

.link-preview-excerpt {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 0.5rem 0;
}

.link-preview-badge {
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
}

.link-preview-badge.badge-missing {
    background: rgba(231, 76, 60, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.link-preview-badge.badge-info {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.link-preview-badge.badge-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-only-link {
    display: none;
}