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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

.main-content {
    min-height: calc(100vh - 160px);
}

/* Navigation */
.main-nav {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: inline-block;
}

.nav-link:hover,
.nav-item.active .nav-link {
    color: #3498db;
    background-color: rgba(255,255,255,0.1);
}

/* Hamburger Menu */
.hamburger-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background: #ecf0f1;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.tagline {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.subtitle {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    opacity: 0.8;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: #2c3e50; /* dark text on light backgrounds */
    border: 2px solid #e1e8ed;
}

.btn-secondary:hover {
    background-color: #f1f7fb;
    color: #2c3e50;
    transform: translateY(-2px);
}

/* Keep white secondary buttons on dark hero/header areas */
.hero .btn-secondary,
.nav-container .btn-secondary {
    color: white;
    border-color: white;
}
.hero .btn-secondary:hover,
.nav-container .btn-secondary:hover {
    background-color: white;
    color: #667eea;
}

/* Stats section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 500;
}

/* News section */
.news-section {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.news-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 2.5rem;
}

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

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

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

.news-card h3 {
    margin-bottom: 1rem;
}

.news-card h3 a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.25rem;
}

.news-card h3 a:hover {
    color: #3498db;
}

.news-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
    flex-wrap: wrap;
}

.news-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.news-excerpt {
    color: #5d6d7e;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.news-read-more {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.news-read-more:hover {
    color: #2980b9;
}

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

