/* ================================================
   DOOM WIKI — Complete Design System
   Matches main site: --primary-gold, --bg-darker,
   --glass-bg, Inter font, glass morphism
   ================================================ */

/* ── BASE ── */
body.wiki-body {
    background: var(--bg-darker, #02050a);
    color: var(--text-main, #e0e6ed);
    font-family: var(--font-main, 'Inter', sans-serif);
    min-height: 100vh;
}

.wiki-container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ── SECTION TITLES ── */
.w-section-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 2.5px;
    text-transform: uppercase; color: var(--primary-gold, #d7263d);
    margin-bottom: 8px;
}
.w-section-label::before {
    content: ''; width: 18px; height: 2px;
    background: var(--primary-gold, #d7263d); border-radius: 1px;
}

.w-section-title {
    font-size: 1.6rem; font-weight: 800; margin: 0 0 6px;
    letter-spacing: 0.3px; color: #fff;
}

.w-section-desc {
    font-size: 0.88rem; color: var(--text-muted, #8a9bb0);
    margin: 0 0 28px; line-height: 1.5;
}

.w-section-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}

/* ── GLASS PANEL ── */
.w-glass {
    background: var(--glass-bg, rgba(10,18,30,0.6));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.w-glass-sm { border-radius: 12px; }

/* ── BUTTONS (extends main site) ── */
.w-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px; border-radius: 10px; font-size: 0.85rem;
    font-weight: 600; font-family: var(--font-main, 'Inter', sans-serif);
    text-decoration: none; cursor: pointer; border: none;
    transition: all 0.25s ease; white-space: nowrap;
}
.w-btn-primary {
    background: linear-gradient(135deg, var(--primary-gold, #d7263d), #b31224);
    color: #fff; box-shadow: 0 4px 15px rgba(215,38,61,0.3);
}
.w-btn-primary:hover { box-shadow: 0 6px 25px rgba(215,38,61,0.45); transform: translateY(-1px); }
.w-btn-outline {
    background: transparent; color: var(--text-main, #e0e6ed);
    border: 1px solid rgba(255,255,255,0.12);
}
.w-btn-outline:hover { border-color: var(--primary-gold, #d7263d); color: #fff; }
.w-btn-ghost { background: rgba(255,255,255,0.04); color: var(--text-muted, #8a9bb0); }
.w-btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-main); }
.w-btn-danger { background: rgba(215,38,61,0.12); color: #ff4466; border: 1px solid rgba(215,38,61,0.3); }
.w-btn-danger:hover { background: rgba(215,38,61,0.25); }
.w-btn-sm { padding: 7px 14px; font-size: 0.78rem; border-radius: 8px; }
.w-btn-xs { padding: 5px 10px; font-size: 0.72rem; border-radius: 6px; }

/* ── BADGES ── */
.w-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.3px;
}
.w-badge-public { background: rgba(0,200,83,0.08); border: 1px solid rgba(0,200,83,0.2); color: #00c853; }
.w-badge-staff { background: rgba(255,193,7,0.08); border: 1px solid rgba(255,193,7,0.2); color: #ffc107; }
.w-badge-private { background: rgba(215,38,61,0.08); border: 1px solid rgba(215,38,61,0.2); color: #d7263d; }
.w-badge-draft { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: var(--text-muted); }
.w-badge-published { background: rgba(0,200,83,0.06); border: 1px solid rgba(0,200,83,0.15); color: #66bb6a; }
.w-badge-type {
    background: rgba(215,38,61,0.06); border: 1px solid rgba(215,38,61,0.15);
    color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.5px;
}

/* ══════════════════════════════════════
   DASHBOARD HERO
   ══════════════════════════════════════ */
.w-hero {
    position: relative; min-height: 560px;
    display: flex; align-items: center; overflow: hidden;
    padding-top: 80px;
}
.w-hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(215,38,61,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(10,18,30,0.9) 0%, var(--bg-darker, #02050a) 100%);
}
.w-hero-content {
    position: relative; z-index: 2; width: 100%;
    max-width: 1240px; margin: 0 auto; padding: 60px 24px;
}
.w-hero-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.w-hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(215,38,61,0.1); border: 1px solid rgba(215,38,61,0.25);
    padding: 6px 16px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 2px;
    color: var(--primary-gold, #d7263d); text-transform: uppercase;
    margin-bottom: 20px;
}
.w-hero-title {
    font-size: 3.2rem; font-weight: 800;
    line-height: 1.1; margin: 0 0 16px; color: #fff;
}
.w-hero-title span { color: var(--primary-gold, #d7263d); }
.w-hero-desc {
    font-size: 1.05rem; color: var(--text-muted, #8a9bb0);
    line-height: 1.7; margin: 0 0 32px; max-width: 500px;
}
.w-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero Stats Panel */
.w-hero-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.w-stat-card {
    background: var(--glass-bg, rgba(10,18,30,0.6));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 24px;
    backdrop-filter: blur(10px); transition: all 0.3s ease;
}
.w-stat-card:hover { border-color: rgba(215,38,61,0.2); transform: translateY(-2px); }
.w-stat-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; margin-bottom: 14px;
    background: rgba(215,38,61,0.08); color: var(--primary-gold, #d7263d);
    border: 1px solid rgba(215,38,61,0.15);
}
.w-stat-value { font-size: 1.8rem; font-weight: 800; color: #fff; margin-bottom: 4px; }
.w-stat-label { font-size: 0.78rem; color: var(--text-muted, #8a9bb0); }

/* ══════════════════════════════════════
   CHARACTER CARDS
   ══════════════════════════════════════ */
.w-char-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.w-char-card {
    background: var(--glass-bg, rgba(10,18,30,0.6));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px; overflow: hidden;
    text-decoration: none; color: var(--text-main);
    transition: all 0.3s ease; display: flex; flex-direction: column;
}
.w-char-card:hover {
    transform: translateY(-4px); border-color: rgba(215,38,61,0.3);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.w-char-cover {
    height: 140px; background-size: cover; background-position: center;
    position: relative; border-bottom: 1px solid rgba(255,255,255,0.04);
    background-color: rgba(215,38,61,0.03);
}
.w-char-avatar {
    position: absolute; bottom: -24px; left: 20px;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--bg-darker, #02050a); border: 3px solid var(--bg-darker, #02050a);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; font-size: 1.1rem; color: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 2px rgba(215,38,61,0.2);
}
.w-char-avatar img { width: 100%; height: 100%; object-fit: cover; }
.w-char-card-badge {
    position: absolute; top: 12px; right: 12px;
}
.w-char-body { padding: 32px 20px 12px; flex: 1; }
.w-char-name { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
.w-char-title-text { font-size: 0.78rem; color: var(--text-muted); margin: 0 0 10px; }
.w-char-summary {
    font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.w-char-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; border-top: 1px solid rgba(255,255,255,0.04);
    font-size: 0.72rem; color: var(--text-muted);
}
.w-char-meta { display: flex; gap: 14px; }
.w-char-meta span { display: flex; align-items: center; gap: 4px; }
.w-char-meta i { color: var(--primary-gold, #d7263d); font-size: 0.7rem; }

/* Character card actions for My Characters */
.w-char-actions {
    display: flex; gap: 8px; padding: 12px 20px 16px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

/* ══════════════════════════════════════
   STORY CARDS
   ══════════════════════════════════════ */
.w-story-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.w-story-card {
    background: var(--glass-bg, rgba(10,18,30,0.6));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 22px;
    text-decoration: none; color: var(--text-main);
    transition: all 0.3s ease;
    display: flex; flex-direction: column;
}
.w-story-card:hover {
    transform: translateY(-3px); border-color: rgba(215,38,61,0.25);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.w-story-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }

.w-story-chapter-num {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px;
    background: rgba(215,38,61,0.08); border: 1px solid rgba(215,38,61,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; font-weight: 800; color: var(--primary-gold, #d7263d);
}

.w-story-info { flex: 1; min-width: 0; }
.w-story-title { font-size: 1rem; font-weight: 700; margin: 0 0 4px; }
.w-story-character {
    font-size: 0.78rem; color: var(--text-muted); display: flex;
    align-items: center; gap: 6px;
}
.w-story-character img {
    width: 18px; height: 18px; border-radius: 50%; object-fit: cover;
    border: 1px solid rgba(215,38,61,0.2);
}

.w-story-excerpt {
    font-size: 0.82rem; color: var(--text-muted); line-height: 1.6;
    margin: 0 0 14px; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.w-story-footer {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.72rem; color: rgba(255,255,255,0.3);
    padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.04);
}
.w-story-stats { display: flex; gap: 14px; }
.w-story-stats span { display: flex; align-items: center; gap: 4px; }

/* ══════════════════════════════════════
   DEVELOPMENT TIMELINE
   ══════════════════════════════════════ */
.w-timeline { position: relative; padding-left: 32px; }
.w-timeline::before {
    content: ''; position: absolute; left: 12px; top: 0; bottom: 0;
    width: 2px; background: linear-gradient(to bottom, rgba(215,38,61,0.4), rgba(215,38,61,0.05));
    border-radius: 1px;
}

.w-timeline-item {
    position: relative; margin-bottom: 20px;
    padding: 18px 20px; background: var(--glass-bg, rgba(10,18,30,0.6));
    border: 1px solid rgba(255,255,255,0.06); border-radius: 12px;
    transition: all 0.3s ease;
}
.w-timeline-item:hover {
    border-color: rgba(215,38,61,0.2);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.w-timeline-dot {
    position: absolute; left: -27px; top: 22px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--primary-gold, #d7263d);
    box-shadow: 0 0 10px rgba(215,38,61,0.4);
    border: 2px solid var(--bg-darker, #02050a);
}

.w-timeline-dot.milestone { background: #d7263d; }
.w-timeline-dot.personality { background: #ab47bc; }
.w-timeline-dot.skill { background: #29b6f6; }
.w-timeline-dot.relationship { background: #ff7043; }
.w-timeline-dot.event { background: #ffc107; }
.w-timeline-dot.other { background: #78909c; }

.w-timeline-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; margin-bottom: 8px;
}
.w-timeline-title { font-size: 0.95rem; font-weight: 700; margin: 0; }
.w-timeline-date {
    font-size: 0.72rem; color: var(--text-muted); white-space: nowrap;
    flex-shrink: 0;
}
.w-timeline-desc {
    font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; margin: 0 0 8px;
}
.w-timeline-meta {
    display: flex; gap: 10px; align-items: center;
    font-size: 0.72rem; color: rgba(255,255,255,0.3);
}

/* Dev type icons */
.w-dev-type-icon {
    width: 28px; height: 28px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
}
.w-dev-type-icon.milestone { background: rgba(215,38,61,0.1); color: #d7263d; }
.w-dev-type-icon.personality { background: rgba(171,71,188,0.1); color: #ab47bc; }
.w-dev-type-icon.skill { background: rgba(41,182,246,0.1); color: #29b6f6; }
.w-dev-type-icon.relationship { background: rgba(255,112,67,0.1); color: #ff7043; }
.w-dev-type-icon.event { background: rgba(255,193,7,0.1); color: #ffc107; }
.w-dev-type-icon.other { background: rgba(120,144,156,0.1); color: #78909c; }

/* ══════════════════════════════════════
   CHARACTER PROFILE PAGE
   ══════════════════════════════════════ */
.w-profile-banner {
    position: relative; min-height: 340px;
    background: linear-gradient(135deg, var(--bg-darker) 0%, rgba(215,38,61,0.04) 50%, var(--bg-darker) 100%);
    background-size: cover; background-position: center;
    display: flex; align-items: flex-end; padding-top: 70px;
}
.w-profile-banner-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, var(--bg-darker, #02050a) 0%, rgba(2,5,10,0.3) 40%, rgba(2,5,10,0.7) 100%);
}
.w-profile-banner-content {
    position: relative; z-index: 2; width: 100%;
    max-width: 1240px; margin: 0 auto; padding: 40px 24px 30px;
}

.w-profile-hero { display: flex; align-items: flex-end; gap: 24px; }

.w-profile-avatar {
    width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,0.05); border: 3px solid var(--primary-gold, #d7263d);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; font-size: 2.5rem; color: rgba(255,255,255,0.15);
    box-shadow: 0 0 40px rgba(215,38,61,0.2);
}
.w-profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.w-profile-info { flex: 1; min-width: 0; }
.w-profile-name { font-size: 2.4rem; font-weight: 800; margin: 0 0 4px; color: #fff; }
.w-profile-subtitle { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 10px; }
.w-profile-meta {
    display: flex; flex-wrap: wrap; gap: 14px;
    font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px;
}
.w-profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.w-profile-tag {
    font-size: 0.68rem; padding: 3px 10px;
    background: rgba(215,38,61,0.08); border: 1px solid rgba(215,38,61,0.2);
    border-radius: 20px; color: rgba(255,255,255,0.5);
}

/* Profile Tabs */
.w-profile-tabs {
    display: flex; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 30px; overflow-x: auto;
}
.w-profile-tab {
    padding: 14px 24px; font-size: 0.85rem; font-weight: 600;
    color: var(--text-muted); cursor: pointer; position: relative;
    white-space: nowrap; transition: color 0.2s; border: none; background: none;
    font-family: var(--font-main, 'Inter', sans-serif);
}
.w-profile-tab:hover { color: var(--text-main); }
.w-profile-tab.active { color: #fff; }
.w-profile-tab.active::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
    height: 2px; background: var(--primary-gold, #d7263d);
    border-radius: 1px 1px 0 0;
}

/* Profile Grid */
.w-profile-grid {
    display: grid; grid-template-columns: 1fr 320px; gap: 30px;
    align-items: start;
}

/* Profile Sidebar */
.w-profile-sidebar { position: sticky; top: 80px; }

.w-infobox {
    background: var(--glass-bg, rgba(10,18,30,0.6));
    border: 1px solid rgba(255,255,255,0.06); border-radius: 14px;
    overflow: hidden; margin-bottom: 16px; backdrop-filter: blur(8px);
}
.w-infobox-header {
    background: linear-gradient(135deg, rgba(215,38,61,0.08), rgba(215,38,61,0.02));
    padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.w-infobox-header h3 { margin: 0; font-size: 0.9rem; font-weight: 700; }
.w-infobox-body { padding: 16px 20px; }

.w-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.8rem;
}
.w-info-row:last-child { border-bottom: none; }
.w-info-key { color: var(--text-muted); }
.w-info-val { font-weight: 600; color: var(--text-main); text-align: right; max-width: 60%; }

/* ══════════════════════════════════════
   CHARACTER CREATOR / EDITOR
   ══════════════════════════════════════ */
.w-creator-wrap { padding-top: 80px; padding-bottom: 60px; }

.w-creator-grid {
    display: grid; grid-template-columns: 1fr 320px; gap: 30px;
    align-items: start;
}

.w-form-panel {
    background: var(--glass-bg, rgba(10,18,30,0.6));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px; overflow: hidden;
    backdrop-filter: blur(12px);
}
.w-form-header {
    padding: 28px 28px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.w-form-header h2 { 
    margin: 0 0 6px; font-size: 1.35rem; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
}
.w-form-header h2 i { color: var(--primary-gold, #d7263d); }
.w-form-header p { color: var(--text-muted); margin: 0; font-size: 0.85rem; }

.w-form-body { padding: 0 28px 28px; }

.w-form-section {
    padding: 24px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.w-form-section:last-of-type { border-bottom: none; }

.w-form-section h3 {
    font-size: 1rem; font-weight: 700; margin: 0 0 16px;
    display: flex; align-items: center; gap: 10px; color: var(--text-main);
}
.w-form-section h3 i { color: var(--primary-gold, #d7263d); font-size: 0.85rem; }

.w-field { margin-bottom: 18px; }
.w-field label {
    display: block; font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted); margin-bottom: 6px;
}
.w-field .required { color: var(--primary-gold, #d7263d); }

.w-input,
.w-textarea,
.w-select {
    width: 100%; padding: 12px 14px;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; color: var(--text-main);
    font-family: var(--font-main, 'Inter', sans-serif); font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.w-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.w-select { cursor: pointer; appearance: none; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238a9bb0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 36px;
}
.w-select option { background: #0a121e; color: var(--text-main); }
.w-input:focus, .w-textarea:focus, .w-select:focus {
    outline: none; border-color: var(--primary-gold, #d7263d);
    box-shadow: 0 0 12px rgba(215,38,61,0.15);
}

/* Visibility Selector */
.w-visibility-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.w-vis-option { cursor: pointer; }
.w-vis-option input { display: none; }
.w-vis-card {
    padding: 16px; background: rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.06); border-radius: 12px;
    text-align: center; transition: all 0.3s ease;
}
.w-vis-card i { font-size: 1.5rem; display: block; margin-bottom: 8px; color: rgba(255,255,255,0.2); }
.w-vis-card span { display: block; font-weight: 600; font-size: 0.82rem; margin-bottom: 3px; }
.w-vis-card small { color: var(--text-muted); font-size: 0.72rem; }
.w-vis-option input:checked + .w-vis-card {
    border-color: var(--primary-gold, #d7263d); background: rgba(215,38,61,0.06);
}
.w-vis-option input:checked + .w-vis-card i { color: var(--primary-gold, #d7263d); }

/* Image Upload */
.w-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.w-upload-box label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.w-upload-area {
    position: relative; height: 180px;
    border: 2px dashed rgba(255,255,255,0.08); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease; overflow: hidden;
    background: rgba(0,0,0,0.15);
}
.w-upload-area:hover { border-color: var(--primary-gold, #d7263d); background: rgba(215,38,61,0.03); }
.w-upload-placeholder { text-align: center; color: rgba(255,255,255,0.2); }
.w-upload-placeholder i { font-size: 2rem; display: block; margin-bottom: 8px; }
.w-upload-placeholder span { display: block; font-size: 0.82rem; font-weight: 600; }
.w-upload-placeholder small { display: block; font-size: 0.7rem; margin-top: 4px; }
.w-upload-preview { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.w-upload-remove {
    position: absolute; top: 8px; right: 8px; width: 30px; height: 30px;
    background: rgba(215,38,61,0.9); border: none; border-radius: 50%;
    color: #fff; cursor: pointer; font-size: 0.75rem;
    display: none; align-items: center; justify-content: center;
}

/* Dynamic lists (relations, timeline, custom fields) */
.w-dyn-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.w-dyn-row { display: flex; gap: 8px; align-items: center; }
.w-dyn-row input {
    flex: 1; padding: 10px 12px; background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 8px;
    color: var(--text-main); font-family: var(--font-main); font-size: 0.85rem;
}
.w-dyn-row input:focus { outline: none; border-color: var(--primary-gold); }
.w-dyn-remove {
    width: 34px; height: 34px; flex-shrink: 0;
    background: rgba(215,38,61,0.1); border: 1px solid rgba(215,38,61,0.2);
    border-radius: 8px; color: #d7263d; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.w-dyn-remove:hover { background: rgba(215,38,61,0.25); }
.w-dyn-add {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px; background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.1); border-radius: 8px;
    color: var(--text-muted); cursor: pointer; font-size: 0.8rem;
    font-family: var(--font-main); transition: all 0.2s;
}
.w-dyn-add:hover { border-color: var(--primary-gold); color: var(--text-main); }

/* Gallery */
.w-gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px; margin-bottom: 10px;
}
.w-gallery-item {
    position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}
.w-gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.w-gallery-remove {
    position: absolute; top: 4px; right: 4px; width: 26px; height: 26px;
    background: rgba(215,38,61,0.9); border: none; border-radius: 50%; color: #fff;
    cursor: pointer; font-size: 0.65rem; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.w-gallery-item:hover .w-gallery-remove { opacity: 1; }

/* Sidebar panel */
.w-sidebar-panel { position: sticky; top: 80px; }

.w-sidebar-box {
    background: var(--glass-bg, rgba(10,18,30,0.6));
    border: 1px solid rgba(255,255,255,0.06); border-radius: 14px;
    padding: 20px; margin-bottom: 16px; backdrop-filter: blur(8px);
}
.w-sidebar-box h3 {
    font-size: 0.88rem; font-weight: 700; margin: 0 0 14px;
    padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; gap: 8px;
}
.w-sidebar-box h3 i { color: var(--primary-gold, #d7263d); }

.w-sidebar-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: rgba(255,255,255,0.03); border: 2px solid rgba(215,38,61,0.2);
    margin: 0 auto 10px; display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: rgba(255,255,255,0.12); overflow: hidden;
}
.w-sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.w-sidebar-name { text-align: center; font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.w-sidebar-subtitle { text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; }

.w-tips li {
    font-size: 0.78rem; color: var(--text-muted); padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding-left: 14px; position: relative; list-style: none;
}
.w-tips li::before { content: '\2022'; position: absolute; left: 0; color: var(--primary-gold); }
.w-tips li:last-child { border-bottom: none; }

/* Form actions */
.w-form-actions { display: flex; gap: 12px; padding-top: 24px; }
.w-form-actions .w-btn { flex: 1; justify-content: center; }

/* ══════════════════════════════════════
   STORY READER
   ══════════════════════════════════════ */
.w-reader-wrap { padding-top: 100px; padding-bottom: 80px; }

.w-reader-header {
    text-align: center; max-width: 700px; margin: 0 auto 40px;
}
.w-reader-chapter-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: var(--primary-gold, #d7263d);
    margin-bottom: 12px;
}
.w-reader-title { font-size: 2.2rem; font-weight: 800; margin: 0 0 12px; color: #fff; }
.w-reader-meta {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 16px;
    font-size: 0.82rem; color: var(--text-muted);
}
.w-reader-meta a { color: var(--primary-gold); text-decoration: none; }
.w-reader-meta a:hover { text-decoration: underline; }

.w-reader-content {
    max-width: 720px; margin: 0 auto;
    background: var(--glass-bg, rgba(10,18,30,0.6));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px; padding: 40px 48px;
    font-size: 1rem; line-height: 1.9; color: var(--text-muted);
    backdrop-filter: blur(12px); white-space: pre-wrap; word-wrap: break-word;
}

.w-reader-nav {
    max-width: 720px; margin: 30px auto 0;
    display: flex; justify-content: space-between; gap: 16px;
}
.w-reader-nav-btn {
    flex: 1; display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; background: var(--glass-bg);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 12px;
    color: var(--text-main); text-decoration: none;
    transition: all 0.2s;
}
.w-reader-nav-btn:hover { border-color: rgba(215,38,61,0.3); }
.w-reader-nav-btn.next { text-align: right; justify-content: flex-end; }
.w-reader-nav-label { font-size: 0.72rem; color: var(--text-muted); }
.w-reader-nav-title { font-size: 0.88rem; font-weight: 600; }

/* Story Engagement Bar */
.w-story-engagement {
    max-width: 720px; margin: 24px auto 0;
    display: flex; justify-content: space-between; align-items: center;
    background: var(--glass-bg, rgba(10,18,30,0.6));
    border: 1px solid rgba(255,255,255,0.06); border-radius: 12px;
    padding: 14px 24px; backdrop-filter: blur(8px);
}
.w-engagement-stats {
    display: flex; align-items: center; gap: 16px;
    font-size: 0.82rem; color: var(--text-muted);
}
.w-engagement-views {
    display: flex; align-items: center; gap: 6px;
}
.w-engagement-views i { color: rgba(255,255,255,0.3); }
.w-engagement-actions {
    display: flex; gap: 8px;
}
.w-like-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted); font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: all 0.25s ease;
    font-family: inherit;
}
.w-like-btn:hover {
    background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.25);
    color: #22c55e;
}
.w-like-btn.dislike:hover {
    background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25);
    color: #ef4444;
}
.w-like-btn.active {
    background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35);
    color: #22c55e;
}
.w-like-btn.dislike.active {
    background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.35);
    color: #ef4444;
}
.w-like-btn.active .fa-heart {
    color: #ef4444;
}

/* ══════════════════════════════════════
   STORY WRITER / DEVELOPMENT FORM
   ══════════════════════════════════════ */
.w-writer-wrap { padding-top: 100px; padding-bottom: 60px; }
.w-writer-grid {
    display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start;
}

/* Dev type selector grid */
.w-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.w-type-option { cursor: pointer; }
.w-type-option input { display: none; }
.w-type-card {
    padding: 14px 10px; border-radius: 10px; text-align: center;
    border: 2px solid rgba(255,255,255,0.06); transition: all 0.25s;
    background: rgba(0,0,0,0.15);
}
.w-type-card i { display: block; font-size: 1.3rem; margin-bottom: 6px; color: rgba(255,255,255,0.2); }
.w-type-card span { display: block; font-size: 0.72rem; font-weight: 600; }
.w-type-option input:checked + .w-type-card { border-color: var(--primary-gold); background: rgba(215,38,61,0.06); }
.w-type-option input:checked + .w-type-card i { color: var(--primary-gold); }

/* ══════════════════════════════════════
   MY CHARACTERS PAGE
   ══════════════════════════════════════ */
.w-my-wrap { padding-top: 100px; padding-bottom: 60px; }

.w-my-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.w-my-header h1 { font-size: 1.7rem; margin: 0 0 6px; font-weight: 700; }
.w-my-header h1 i { color: var(--primary-gold, #d7263d); margin-right: 10px; }
.w-my-header p { color: var(--text-muted); margin: 0; font-size: 0.85rem; }

.w-empty {
    text-align: center; padding: 80px 20px;
    grid-column: 1 / -1;
}
.w-empty i { font-size: 3rem; color: rgba(255,255,255,0.06); margin-bottom: 16px; display: block; }
.w-empty h3 { margin-bottom: 8px; font-weight: 700; }
.w-empty p { color: var(--text-muted); margin-bottom: 20px; }

.w-loading {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
    grid-column: 1 / -1;
}
.w-loading i { margin-right: 8px; }

/* ══════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════ */
.w-toast {
    position: fixed; bottom: 30px; right: 30px;
    padding: 14px 24px; border-radius: 12px;
    font-size: 0.85rem; font-weight: 600; z-index: 10000;
    display: flex; align-items: center; gap: 10px;
    transform: translateY(20px); opacity: 0; transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); backdrop-filter: blur(12px);
}
.w-toast.show { transform: translateY(0); opacity: 1; }
.w-toast-success { background: rgba(0,200,83,0.12); border: 1px solid rgba(0,200,83,0.3); color: #00c853; }
.w-toast-error { background: rgba(215,38,61,0.12); border: 1px solid rgba(215,38,61,0.3); color: #ff4466; }
.w-toast-warning { background: rgba(255,193,7,0.12); border: 1px solid rgba(255,193,7,0.3); color: #ffc107; }
.w-toast-info { background: rgba(41,121,255,0.12); border: 1px solid rgba(41,121,255,0.3); color: #2979ff; }

/* ══════════════════════════════════════
   MODAL
   ══════════════════════════════════════ */
.w-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.w-modal {
    background: rgba(10,18,30,0.95); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px; padding: 40px; text-align: center;
    max-width: 420px; width: 90%; backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.w-modal-icon { font-size: 2.5rem; color: #ffc107; margin-bottom: 16px; }
.w-modal h3 { margin: 0 0 10px; font-weight: 700; }
.w-modal p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.w-modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ══════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════ */
.w-scroll::-webkit-scrollbar { height: 6px; width: 6px; }
.w-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 3px; }
.w-scroll::-webkit-scrollbar-thumb { background: rgba(215,38,61,0.25); border-radius: 3px; }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 1024px) {
    .w-hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .w-hero-stats { order: -1; }
    .w-profile-grid, .w-creator-grid, .w-writer-grid { grid-template-columns: 1fr !important; }
    .w-profile-sidebar, .w-sidebar-panel { position: static !important; }
    .w-reader-content { padding: 30px 28px; }
}

@media (max-width: 768px) {
    .w-hero { min-height: auto; padding-top: 70px; }
    .w-hero-content { padding: 40px 16px; }
    .w-hero-title { font-size: 2.2rem; }
    .w-hero-desc { font-size: 0.95rem; }
    .w-hero-actions { flex-direction: column; }
    .w-hero-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .w-stat-card { padding: 16px; }
    .w-stat-value { font-size: 1.4rem; }

    .w-char-grid { grid-template-columns: 1fr; }
    .w-story-grid { grid-template-columns: 1fr; }

    .w-section-title { font-size: 1.3rem; }

    .w-profile-banner { min-height: 280px; }
    .w-profile-hero { flex-direction: column; align-items: flex-start; }
    .w-profile-name { font-size: 1.8rem; }
    .w-profile-avatar { width: 90px; height: 90px; }
    .w-profile-tabs { gap: 0; }
    .w-profile-tab { padding: 12px 16px; font-size: 0.8rem; }

    .w-creator-wrap, .w-my-wrap, .w-writer-wrap { padding-top: 80px; }
    .w-form-header { padding: 20px 20px 16px; }
    .w-form-body { padding: 0 20px 20px; }
    .w-upload-grid { grid-template-columns: 1fr; }
    .w-visibility-grid { grid-template-columns: 1fr; }
    .w-type-grid { grid-template-columns: repeat(2, 1fr); }

    .w-reader-wrap { padding-top: 80px; }
    .w-reader-title { font-size: 1.6rem; }
    .w-reader-content { padding: 24px 20px; font-size: 0.95rem; }
    .w-reader-nav { flex-direction: column; }

    .w-my-header { flex-direction: column; gap: 16px; align-items: flex-start; }

    .w-timeline { padding-left: 28px; }
}

@media (max-width: 480px) {
    .w-hero-title { font-size: 1.8rem; }
    .w-hero-stats { grid-template-columns: 1fr; }
    .w-char-grid { grid-template-columns: 1fr; }
    .w-reader-title { font-size: 1.3rem; }
    .w-form-actions { flex-direction: column; }
}

/* ═══════════════════════════════════
   IMAGE UPLOAD & GALLERY STYLES
   ═══════════════════════════════════ */

.w-image-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.w-image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.w-image-thumb {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s;
}

.w-image-thumb:hover {
    border-color: var(--primary-gold);
}

.w-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.w-image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(215, 38, 61, 0.9);
    border: none;
    color: #fff;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.w-image-thumb:hover .w-image-remove {
    opacity: 1;
}

.w-image-add-btn {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.w-image-add-btn:hover {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
    background: rgba(212, 175, 55, 0.05);
}

.w-image-add-btn i {
    font-size: 1.4rem;
}

/* Development images in timeline */
.w-dev-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 6px;
}

.w-dev-image-thumb {
    width: 140px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.25s;
}

.w-dev-image-thumb:hover {
    transform: scale(1.03);
    border-color: var(--primary-gold);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.15);
}

.w-dev-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Story images in reader */
.w-story-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin: 24px auto 0;
    max-width: 720px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.w-story-image-item {
    border-radius: 10px;
    overflow: hidden;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.25s;
    aspect-ratio: 16/10;
}

.w-story-image-item:hover {
    transform: scale(1.02);
    border-color: var(--primary-gold);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.15);
}

.w-story-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 640px) {
    .w-image-thumb, .w-image-add-btn {
        width: 90px;
        height: 90px;
    }
    .w-dev-image-thumb {
        width: 110px;
        height: 80px;
    }
    .w-story-images {
        grid-template-columns: 1fr 1fr;
    }
}