/* Features section */
.features-preview {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.features-preview h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #2c3e50;
    font-size: 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.feature-card p {
    color: #5d6d7e;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.feature-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.feature-link:hover {
    color: #2980b9;
}

/* CTA section */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    margin: 4rem 0;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 3rem 0 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: #3498db;
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section ul {
    color: #bdc3c7;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #3498db;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
    color: #95a5a6;
}

/* Responsive design */
@media (max-width: 768px) {
    /* Hamburger menu mobile styles */
    .hamburger-toggle {
        display: flex;
    }
    
    .nav-container {
        flex-wrap: wrap;
        gap: 0;
    }
    
    .nav-brand {
        flex: 1;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #2c3e50, #34495e);
        flex-direction: column;
        text-align: center;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        width: 100%;
    }
    
    .nav-menu.active {
        max-height: 500px;
        padding: 1rem 0;
    }
    
    .nav-menu .nav-item {
        padding: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-menu .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-menu .nav-link,
    .nav-auth a {
        display: block;
        padding: 0.75rem 1rem;
    }
    
    .nav-auth-item {
        padding: 0;
    }
    
    .nav-auth {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Hamburger animation */
    .hamburger-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .hamburger-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        min-height: 44px;
        padding: 14px 24px;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Additional page styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Lore page styles */
.lore-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
    padding: 2rem 0;
}
.lore-sidebar {
    background: #f7f7f9;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 1rem;
}
.lore-sidebar h2 {
    margin-top: 0;
}
.lore-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}
.lore-tab {
    background: transparent;
    border: none;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.lore-tab.active,
.lore-tab:hover {
    background: #3498db;
    color: white;
}
.lore-content {
    background: #fff;
    border: 1px solid #e1e4e8;
    padding: 1.25rem;
    border-radius: 6px;
}
.lore-header { display:flex; flex-direction:column; gap:0.85rem; margin-bottom:0.75rem; }
.lore-tabs-row { 
    display:flex; 
    gap:0.5rem; 
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #3498db #f0f0f0;
}
.lore-tabs-row::-webkit-scrollbar {
    height: 6px;
}

.lore-tabs-row::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.lore-tabs-row::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}
.lore-tabs-row .lore-tab { 
    padding: 0.5rem 0.85rem; 
    border-radius: 6px; 
    border: 1px solid #e9eef6; 
    background: transparent; 
    cursor:pointer;
    flex-shrink: 0;
    white-space: nowrap;
}
.lore-tabs-row .lore-tab.active { background: #3498db; color:white; border-color:#3498db; }

/* Mobile lore tabs - enhanced touch targets */
@media (max-width: 768px) {
    .lore-header {
        overflow-x: hidden;
    }
    
    .lore-tabs-row {
        margin: 0 -1rem;
        padding: 0 1rem;
        max-width: none;
    }
    
    .lore-tabs-row .lore-tab {
        min-height: 44px;
    }
    
    .lore-content,
    .lore-content-inner,
    .lore-page,
    .main-content {
        overflow-x: hidden;
    }
}

.lore-panel-grid { display:grid; grid-template-columns: 320px 1fr; gap: 1rem; align-items:start; }
.lore-list { background:#fafbfd; border:1px solid #e9eef6; border-radius:8px; padding:0.75rem; height:600px; overflow:auto; }
.lore-list ul { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:0.25rem; }
.lore-list li { padding:0.5rem; border-radius:6px; cursor:pointer; }
.lore-list li:hover { background:#f1f7ff; }
.lore-detail { background:white; border-radius:8px; padding:1rem; border:1px solid #eef4fb; min-height:320px; }
.lore-panel h3 { margin-top: 0; }

/* Player-character sheet layout used by pc_sheet.html */
.sheet-page .tabs-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.tab {
    padding: 0.5rem 0.85rem;
    border-radius: 18px;
    border: 1px solid #e9eef6;
    background: transparent;
    color: #2c3e50;
    cursor: pointer;
    font-weight: 600;
}
.tab.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.sheet-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}
.list {
    background: #fafbfd;
    border: 1px solid #e9eef6;
    border-radius: 8px;
    padding: 0.75rem;
    height: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.list-controls { padding: 0.5rem; }
.search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}
.items { list-style: none; overflow: auto; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.item { padding: 0.5rem; border-radius: 6px; cursor: pointer; display: block; }
.item.active { background: #eef7ff; border-left: 3px solid #3498db; }
.item-inner { display: flex; gap: 0.75rem; align-items: center; }
.item .avatar { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg,#667eea,#764ba2); color: white; display:flex; align-items:center; justify-content:center; font-weight:700; }
.item .meta .name { font-weight:700; color:#263238; }
.item .meta .sub { font-size:0.85rem; color:#6b7280; }

.sheet-view { background: white; border: 1px solid #e9eef6; border-radius: 8px; padding: 1rem; min-height: 600px; overflow: auto; }
.sheet-empty { display:flex; align-items:center; justify-content:center; min-height: 240px; color:#6b7280; }
.sheet-card { background: #fff; border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,0.06); overflow: hidden; }
.sheet-head { display:flex; gap: 1rem; align-items:center; padding: 1rem; border-bottom: 1px solid #f1f5f9; }
.sheet-avatar { width:72px;height:72px;border-radius:12px;background:linear-gradient(135deg,#49a3ff,#0ac4a5);display:flex;align-items:center;justify-content:center;color:white;font-size:1.25rem;font-weight:700; }
.sheet-title h2 { margin:0; }
.sheet-meta { color:#6b7280; font-size:0.95rem; margin-top:0.3rem; }
.sheet-actions { margin-left:auto; }
.sheet-body { display:flex; flex-direction: column; gap: 1rem; padding: 1rem; }
.sheet-top-row { display:grid; grid-template-columns: 1fr 2fr 1fr; gap: 1rem; }
.sheet-basic-info { background:#fbfdff; border-radius:8px; padding:0.8rem; border: 1px solid #eef4fb; }
.sheet-model-container { display:flex; align-items: center; justify-content: center; min-height: 300px; }
.sheet-descriptions { padding:0.5rem; }
.sheet-stats-full { display:grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.sheet-stats-section { background:#fbfdff; border-radius:8px; padding:0.8rem; border: 1px solid #eef4fb; }
.sheet-stats { background:#fbfdff; border-radius:8px; padding:0.8rem; border: 1px solid #eef4fb; }
.ability-grid.small { display:grid; grid-template-columns: repeat(2,1fr); gap:0.5rem; }
.stats-grid.small { display:grid; grid-template-columns: repeat(2,1fr); gap:0.5rem; }
.sheet-stats-section .stats-grid.small { gap:0.3rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.sheet-details { padding:0.5rem; }

/* PC sheet model viewport */
.pc-model-viewport {
    width: 100%;
    height: 260px;
    min-height: 160px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff, #f5f7fa);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    margin-bottom: 0.75rem;
}
.pc-model-viewport canvas { width: 100% !important; height: 100% !important; display: block; }
.inventory-list { list-style: none; padding-left: 0; display:flex; flex-wrap:wrap; gap:0.5rem; }
.inventory-list li { background:#f6f8fb; padding:0.4rem 0.6rem; border-radius:6px; border:1px solid #eef3f7; }

@media (max-width: 920px) {
    .sheet-grid { grid-template-columns: 1fr; }
    .sheet-top-row { grid-template-columns: 1fr; }
    .sheet-stats-full { grid-template-columns: 1fr; }
    .list { height: auto; }
}

@media (max-width: 920px) {
    .lore-grid { grid-template-columns: 1fr; }
    .lore-sidebar { order: 2; }
    .lore-content { order: 1; }
}

/* World / 3D renderer styles */
.world-3d-scene {
    padding: 2rem 0 4rem;
}

/* Expand the container slightly on the world page so the 3D scene
   has more horizontal room on wider displays without changing the
   global container settings. */
.world-3d-scene .container {
    max-width: 1400px;
    padding: 0 1rem;
}

.three-container {
    width: 100%;
    /* Use a viewport-relative height so the canvas takes more of the screen.
       Min-height ensures a reasonable size on very short viewports and the
       max-height keeps things from growing unbounded on very tall displays. */
    height: 70vh;
    min-height: 480px; /* preserve reasonable minimum */
    max-height: 900px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #eef3f7, #ffffff);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

/* Ensure the WebGL canvas matches the container's size */
.three-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* camera-controls styles removed; min radius now set by configuration in code */

@media (max-width: 768px) {
    /* camera-controls removed */
}

.three-container {
    position: relative;
}

@media (max-width: 768px) {
    .three-container {
        height: 50vh;
        min-height: 300px;
    }
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(24, 26, 27, 0.45);
    z-index: 100;
}

.loading-inner {
    text-align: center;
    color: white;
    font-weight: 600;
    width: 70%;
    max-width: 420px;
}

.loading-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.loading-bar {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #49a3ff, #0ac4a5);
    width: 0%;
    transition: width 100ms linear;
}

/* Content listing */
.content-listing {
    padding: 4rem 0;
}

.content-listing h1 {
    text-align: center;
    margin-bottom: 3rem;
    color: #2c3e50;
    font-size: 2.5rem;
}

/* Content detail */
.content-detail {
    padding: 4rem 0;
}

.content-detail h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
}

/* Features page */
.features-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 4rem;
}

.features-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.2rem;
    opacity: 0.9;
}

.features-detailed {
    padding: 0 0 4rem 0;
}

.feature-detail {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.feature-detail h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.feature-detail p {
    color: #5d6d7e;
    line-height: 1.6;
}

/* Download page */
.download-section {
    background: white;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.download-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 2rem;
    text-align: center;
}

.version-info {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.download-apps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 3rem;
}

.app-download {
    padding: 2rem;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.app-download:hover {
    border-color: #3498db;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.1);
}

.app-download h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.app-download p {
    color: #5d6d7e;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.platform-downloads {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 120px;
    text-align: center;
}

.download-btn.linux {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
}

.download-btn.linux:hover {
    background: linear-gradient(135deg, #e55a2b, #e0851a);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.download-btn.windows {
    background: linear-gradient(135deg, #0078d4, #106ebe);
    color: white;
}

.download-btn.windows:hover {
    background: linear-gradient(135deg, #005a9e, #0e5a99);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 120, 212, 0.3);
}

.download-btn.mac {
    background: linear-gradient(135deg, #007aff, #5856d6);
    color: white;
}

.download-btn.mac:hover {
    background: linear-gradient(135deg, #0056cc, #4640a3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.platform-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.platform-name {
    font-weight: 600;
    font-size: 1rem;
}

.archive-section {
    background: white;
    padding: 2rem;
    margin-bottom: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.archive-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.archive-section p {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.archive-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.archive-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.requirements-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.requirements-section h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    text-align: center;
}

.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.req-column {
    padding: 1.5rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    background: #fafbfc;
}

.req-column h3 {
    color: #3498db;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.req-column ul {
    list-style: none;
    padding-left: 0;
}

.req-column li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
    color: #5d6d7e;
    position: relative;
    padding-left: 1.5rem;
}

.req-column li:before {
    content: "✓ ";
    color: #27ae60;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.req-column li:last-child {
    border-bottom: none;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.page-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Archive page styles */
.archive-versions {
    margin-top: 2rem;
}

.version-section {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-left: 4px solid #e67e22;
}

.version-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-section h2:before {
    content: "📅";
    font-size: 1.5rem;
}

.version-downloads {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.app-download-archive {
    padding: 1.5rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.app-download-archive:hover {
    border-color: #e67e22;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.1);
}

.app-download-archive h3 {
    color: #e67e22;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Responsive archive styles */
@media (max-width: 768px) {
    .version-downloads {
        grid-template-columns: 1fr;
    }
    
    .app-download-archive {
        margin-bottom: 1rem;
    }
    
    .platform-downloads {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .download-btn {
        min-width: 100%;
    }
}

/* Community Content Browser Styles */
.content-filters {
    background: white;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.filter-tabs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 25px;
    border: 2px solid #ecf0f1;
    color: #5d6d7e;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
}

.filter-tab.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.tab-icon {
    font-size: 1.2rem;
}

.content-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

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

.content-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.content-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
}

.content-type-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.type-icon {
    font-size: 1rem;
}

.content-stats-mini {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.content-thumbnail {
    width: 100%;
    height: 180px;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.content-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-title {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.content-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.content-title a:hover {
    color: #3498db;
}

.content-description {
    color: #5d6d7e;
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* use vendor prefixed only for broad browser compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.author-info,
.publish-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.content-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: #ecf0f1;
    color: #5d6d7e;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.content-card-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #ecf0f1;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid #ecf0f1;
    color: #5d6d7e;
}

.btn-outline:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    font-size: 1rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.75rem 1rem;
    text-decoration: none;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    color: #5d6d7e;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination a:hover {
    border-color: #3498db;
    color: #3498db;
}

.pagination .current {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

/* Responsive community styles */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .filter-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .content-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .card-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .card-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Documentation page */
.docs-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 4rem;
}

.docs-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.docs-content {
    padding: 0 0 4rem 0;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.doc-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.doc-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.doc-section ul {
    list-style: none;
    padding-left: 0;
}

.doc-section li {
    margin-bottom: 0.75rem;
}

.doc-section a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    display: block;
    border-bottom: 1px solid #ecf0f1;
}

.doc-section a:hover {
    color: #2980b9;
    background-color: #f8f9fa;
    padding-left: 0.5rem;
}

/* Authentication Styles */
.nav-auth-item {
    /* No border on mobile */
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-auth a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-auth a:hover {
    color: #3498db;
}

.nav-user {
    color: #ecf0f1;
    font-weight: 500;
}

.auth-container {
    max-width: 500px;
    margin: 4rem auto;
    padding: 0 20px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    padding: 3rem;
    text-align: center;
}

.auth-card h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.auth-form {
    text-align: left;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.form-footer a {
    color: #3498db;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Profile Styles */
.profile-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 20px;
}

.profile-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.profile-content {
    display: grid;
    gap: 2rem;
}

.profile-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.profile-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

.profile-info {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.info-item label {
    font-weight: 600;
    color: #555;
}

.info-item span {
    color: #333;
}

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

.content-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.content-item h3 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.content-item p {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

/* Authentication Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    border-top: 4px solid #3498db;
}

.auth-card h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.auth-form .btn {
    width: 100%;
    padding: 0.875rem;
    margin-top: 1rem;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e8ed;
}

.form-footer p {
    color: #666;
    font-size: 0.9rem;
}

.form-footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    font-weight: 500;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Navigation Auth Section */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    color: #ecf0f1;
    font-weight: 500;
}

.nav-auth .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Profile Styles */
.profile-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-header {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.profile-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.profile-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.profile-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.profile-info {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f4;
}

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

.info-item label {
    font-weight: 600;
    color: #555;
    min-width: 150px;
}

.info-item span {
    color: #333;
}

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

@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .profile-container {
        padding: 1rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-auth {
        order: -1;
    }
}

/* Tablet breakpoint for better medium-screen experience */
@media (min-width: 601px) and (max-width: 900px) {
    .nav-menu {
        gap: 1.5rem;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .stats-section {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0 1.5rem;
    }
}

/* Small phone optimization */
@media (max-width: 480px) {
    .nav-brand a {
        font-size: 1.4rem;
    }
    
    .hero {
        padding: 3rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
}

/* Focus visible styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

/* Improve card touch targets on mobile */
@media (max-width: 768px) {
    .card,
    .item-card,
    .character-card {
        padding: 1rem;
        min-height: 44px;
    }
    
    a.card,
    a.item-card {
        touch-action: manipulation;
    }
}

/* Landscape mobile optimization */
@media (max-width: 900px) and (orientation: landscape) {
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .nav-menu.active {
        max-height: 300px;
    }
}

/* Form inputs - prevent iOS zoom and improve mobile UX */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
        padding: 0.75rem;
        min-height: 44px;
    }
    
    textarea {
        min-height: 100px;
    }
    
    /* Sessions page chat optimization */
    #chat-messages {
        max-height: 400px !important;
        min-height: 300px;
    }
    
    #message-input {
        font-size: 16px !important;
        padding: 0.75rem !important;
        min-height: 44px;
    }
    
    /* Character list improvements */
    .lore-list li,
    .character-list-item {
        padding: 1rem;
        min-height: 60px;
        touch-action: manipulation;
    }
    
    .character-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    /* 3D model viewer touch controls */
    #character-model-canvas,
    .model-viewer,
    canvas {
        touch-action: pan-y pinch-zoom;
    }
    
    .model-viewer {
        height: 300px;
        width: 100%;
    }
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.3);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   DARK MODE - FORCED FOR ALL PAGES
   ======================================== */

/* Root Variables for Dark Mode */
:root {
    --dark-bg: #1a1a1a;
    --dark-bg-secondary: #242424;
    --dark-bg-tertiary: #2d2d2d;
    --dark-bg-hover: #333333;
    --dark-text: #e0e0e0;
    --dark-text-secondary: #b0b0b0;
    --dark-text-muted: #888888;
    --dark-border: #3a3a3a;
    --dark-accent: #3498db;
    --dark-accent-hover: #2980b9;
    --dark-card-shadow: rgba(0, 0, 0, 0.5);
}

/* Force dark mode on body */
body {
    background-color: var(--dark-bg) !important;
    color: var(--dark-text) !important;
}

/* Main content areas */
.main-content {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.container {
    background-color: transparent;
}

/* Navigation - keep gradient but darken */
.main-nav {
    background: linear-gradient(135deg, #1a1a1a, #2c3e50) !important;
}

.nav-link {
    color: #e0e0e0 !important;
    background-color: transparent !important;
}

.nav-link:hover,
.nav-item.active .nav-link {
    color: var(--dark-accent) !important;
    background-color: transparent !important;
}

.nav-brand a {
    color: #ffffff !important;
}

/* Cards and sections */
.stat-card,
.news-card,
.feature-card,
.content-card,
.auth-card,
.profile-section,
.download-section,
.requirements-section,
.version-section,
.app-download,
.app-download-archive,
.content-filters,
.doc-section,
.sheet-card,
.lore-content,
.sheet-view,
.lore-detail {
    background: var(--dark-bg-secondary) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-border) !important;
    box-shadow: 0 4px 20px var(--dark-card-shadow) !important;
}

.lore-sidebar {
    background: var(--dark-bg-secondary) !important;
    border-color: var(--dark-border) !important;
}

/* Nested backgrounds */
.lore-list,
.list,
.sheet-basic-info,
.sheet-stats-section,
.sheet-stats,
.sheet-descriptions,
.sheet-details {
    background: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border) !important;
}

/* List items and interactive elements */
.lore-list li,
.list li,
.item {
    background: transparent;
    color: var(--dark-text);
}

.lore-list li:hover,
.item:hover {
    background: var(--dark-bg-hover) !important;
}

.item.active {
    background: rgba(52, 152, 219, 0.2) !important;
    border-left-color: var(--dark-accent) !important;
}

/* Text colors */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark-text) !important;
}

p, span, li, td, th {
    color: var(--dark-text-secondary);
}

.stat-label,
.news-meta,
.news-excerpt,
.feature-card p,
.content-description,
.content-meta,
.info-item label,
.dark-text-muted {
    color: var(--dark-text-muted) !important;
}

/* Links */
a {
    color: var(--dark-accent);
}

a:hover {
    color: var(--dark-accent-hover);
}

.news-card h3 a,
.content-title a,
.feature-link,
.news-read-more {
    color: var(--dark-accent) !important;
}

.news-card h3 a:hover,
.content-title a:hover {
    color: var(--dark-accent-hover) !important;
}

/* Buttons - adjust for dark background */
.btn-secondary {
    background-color: var(--dark-bg-tertiary);
    color: var(--dark-text) !important;
    border-color: var(--dark-border);
}

.btn-secondary:hover {
    background-color: var(--dark-bg-hover);
    color: var(--dark-text) !important;
}

.btn-outline {
    background: transparent;
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.btn-outline:hover {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

/* Forms */
.form-group input,
.form-group textarea,
.form-group select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select,
.search {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-border) !important;
}

.form-group input::placeholder,
textarea::placeholder {
    color: var(--dark-text-muted);
}

.form-group input:focus,
textarea:focus,
select:focus,
.search:focus {
    background-color: var(--dark-bg-secondary) !important;
    border-color: var(--dark-accent) !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2) !important;
}

.form-group label {
    color: var(--dark-text-secondary);
}

/* Tabs */
.lore-tab,
.tab,
.filter-tab {
    background: var(--dark-bg-tertiary);
    color: var(--dark-text);
    border-color: var(--dark-border);
}

.lore-tab:hover,
.tab:hover,
.filter-tab:hover {
    background: var(--dark-bg-hover);
}

.lore-tab.active,
.tab.active,
.filter-tab.active {
    background: var(--dark-accent) !important;
    color: white !important;
    border-color: var(--dark-accent) !important;
}

/* Footer */
.site-footer {
    background: #0f0f0f !important;
    color: var(--dark-text) !important;
}

.footer-section h3 {
    color: var(--dark-accent) !important;
}

.footer-section p,
.footer-section ul,
.footer-section a {
    color: var(--dark-text-secondary) !important;
}

.footer-section a:hover {
    color: var(--dark-accent) !important;
}

.footer-bottom {
    border-top-color: var(--dark-border) !important;
    color: var(--dark-text-muted) !important;
}

/* Tables */
table {
    background-color: var(--dark-bg-secondary);
    color: var(--dark-text);
}

th {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-border) !important;
}

td {
    border-color: var(--dark-border) !important;
}

tr:hover {
    background-color: var(--dark-bg-hover) !important;
}

/* Badges and tags */
.tag,
.content-type-badge {
    background: var(--dark-bg-tertiary);
    color: var(--dark-text-secondary);
}

/* Special sections that should stay vibrant */
.hero,
.cta-section,
.features-hero,
.docs-hero,
.content-stats {
    /* Keep gradients but slightly darker */
    filter: brightness(0.85);
}

/* Borders and dividers */
.content-card-header,
.content-card-footer,
.sheet-head,
.profile-section h2,
.doc-section a,
.info-item {
    border-color: var(--dark-border) !important;
}

/* Scrollbars */
.lore-tabs-row::-webkit-scrollbar-track {
    background: var(--dark-bg-tertiary);
}

.lore-tabs-row::-webkit-scrollbar-thumb {
    background: var(--dark-accent);
}

/* 3D viewer and canvas backgrounds */
.three-container,
.pc-model-viewport {
    background: linear-gradient(180deg, #1a1a1a, #242424) !important;
}

/* Loading overlay */
.loading-overlay {
    background: rgba(10, 10, 10, 0.75) !important;
}

.loading-bar {
    background: rgba(255, 255, 255, 0.1);
}

/* Inventory and list items */
.inventory-list li {
    background: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-secondary);
}

/* Avatar backgrounds - keep colorful on dark mode (gradients preserved) */

/* Message boxes */
.message.success {
    background-color: rgba(39, 174, 96, 0.2) !important;
    color: #5edb8e !important;
    border-color: rgba(39, 174, 96, 0.4) !important;
}

.message.error {
    background-color: rgba(231, 76, 60, 0.2) !important;
    color: #ff7675 !important;
    border-color: rgba(231, 76, 60, 0.4) !important;
}

/* Stats section on homepage */
.stat-number {
    color: var(--dark-accent) !important;
}

/* Content grid items */
.content-item {
    background: var(--dark-bg-secondary) !important;
    border-left-color: var(--dark-accent) !important;
}

/* Pagination */
.pagination a,
.pagination span {
    background: var(--dark-bg-secondary);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.pagination a:hover {
    background: var(--dark-bg-hover);
    border-color: var(--dark-accent);
}

.pagination .current {
    background: var(--dark-accent) !important;
    border-color: var(--dark-accent) !important;
}

/* Hamburger menu */
.hamburger-line {
    background: #e0e0e0 !important;
}

/* Modal/dropdown backgrounds - only for mobile menu */
@media (max-width: 768px) {
    .nav-menu {
        background: linear-gradient(135deg, #1a1a1a, #2c3e50) !important;
    }
}

/* Desktop nav menu - transparent */
@media (min-width: 769px) {
    .nav-menu {
        background: transparent !important;
    }
}

/* Focus visible - better for dark mode */
*:focus-visible {
    outline-color: var(--dark-accent) !important;
}

/* Code blocks and pre */
code, pre {
    background-color: var(--dark-bg-tertiary) !important;
    color: #5edb8e !important;
    border-color: var(--dark-border) !important;
}

/* Ensure proper contrast on all text */
.item .meta .name {
    color: var(--dark-text) !important;
}

.item .meta .sub {
    color: var(--dark-text-muted) !important;
}

/* Sheet empty state */
.sheet-empty {
    color: var(--dark-text-muted) !important;
}

/* Download platform buttons - keep colorful but adjust slightly */
.download-btn.linux,
.download-btn.windows,
.download-btn.mac {
    filter: brightness(0.9);
}

.download-btn.linux:hover,
.download-btn.windows:hover,
.download-btn.mac:hover {
    filter: brightness(1);
}

/* Requirement columns */
.req-column {
    background: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border) !important;
}

.req-column h3 {
    color: var(--dark-accent) !important;
}

.req-column li {
    color: var(--dark-text-secondary);
    border-bottom-color: var(--dark-border) !important;
}

.req-column li:before {
    color: #5edb8e !important;
}

/* Stats mini */
.stat-mini,
.content-stats-mini {
    color: var(--dark-text-muted);
}

/* Ensure images don't appear too bright */
img {
    opacity: 0.9;
}

img:hover {
    opacity: 1;
}

/* Content thumbnails */
.content-thumbnail {
    background: var(--dark-bg-tertiary) !important;
}

/* App download hover states */
.app-download:hover,
.app-download-archive:hover {
    background: var(--dark-bg-hover) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6) !important;
}

/* Sessions page specific fixes */
#chat-messages {
    background-color: var(--dark-bg-tertiary) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

#chat-messages .message,
#chat-messages .system-message,
#chat-messages p,
#chat-messages div {
    color: var(--dark-text) !important;
}

#message-input {
    background-color: var(--dark-bg-tertiary) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-border) !important;
}

#message-input::placeholder {
    color: var(--dark-text-muted) !important;
}

.card,
.card-header,
.card-body {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-border) !important;
}

.list-group-item {
    background-color: var(--dark-bg-secondary) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-border) !important;
}

.text-muted {
    color: var(--dark-text-muted) !important;
}

small#connection-status {
    color: var(--dark-text-secondary) !important;
}

.badge.bg-secondary {
    background-color: var(--dark-bg-hover) !important;
    color: var(--dark-text) !important;
}
