@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --emerald: #064e3b;
    --emerald-light: #0f7a5f;
    --gold: #b45309;
    --gold-light: #d4a030;
    --parchment: #f5e6ca;
    --parchment-dark: #e8d5b0;
    --dark: #1a1a2e;
    --dark-mid: #2d2d44;
    --text-light: #f0e6d3;
    --text-dark: #2c1810;
    --danger: #8b1a1a;
    --campfire: #ff6b35;
}

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

body {
    font-family: 'Crimson Text', Georgia, serif;
    background: var(--dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
}

.navbar {
    background: linear-gradient(135deg, var(--emerald), var(--dark));
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.navbar-brand {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-light);
    text-decoration: none;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-links a:hover {
    color: var(--gold-light);
}

.nav-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--gold-light);
}

.nav-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hamburger-toggle {
    display: none;
    background: none;
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-size: 1.3rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.hamburger-toggle:hover {
    background: rgba(180,83,9,0.2);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 6rem 2rem;
    background: linear-gradient(to bottom, var(--dark), var(--emerald));
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 80%, rgba(180,83,9,0.15) 0%, transparent 60%);
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--gold-light);
    margin-bottom: 1rem;
    position: relative;
    text-shadow: 0 2px 20px rgba(180,83,9,0.3);
}

.hero p {
    font-size: 1.3rem;
    color: var(--parchment);
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

.login-form {
    display: flex;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.login-form input {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    font-family: 'Crimson Text', serif;
    background: var(--parchment);
    color: var(--text-dark);
    border: 2px solid var(--gold);
    border-radius: 4px;
    width: 300px;
}

.login-hint {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--gold);
    opacity: 0.85;
    font-family: 'Crimson Text', serif;
    font-style: italic;
}

.btn {
    padding: 0.7rem 1.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--dark);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(180,83,9,0.4);
}

.btn-emerald {
    background: linear-gradient(135deg, var(--emerald), var(--emerald-light));
    color: var(--text-light);
    border: 1px solid var(--emerald-light);
}

.btn-emerald:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(6,78,59,0.4);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-danger {
    background: var(--danger);
    color: var(--text-light);
}
.btn-danger:hover {
    background: #b91c1c;
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}
.btn-outline:hover {
    background: rgba(180,83,9,0.15);
}
.btn-outline:disabled {
    border-color: #555;
    color: #555;
    cursor: not-allowed;
}

.card {
    background: linear-gradient(135deg, var(--dark-mid), var(--dark));
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(180,83,9,0.2);
}

.card h3 {
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--parchment-dark);
    margin-bottom: 1rem;
}

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

.quest-type {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--emerald-light);
    margin-bottom: 0.3rem;
}

.quest-goal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--parchment-dark);
}

.progress-bar {
    background: var(--dark);
    border-radius: 10px;
    height: 10px;
    margin: 0.5rem 0;
    overflow: hidden;
    border: 1px solid rgba(180,83,9,0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald), var(--gold));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.editor-container {
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 1rem;
    min-height: calc(100vh - 70px);
    padding: 1rem;
}

.chapter-nav {
    display: flex;
    flex-direction: column;
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    overflow: hidden;
    max-height: calc(100vh - 90px);
    position: sticky;
    top: 1rem;
}

.chapter-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    border-bottom: 1px solid rgba(180,83,9,0.2);
    flex-shrink: 0;
}

.chapter-nav-header h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.chapter-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.3rem 0;
}

.chapter-item {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    color: var(--parchment-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.chapter-item:hover {
    background: rgba(180,83,9,0.1);
    color: var(--gold-light);
}

.chapter-item.active {
    background: rgba(180,83,9,0.15);
    color: var(--gold-light);
    border-left-color: var(--gold);
}

.chapter-item i {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.chapter-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-nav-footer {
    padding: 0.6rem;
    border-top: 1px solid rgba(180,83,9,0.2);
    flex-shrink: 0;
}

.editor-main {
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: var(--dark-mid);
    border-radius: 8px 8px 0 0;
    border: 1px solid rgba(180,83,9,0.3);
    border-bottom: none;
}

.editor-toolbar-left {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.editor-toolbar-right {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

#quill-editor {
    flex: 1;
    width: 100%;
    padding: 2rem;
    font-family: 'Crimson Text', serif;
    font-size: 1.15rem;
    line-height: 1.8;
    background: var(--parchment);
    color: var(--text-dark);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 0 0 8px 8px;
    resize: none;
    outline: none;
    min-height: 500px;
}

#quill-editor::placeholder {
    color: #9c8b75;
    font-style: italic;
}

.editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-panel {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    padding: 1rem;
}

.sidebar-panel h4 {
    color: var(--gold-light);
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quest-goal-panel {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--dark-mid), rgba(180,83,9,0.08));
}

.quest-goal-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--gold-light);
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.quest-goal-desc {
    font-size: 0.8rem;
    color: var(--parchment-dark);
    line-height: 1.4;
    margin-bottom: 0.8rem;
    font-style: italic;
}

.quest-goal-progress {
    text-align: center;
    padding: 0.5rem 0;
}

.quest-goal-numbers {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--gold-light);
    font-weight: 700;
}

.quest-goal-divider {
    color: var(--parchment-dark);
    margin: 0 0.2rem;
}

.quest-goal-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--parchment-dark);
    margin-top: 0.1rem;
}

.quest-goal-pct {
    text-align: center;
    font-size: 0.8rem;
    color: var(--emerald-light);
    margin-bottom: 0.5rem;
}

.quest-goal-reward {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gold-light);
    padding: 0.4rem;
    background: rgba(180,83,9,0.1);
    border-radius: 4px;
    margin-top: 0.3rem;
}

.quest-goal-milestone {
    text-align: center;
    font-size: 0.75rem;
    color: var(--parchment-dark);
    margin-top: 0.4rem;
    font-style: italic;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-label {
    color: var(--parchment-dark);
}

.stat-value {
    color: var(--gold-light);
    font-weight: 600;
}

.xp-display {
    text-align: center;
    padding: 0.5rem;
    font-size: 1.5rem;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
}

.paste-warning {
    display: none;
    background: rgba(139,26,26,0.3);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.paste-warning.active {
    display: block;
}

.map-viewport {
    position: relative;
    max-width: 100%;
    margin: 1.5rem auto;
    border-radius: 12px;
    border: 3px solid var(--gold);
    overflow: hidden;
    height: 70vh;
    min-height: 450px;
    max-height: 700px;
    cursor: grab;
    background: #0a1a14;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.map-world {
    position: relative;
    width: 1200px;
    height: 900px;
    transform-origin: center center;
    transition: transform 0.05s linear;
    margin: 0 auto;
    left: 50%;
    top: 50%;
    margin-left: -600px;
    margin-top: -450px;
}

.map-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 0;
}

.map-region {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.map-region-label {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: rgba(245,230,202,0.45);
    letter-spacing: 3px;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 1px 6px rgba(0,0,0,0.7), 0 0 12px rgba(0,0,0,0.5);
}

.map-region-mountains { left: 78%; top: 8%; }
.map-region-forest { left: 18%; top: 28%; }
.map-region-plains { left: 42%; top: 65%; }
.map-region-coast { left: 78%; top: 88%; }
.map-region-peaks { left: 5%; top: 55%; }

.map-poi {
    position: absolute;
    text-align: center;
    z-index: 2;
    transform: translate(-50%, -50%);
    text-decoration: none;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.map-poi:hover {
    transform: translate(-50%, -50%) scale(1.12);
    z-index: 10;
}

.map-poi-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto 0.25rem;
    border: 3px solid;
    box-shadow: 0 3px 12px rgba(0,0,0,0.4);
    transition: box-shadow 0.2s;
}

.map-poi:hover .map-poi-icon {
    box-shadow: 0 4px 20px rgba(180,83,9,0.5);
}

.settlement-icon {
    background: linear-gradient(135deg, var(--emerald), #0a3d2a);
    border-color: var(--gold);
    color: var(--gold-light);
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
}

.settlement-icon.stage-0 { border-color: #666; }
.settlement-icon.stage-1 { border-color: var(--gold); }
.settlement-icon.stage-2 { border-color: var(--gold-light); box-shadow: 0 0 15px rgba(180,83,9,0.3); }
.settlement-icon.stage-3 { border-color: #ffd700; box-shadow: 0 0 20px rgba(255,215,0,0.3); }
.settlement-icon.stage-4 { border-color: #ffd700; box-shadow: 0 0 25px rgba(255,215,0,0.5), 0 0 50px rgba(255,215,0,0.2); }

.quest-icon {
    background: var(--dark-mid);
    border-color: var(--gold);
    color: var(--gold-light);
}

.quest-icon.tutorial {
    background: var(--emerald);
    border-color: var(--emerald-light);
    color: var(--gold-light);
}

.quest-icon.short_story {
    background: linear-gradient(135deg, #8B6914, #b45309);
    border-color: var(--gold-light);
    color: #fff;
}

.quest-icon.epic {
    background: linear-gradient(135deg, #8B0000, #4a0e0e);
    border-color: #c0392b;
    color: var(--gold-light);
}

.quest-icon.done {
    background: #1a4d1a;
    border-color: #4caf50;
    color: #4caf50;
}

.monument-icon {
    background: linear-gradient(135deg, #2c1a4d, #1a0a3d);
    border-color: #9b59b6;
    color: #bb86fc;
}

.monument-icon.done {
    background: linear-gradient(135deg, #4a2d7a, #2c1a4d);
    border-color: #ffd700;
    color: #ffd700;
    box-shadow: 0 0 20px rgba(255,215,0,0.4);
}

.monument-icon.locked {
    background: rgba(40,40,60,0.6);
    border-color: #555;
    color: #777;
    opacity: 0.7;
}

.monument-icon.active {
    border-color: #bb86fc;
    animation: monument-pulse 2s infinite;
}

@keyframes monument-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(187,134,252,0.3); }
    50% { box-shadow: 0 0 20px rgba(187,134,252,0.6); }
}

.task-icon {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
}

.task-icon.upkeep {
    background: linear-gradient(135deg, #1a4d3a, #0d2a1f);
    border-color: var(--emerald-light);
    color: var(--emerald-light);
}

.task-icon.upgrade {
    background: linear-gradient(135deg, #4d3a1a, #2a1f0d);
    border-color: var(--gold);
    color: var(--gold);
}

.map-poi-label {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--parchment);
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.7);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 auto;
}

.map-poi-sub {
    font-size: 0.6rem;
    color: var(--parchment-dark);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.map-poi-meters {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin-top: 3px;
}

.mini-meter {
    height: 3px;
    border-radius: 2px;
    max-width: 20px;
    min-width: 4px;
}

.mini-meter.safety { background: #3498db; }
.mini-meter.food { background: #2ecc71; }
.mini-meter.joy { background: #f39c12; }

.map-poi-progress {
    margin-top: 2px;
}

.map-progress-bar {
    width: 60px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: 0 auto 2px;
    overflow: hidden;
}

.map-progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 2px;
    transition: width 0.3s;
}

.map-progress-text {
    font-size: 0.55rem;
    color: var(--gold-light);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.map-compass {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: rgba(180,83,9,0.3);
    z-index: 1;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
    padding: 0.8rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--parchment-dark);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0;
}

.settlement-dot { background: var(--emerald); border-color: var(--gold); }
.quest-dot { background: var(--dark-mid); border-color: var(--gold); }
.monument-dot { background: #2c1a4d; border-color: #9b59b6; }
.task-dot { background: #1a4d3a; border-color: var(--emerald-light); }
.complete-dot { background: #1a4d1a; border-color: #4caf50; }

.map-controls {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 100;
}

.map-ctrl-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--dark-mid);
    border: 2px solid var(--gold);
    color: var(--gold);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.map-ctrl-btn:hover {
    background: var(--gold);
    color: var(--dark);
}

.sanctuary-container {
    text-align: center;
    padding: 2rem;
}

.sanctuary-view {
    max-width: 700px;
    margin: 2rem auto;
    padding: 3rem 2rem;
    border-radius: 12px;
    border: 2px solid var(--gold);
    position: relative;
    overflow: hidden;
}

.sanctuary-view.travelers_tent {
    background: linear-gradient(to bottom, #3a2618, #2a1a10);
}

.sanctuary-view.timber_study {
    background: linear-gradient(to bottom, #4a3525, #2d1f14);
}

.sanctuary-view.stone_library {
    background: linear-gradient(to bottom, #3d3d5c, #252540);
}

.sanctuary-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.sanctuary-view.travelers_tent .sanctuary-icon {
    color: #c4956a;
}

.sanctuary-view.timber_study .sanctuary-icon {
    color: #d4a030;
}

.sanctuary-view.stone_library .sanctuary-icon {
    color: #a0a0e0;
}

.sanctuary-name {
    font-size: 1.8rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.inventory-item {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}

.inventory-item:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 0 4px 12px rgba(180,83,9,0.3);
}

.inventory-item i {
    font-size: 2rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
    display: block;
}

.inventory-item span {
    font-size: 0.8rem;
    color: var(--parchment-dark);
}

.key-item-badge {
    display: block;
    font-size: 0.7rem !important;
    color: var(--emerald-light) !important;
    margin-top: 0.3rem;
    padding: 0.15rem 0.4rem;
    background: rgba(6,78,59,0.3);
    border-radius: 3px;
}

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

.gallery-card {
    background: linear-gradient(135deg, var(--parchment), var(--parchment-dark));
    color: var(--text-dark);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--gold);
}

.gallery-card h3 {
    color: var(--emerald);
    margin-bottom: 0.5rem;
}

.gallery-card .author {
    color: var(--gold);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.wax-seals {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.gallery-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: var(--emerald);
}

.gallery-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.gallery-actions {
    margin-top: 0.8rem;
}

.btn-like {
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Crimson Text', serif;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-like:hover, .btn-like.liked {
    background: #e74c3c;
    color: white;
}

.read-story-card {
    background: linear-gradient(135deg, var(--parchment), var(--parchment-dark));
    color: var(--text-dark);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--gold);
    margin-top: 1rem;
}

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

.read-story-stats {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--emerald);
}

.read-story-content {
    font-family: 'Crimson Text', serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-dark);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: none;
}

.read-story-footer {
    border-top: 2px solid var(--gold);
    padding-top: 1rem;
    margin-top: 2rem;
}

.share-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    background: var(--dark);
    color: var(--gold);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
}
.share-btn:hover {
    background: var(--gold);
    color: var(--dark);
}
.share-btn.twitter:hover { background: #000; color: #fff; border-color: #000; }
.share-btn.facebook:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.share-btn.reddit:hover { background: #ff4500; color: #fff; border-color: #ff4500; }
.share-btn.email:hover { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.share-btn.copy:hover { background: var(--gold); color: var(--dark); }

.gallery-share-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(180,83,9,0.15);
}

.share-toggle-btn {
    font-size: 0.8rem !important;
}

.wax-seal {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

.wax-seal.clean {
    background: var(--emerald);
}

.wax-seal.violence {
    background: var(--danger);
}

.wax-seal.explicit {
    background: #6b2fa0;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

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

.modal {
    background: var(--dark-mid);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 2rem;
    max-width: 550px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal h2 {
    color: var(--gold-light);
    margin-bottom: 1rem;
}

.modal p {
    color: var(--parchment);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-icon {
    font-size: 3rem;
    color: var(--gold-light);
    margin-bottom: 1rem;
}

.choice-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.choice-card {
    background: var(--dark);
    border: 2px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.choice-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
}

.choice-card i {
    font-size: 2rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
    display: block;
}

.choice-card h4 {
    color: var(--gold-light);
    margin-bottom: 0.3rem;
}

.choice-card p {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.campfire-bg {
    background: linear-gradient(to bottom, #1a0a00, #2d1200) !important;
    position: relative;
}

.campfire-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(ellipse at bottom center, rgba(255,107,53,0.3) 0%, transparent 70%);
    pointer-events: none;
}

.inspiration-scroll {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    max-width: 350px;
    background: var(--parchment);
    color: var(--text-dark);
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 1.5rem;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.6;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
    z-index: 50;
    animation: scrollIn 0.5s ease;
}

.inspiration-scroll.active {
    display: block;
}

@keyframes scrollIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.inspiration-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--gold);
}

.forge-form {
    max-width: 600px;
    margin: 2rem auto;
    text-align: left;
}

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

.form-group label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    background: var(--parchment);
    color: var(--text-dark);
    border: 2px solid var(--gold);
    border-radius: 4px;
}

.back-nav {
    margin-bottom: 1.5rem;
}

.back-nav .btn {
    background: rgba(255,255,255,0.08);
    color: var(--gold);
    border: 1px solid var(--gold);
}

.back-nav .btn:hover {
    background: var(--gold);
    color: var(--bg-dark);
}

.section-title {
    font-size: 1.8rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--parchment-dark);
    margin-bottom: 2rem;
}

.quest-checkpoints-list {
    margin-top: 0.8rem;
    border-top: 1px solid rgba(180,83,9,0.2);
    padding-top: 0.5rem;
}

.quest-checkpoint-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.8rem;
    color: var(--parchment-dark);
    opacity: 0.6;
}

.quest-checkpoint-item i {
    width: 16px;
    text-align: center;
    color: var(--gold);
    opacity: 0.5;
}

.quest-checkpoint-item.reached {
    opacity: 1;
    color: var(--gold-light);
}

.quest-checkpoint-item.reached i {
    opacity: 1;
    color: #4caf50;
}

.quest-goal-deadline {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--gold-light);
    padding-top: 0.5rem;
    border-top: 1px solid rgba(180,83,9,0.2);
}

.flash-messages {
    padding: 1rem;
    text-align: center;
}

.flash-messages p {
    background: rgba(180,83,9,0.2);
    border: 1px solid var(--gold);
    padding: 0.8rem;
    border-radius: 4px;
    display: inline-block;
}

.save-indicator {
    font-size: 0.8rem;
    color: var(--emerald-light);
    opacity: 0;
    transition: opacity 0.3s;
}

.save-indicator.visible {
    opacity: 1;
}

.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--dark-mid);
    border-radius: 8px;
    border: 1px solid rgba(180,83,9,0.2);
}

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

.filter-group label {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-group select {
    padding: 0.4rem 0.8rem;
    font-family: 'Crimson Text', serif;
    font-size: 0.9rem;
    background: var(--dark);
    color: var(--text-light);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 4px;
}

.stories-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.story-row {
    background: linear-gradient(135deg, var(--dark-mid), var(--dark));
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.story-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 15px rgba(180,83,9,0.15);
    border-color: var(--gold);
}

.story-row-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.story-row-icon {
    font-size: 1.3rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.story-row-info {
    flex: 1;
    min-width: 0;
}

.story-row-info h3 {
    font-size: 1.1rem;
    color: var(--gold-light);
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-row-meta {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.story-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.genre-tag {
    background: rgba(6,78,59,0.3);
    color: var(--emerald-light);
    border: 1px solid rgba(6,78,59,0.4);
}

.type-tag {
    background: rgba(180,83,9,0.2);
    color: var(--gold-light);
    border: 1px solid rgba(180,83,9,0.3);
}

.published-tag {
    background: rgba(76,175,80,0.2);
    color: #4caf50;
    border: 1px solid rgba(76,175,80,0.3);
}

.quest-tag {
    background: rgba(180,83,9,0.3);
    color: var(--gold-light);
    border: 1px solid var(--gold);
}

.rune-tag {
    border: 1px solid rgba(255,255,255,0.15);
}

.rune-tag.clean {
    background: rgba(6,78,59,0.3);
    color: var(--emerald-light);
}

.rune-tag.violence {
    background: rgba(139,26,26,0.3);
    color: #e57373;
}

.rune-tag.explicit {
    background: rgba(107,47,160,0.3);
    color: #ce93d8;
}

.story-row-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    min-width: 110px;
    flex-shrink: 0;
}

.story-word-count {
    color: var(--gold-light);
    font-size: 0.9rem;
    font-weight: 600;
}

.story-date {
    color: var(--parchment-dark);
    font-size: 0.75rem;
}

.story-row-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.story-row-preview {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    color: var(--parchment-dark);
    font-style: italic;
    line-height: 1.5;
}


.inspiration-stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.stat-box {
    background: rgba(180, 83, 9, 0.15);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: center;
    min-width: 120px;
}

.stat-box i {
    color: var(--gold);
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-box span {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gold);
    display: block;
}

.stat-box small {
    font-size: 0.8rem;
    opacity: 0.7;
}

.inspiration-pool {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding-bottom: 2rem;
}

.inspiration-card {
    background: rgba(245, 230, 202, 0.08);
    border: 1px solid rgba(180, 83, 9, 0.3);
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color 0.3s;
}

.inspiration-card:hover {
    border-color: var(--gold);
}

.inspiration-prompt {
    font-family: 'Crimson Text', serif;
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--parchment);
    margin-bottom: 0.75rem;
}

.inspiration-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.6;
}

.inspiration-footer i {
    margin-right: 0.25rem;
}

.quest-edit-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quest-edit-inline input[type="number"] {
    width: 100px;
    padding: 0.3rem 0.5rem;
    background: var(--parchment);
    color: var(--dark-bg);
    border: 2px solid var(--gold);
    border-radius: 6px;
    font-family: 'Crimson Text', serif;
    font-size: 0.95rem;
}

.quest-edit-inline button {
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
    position: relative;
}

.auth-tab {
    padding: 0.6rem 2rem;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    border: 2px solid var(--gold);
    cursor: pointer;
    transition: all 0.3s;
    background: transparent;
    color: var(--gold-light);
}

.auth-tab:first-child {
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.auth-tab:last-child {
    border-radius: 0 4px 4px 0;
}

.auth-tab.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--dark);
}

.auth-form {
    position: relative;
}

.auth-form input {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    font-family: 'Crimson Text', serif;
    background: var(--parchment);
    color: var(--text-dark);
    border: 2px solid var(--gold);
    border-radius: 4px;
    width: 300px;
}

.hero-footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    position: relative;
}

.hero-footer-links a {
    color: var(--gold-light);
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.hero-footer-links a:hover {
    opacity: 1;
}

.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(180,83,9,0.2);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gold-light);
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-copy {
    font-size: 0.8rem;
    opacity: 0.4;
    color: var(--parchment-dark);
}

.policy-page {
    max-width: 800px;
}

.policy-section {
    background: rgba(45,45,68,0.5);
    border: 1px solid rgba(180,83,9,0.2);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.policy-section h2 {
    color: var(--gold-light);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.policy-section p {
    color: var(--parchment-dark);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.policy-rule {
    background: rgba(0,0,0,0.15);
    border-left: 3px solid var(--gold);
    padding: 1rem;
    margin: 0.75rem 0;
    border-radius: 0 6px 6px 0;
}

.policy-rule h3 {
    color: var(--gold-light);
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.policy-rule p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.policy-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.policy-table th,
.policy-table td {
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(180,83,9,0.2);
    text-align: left;
    font-size: 0.9rem;
}

.policy-table th {
    background: rgba(180,83,9,0.15);
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.policy-table td {
    color: var(--parchment-dark);
}

.policy-list {
    list-style: none;
    padding: 0;
}

.policy-list li {
    padding: 0.4rem 0;
    color: var(--parchment-dark);
    font-size: 0.95rem;
}

.policy-list li i {
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
}

.policy-list li i.fa-xmark {
    color: #e74c3c;
}

.policy-list li i.fa-check {
    color: #4caf50;
}

.rune-examples {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
}

.rune-example {
    text-align: center;
}

.rune-example span {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: var(--parchment-dark);
}

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

.credits-card {
    padding: 1.5rem;
}

.credits-list {
    list-style: none;
    padding: 0;
}

.credits-list li {
    padding: 0.4rem 0;
    font-size: 0.95rem;
    color: var(--parchment-dark);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.credits-list li:last-child {
    border-bottom: none;
}

.credits-list li strong {
    color: var(--gold-light);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.report-card {
    border-left: 4px solid var(--gold);
}

.report-card.report-pending {
    border-left-color: #f39c12;
}

.report-card.report-actioned {
    border-left-color: #e74c3c;
}

.report-card.report-dismissed {
    border-left-color: #4caf50;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.report-status {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    font-weight: 700;
}

.report-status.pending {
    background: rgba(243,156,18,0.2);
    color: #f39c12;
}

.report-status.actioned {
    background: rgba(231,76,60,0.2);
    color: #e74c3c;
}

.report-status.dismissed {
    background: rgba(76,175,80,0.2);
    color: #4caf50;
}

.report-body p {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.report-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(180,83,9,0.2);
}

.settlement-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(6,78,59,0.3);
    border: 1px solid var(--gold);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.settlement-mini {
    display: flex;
    align-items: center;
}

.settlement-link {
    color: var(--gold-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    transition: color 0.3s;
}

.settlement-link:hover {
    color: var(--parchment);
}

.meters-mini {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.meter-mini {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.meter-bar-mini {
    width: 60px;
    height: 8px;
    background: var(--dark-mid);
    border-radius: 4px;
    overflow: hidden;
}

.quest-tier-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.quest-tab {
    padding: 0.6rem 1.2rem;
    background: var(--dark-mid);
    color: var(--text-light);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.quest-tab:hover {
    border-color: var(--gold);
}

.quest-tab.active {
    background: linear-gradient(135deg, var(--emerald), var(--dark));
    border-color: var(--gold);
    color: var(--gold-light);
}

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

.settlement-quest-card {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.3s, border-color 0.3s;
}

.settlement-quest-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
}

.sq-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.sq-header i {
    color: var(--gold);
    font-size: 1.3rem;
}

.sq-header h3 {
    color: var(--gold-light);
    font-size: 1.1rem;
    margin: 0;
}

.sq-tier-badge {
    background: rgba(180,83,9,0.2);
    color: var(--gold-light);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Cinzel', serif;
    margin-left: auto;
}

.sq-active-list {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sq-active {
    background: rgba(6,78,59,0.3);
    border: 1px solid var(--emerald-light);
    border-radius: 6px;
    padding: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}

.sq-scenario-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sq-scenario-info i {
    font-size: 1.3rem;
    color: var(--gold);
}

.sq-scenario-info strong {
    color: var(--parchment);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    display: block;
}

.sq-meter-tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.sq-meter-tag.safety {
    background: rgba(231,76,60,0.2);
    color: #e74c3c;
}

.sq-meter-tag.food {
    background: rgba(243,156,18,0.2);
    color: #f39c12;
}

.sq-meter-tag.joy {
    background: rgba(155,89,182,0.2);
    color: #9b59b6;
}

.sq-progress {
    font-size: 0.8rem;
    color: var(--parchment-dark);
    margin-left: 0.3rem;
}

.upgrade-path-progress {
    display: flex;
    gap: 0.4rem;
    margin: 0.5rem 0;
}

.path-pip {
    width: 2rem;
    height: 0.4rem;
    border-radius: 2px;
    background: rgba(255,255,255,0.15);
    transition: background 0.3s;
}

.path-pip.filled {
    box-shadow: 0 0 6px rgba(255,255,255,0.2);
}

.upgrade-next-quest {
    background: rgba(6,78,59,0.2);
    border: 1px solid var(--emerald-light);
    border-radius: 6px;
    padding: 0.8rem;
    margin-top: 0.6rem;
}

.next-quest-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.next-quest-info strong {
    font-family: 'Cinzel', serif;
    color: var(--parchment);
    font-size: 0.9rem;
}

.next-quest-desc {
    font-size: 0.8rem;
    color: var(--parchment-dark);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.next-quest-reward {
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: 0.6rem;
}

.next-quest-reward i {
    margin-right: 0.2rem;
}

.sq-start-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
    align-items: center;
}

.sq-select {
    flex: 1;
    padding: 0.5rem;
    background: var(--dark);
    color: var(--text-light);
    border: 1px solid var(--gold);
    border-radius: 4px;
    font-family: 'Crimson Text', serif;
}

.current-gear-preview {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
    color: var(--gold-light);
    font-size: 0.9rem;
}

.monument-picker {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.monument-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.8rem;
    background: rgba(6,78,59,0.2);
    border: 1px solid rgba(180,83,9,0.2);
    border-radius: 6px;
    transition: border-color 0.3s;
}

.monument-option:hover {
    border-color: var(--gold);
}

.monument-option i {
    color: var(--gold);
    font-size: 1.1rem;
}

.monument-option.completed {
    opacity: 0.5;
}

.badge-done {
    margin-left: auto;
    color: #4caf50;
}

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

.settlement-icon-large {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.settlement-name-form {
    margin-top: 1rem;
}

.settlement-stages-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.stage-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--parchment-dark);
}

.stage-marker.active {
    color: var(--gold-light);
}

.stage-marker.active i {
    color: var(--gold);
    font-size: 1.2rem;
}

.stage-marker.locked {
    opacity: 0.4;
}

.stage-connector {
    width: 30px;
    height: 2px;
    background: var(--dark-mid);
}

.stage-connector.filled {
    background: var(--gold);
}

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

.meter-card {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.meter-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--gold-light);
}

.meter-bar {
    width: 100%;
    height: 12px;
    background: var(--dark);
    border-radius: 6px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.meter-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.meter-fill.safety {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.meter-fill.food {
    background: linear-gradient(90deg, #d68910, #f39c12);
}

.meter-fill.joy {
    background: linear-gradient(90deg, #7d3c98, #9b59b6);
}

.meter-value {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--gold-light);
}

.meter-decay-rate {
    font-size: 0.8rem;
    color: var(--parchment-dark);
    margin-top: 0.3rem;
}

.gear-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.gear-slot {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.gear-slot-label {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.gear-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.gear-item.equipped {
    background: rgba(6,78,59,0.3);
    border: 1px solid var(--emerald-light);
    color: var(--gold-light);
}

.gear-item.empty {
    color: var(--parchment-dark);
    font-style: italic;
}

.gear-level {
    background: var(--gold);
    color: var(--dark);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Cinzel', serif;
}

.gear-inventory {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gear-inv-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.8rem;
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.2);
    border-radius: 6px;
}

.gear-inv-item.equipped {
    border-color: var(--emerald-light);
    background: rgba(6,78,59,0.2);
}

.gear-inv-item i {
    color: var(--gold);
}

.gear-type-badge {
    background: rgba(180,83,9,0.2);
    color: var(--gold-light);
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    margin-left: auto;
}

.monument-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.monument-badge {
    background: var(--dark-mid);
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.monument-badge i {
    font-size: 2rem;
    color: var(--gold);
}

.badge-title {
    font-family: 'Cinzel', serif;
    color: var(--gold-light);
    font-size: 0.85rem;
    font-style: italic;
}

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

.hero-card {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.3s, border-color 0.3s;
}

.hero-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
}

.hero-rank {
    position: absolute;
    top: 0.5rem;
    right: 0.8rem;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--gold);
    font-weight: 700;
}

.hero-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.hero-settlement-icon {
    font-size: 2rem;
    color: var(--gold);
    width: 50px;
    text-align: center;
}

.hero-header h3 {
    color: var(--gold-light);
    font-size: 1.1rem;
    margin: 0;
}

.hero-settlement-name {
    color: var(--parchment-dark);
    font-size: 0.85rem;
    margin: 0;
}

.hero-settlement-stage {
    color: var(--emerald-light);
    font-size: 0.8rem;
    margin: 0;
}

.hero-stats {
    display: flex;
    gap: 1.5rem;
    color: var(--parchment-dark);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.hero-gear {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.hero-gear-item {
    background: rgba(180,83,9,0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    color: var(--gold-light);
    font-size: 0.8rem;
}

.hero-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hero-badge {
    background: rgba(180,83,9,0.3);
    border: 1px solid var(--gold);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 0.8rem;
}

.streak-badge {
    background: linear-gradient(135deg, #ff6b35, #e25822);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    animation: streak-glow 2s ease-in-out infinite alternate;
}

@keyframes streak-glow {
    from { box-shadow: 0 0 5px rgba(255,107,53,0.3); }
    to { box-shadow: 0 0 12px rgba(255,107,53,0.6); }
}

.streak-badge.streak-activity {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.streak-badge.streak-quest {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.streak-badge-small {
    color: #ff6b35;
    font-size: 0.8rem;
    font-weight: 600;
}

.streak-badge-small.streak-activity {
    color: #3b82f6;
}

.streak-badge-small.streak-quest {
    color: #a855f7;
}

.hero-streaks {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.4rem 0;
}

.hero-streak-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.hero-streak-item.writing {
    background: rgba(255,107,53,0.15);
    border: 1px solid rgba(255,107,53,0.3);
    color: #ff6b35;
}

.hero-streak-item.activity {
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    color: #3b82f6;
}

.hero-streak-item.quest {
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    color: #a855f7;
}

.hero-streak-item i {
    font-size: 1rem;
}

.hero-streak-detail {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}

.hero-streak-count {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.hero-streak-label {
    font-size: 0.7rem;
    opacity: 0.8;
}

.hero-streak-best {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-left: 0.2rem;
}

.theme-toggle {
    background: none;
    border: 1px solid rgba(180,83,9,0.4);
    color: var(--gold-light);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}
.theme-toggle:hover {
    background: rgba(180,83,9,0.2);
    border-color: var(--gold);
}

#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast-notification {
    background: linear-gradient(135deg, var(--dark-mid), var(--dark));
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    color: var(--parchment);
    font-family: 'Crimson Text', serif;
    font-size: 0.95rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    pointer-events: auto;
    max-width: 350px;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification i {
    color: var(--gold-light);
    margin-right: 0.3rem;
}

.celebration-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.celebration-overlay.active {
    opacity: 1;
}

.celebration-content {
    text-align: center;
    animation: celebration-enter 0.6s ease;
}

@keyframes celebration-enter {
    from { transform: scale(0.5) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.celebration-icon {
    font-size: 4rem;
    color: var(--gold-light);
    margin-bottom: 1rem;
    animation: celebration-pulse 1s ease-in-out infinite alternate;
}

@keyframes celebration-pulse {
    from { transform: scale(1); filter: drop-shadow(0 0 10px rgba(180,83,9,0.5)); }
    to { transform: scale(1.1); filter: drop-shadow(0 0 25px rgba(212,160,48,0.8)); }
}

.celebration-title {
    font-family: 'Cinzel', serif;
    color: var(--gold-light);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.celebration-desc {
    color: var(--parchment);
    font-family: 'Crimson Text', serif;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #d4a030);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(180,83,9,0.5);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.stat-card i {
    font-size: 1.5rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
    display: block;
}

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

.stat-label {
    font-size: 0.8rem;
    color: var(--parchment-dark);
    margin-top: 0.3rem;
}

.stats-record {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 2rem;
}

.stats-record h3 {
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.stats-record p {
    color: var(--parchment);
}

.stats-chart-container {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.2);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.stats-chart-container h3 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-breakdown {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.2);
    border-radius: 10px;
    padding: 1.5rem;
}

.stats-breakdown h3 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.achievements-section {
    margin-top: 2rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.achievement-card {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.2);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.2s;
    position: relative;
}

.achievement-card.earned {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--dark-mid), rgba(180,83,9,0.1));
}

.achievement-card.locked {
    opacity: 0.5;
}

.achievement-card.locked .achievement-icon i {
    color: var(--parchment-dark);
}

.achievement-icon {
    font-size: 1.5rem;
    width: 2.5rem;
    text-align: center;
    flex-shrink: 0;
}

.achievement-icon i {
    color: var(--gold-light);
}

.achievement-info h4 {
    color: var(--gold);
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.achievement-info p {
    color: var(--parchment-dark);
    font-size: 0.8rem;
}

.achievement-lock {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--parchment-dark);
    font-size: 0.7rem;
}

.hero-achievements {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.hero-ach-badge {
    background: rgba(180,83,9,0.2);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 4px;
    padding: 0.2rem 0.35rem;
    font-size: 0.75rem;
    color: var(--gold-light);
    cursor: default;
}

.hero-ach-more {
    background: rgba(180,83,9,0.15);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    color: var(--parchment-dark);
}

.comments-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.2);
    border-radius: 10px;
}

.comments-section h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

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

.comment-form textarea {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 6px;
    padding: 0.8rem;
    color: var(--parchment);
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.comment-char-count {
    font-size: 0.8rem;
    color: var(--parchment-dark);
}

.comment-card {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.comment-card:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.comment-body {
    color: var(--parchment);
    font-size: 0.95rem;
    line-height: 1.5;
}

.comment-new {
    animation: comment-fade-in 0.5s ease;
}

@keyframes comment-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

[data-theme="light"] {
    --emerald: #0f7a5f;
    --emerald-light: #10b981;
    --gold: #92400e;
    --gold-light: #b45309;
    --parchment: #fef9f0;
    --parchment-dark: #8b7355;
    --dark: #faf5eb;
    --dark-mid: #f0e8d8;
    --text-light: #2c1810;
    --text-dark: #1a0f08;
    --danger: #dc2626;
}

[data-theme="light"] body {
    background: #faf5eb;
    color: #2c1810;
}

[data-theme="light"] .navbar {
    background: linear-gradient(135deg, #0f7a5f, #064e3b);
}

[data-theme="light"] .read-story-content {
    color: #2c1810;
}

[data-theme="light"] .comment-form textarea {
    background: white;
    border-color: #d4c5a9;
    color: #2c1810;
}

[data-theme="light"] .toast-notification {
    background: white;
    border-color: #b45309;
    color: #2c1810;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}


.gem-badge {
    margin-left: 0.3rem;
    font-size: 0.7em;
    vertical-align: middle;
    filter: drop-shadow(0 0 3px currentColor);
}

.monument-option-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.monument-option-left div {
    display: flex;
    flex-direction: column;
}

.monument-gem-reward {
    font-size: 0.75rem;
    font-weight: 600;
}

.monument-option.locked-monument {
    opacity: 0.45;
    pointer-events: none;
}

.badge-locked {
    color: var(--parchment-dark);
    font-size: 0.9rem;
}

.badge-locked i {
    opacity: 0.5;
}

.story-paragraph {
    text-indent: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.8;
}
.story-paragraph:first-child {
    text-indent: 0;
}
.story-spacer {
    height: 1.5em;
}
.story-chapter-heading {
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    text-align: center;
    margin: 2rem 0 1.5rem;
    font-size: 1.4rem;
    border-bottom: 1px solid rgba(180,83,9,0.3);
    padding-bottom: 0.5rem;
}
.reader-chapter-nav {
    background: var(--dark-mid);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}
.reader-chapter-nav h3 {
    color: var(--gold-light);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}
.reader-chapter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.chapter-link {
    color: var(--gold);
    cursor: pointer;
    padding: 0.3rem 0.8rem;
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background 0.2s;
    text-decoration: none;
}
.chapter-link:hover {
    background: rgba(180,83,9,0.15);
}

.dashboard-map-viewport {
    position: relative;
    max-width: 100%;
    margin: 1rem auto;
    border-radius: 12px;
    border: 3px solid var(--gold);
    overflow: hidden;
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
    cursor: grab;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(6,78,59,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(180,83,9,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6,78,59,0.08) 0%, transparent 70%),
        linear-gradient(180deg, #0a1a14 0%, #0d2218 30%, #112b1e 60%, #0e2419 100%);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.dashboard-map-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 100;
}

@media (max-width: 1024px) {
    .editor-container {
        grid-template-columns: 1fr 250px;
    }
    .chapter-nav {
        display: none;
    }
    .navbar {
        padding: 0.8rem 1rem;
    }
    .nav-links {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    .navbar {
        flex-wrap: wrap;
        padding: 0.6rem 1rem;
        gap: 0.5rem;
    }
    .hamburger-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        order: 3;
        background: rgba(0,0,0,0.2);
        border-radius: 8px;
        padding: 0.5rem 0;
    }
    .nav-links.nav-open {
        display: flex;
    }
    .nav-links a {
        padding: 0.6rem 1rem;
        border-bottom: 1px solid rgba(180,83,9,0.1);
    }
    .nav-links a:last-child {
        border-bottom: none;
    }
    .nav-stats {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 4;
        gap: 0.5rem;
        align-items: flex-start;
        padding: 0.5rem 1rem;
        background: rgba(0,0,0,0.15);
        border-radius: 8px;
    }
    .nav-stats.nav-open {
        display: flex;
    }
    .hero {
        padding: 3rem 1rem;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .login-form {
        flex-direction: column;
        align-items: center;
    }
    .login-form input {
        width: 100%;
    }
    .auth-form input {
        width: 100%;
    }
    .section-title {
        font-size: 1.4rem;
    }
    .quest-grid {
        grid-template-columns: 1fr;
    }
    .settlement-quest-grid {
        grid-template-columns: 1fr;
    }
    .card {
        padding: 1rem;
    }
    .editor-container {
        grid-template-columns: 1fr;
    }
    .chapter-nav {
        max-height: 200px;
        position: static;
    }
    .editor-sidebar {
        display: none;
    }
    .editor-sidebar.sidebar-open {
        display: flex;
    }
    #quill-editor {
        padding: 1rem;
        min-height: 300px;
    }
    .editor-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .map-viewport {
        height: 50vh;
        min-height: 300px;
    }
    .dashboard-map-viewport {
        height: 50vh;
        min-height: 300px;
    }
    .map-controls {
        bottom: 1rem;
        right: 1rem;
    }
    .map-poi-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-width: 2px;
    }
    .settlement-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    .map-poi-label {
        font-size: 0.6rem;
        max-width: 90px;
    }
    .map-poi-sub {
        font-size: 0.5rem;
    }
    .task-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    .inspiration-scroll {
        max-width: 90%;
        right: 5%;
    }
    .read-story-card {
        padding: 1rem;
    }
    .modal {
        width: 95%;
        max-height: 85vh;
        padding: 1.5rem;
    }
    .choice-cards {
        grid-template-columns: 1fr;
    }
    .celebration-title {
        font-size: 1.5rem;
    }
    .celebration-icon {
        font-size: 3rem;
    }
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-row {
        grid-template-columns: 1fr;
    }
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    .heroes-grid {
        grid-template-columns: 1fr;
    }
    .settlement-summary {
        flex-direction: column;
        gap: 0.5rem;
    }
    .meters-mini {
        width: 100%;
        justify-content: center;
    }
    .meter-bar-mini {
        width: 40px;
    }
    .quest-tier-tabs {
        flex-wrap: wrap;
    }
    .quest-tab {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    .settlement-stages-track {
        flex-direction: column;
    }
    .stage-connector {
        width: 2px;
        height: 20px;
    }
    .meters-grid {
        grid-template-columns: 1fr;
    }
    .gear-slots {
        grid-template-columns: 1fr;
    }
    .forge-form {
        margin: 1rem auto;
        padding: 0;
    }
    .story-row-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .story-row-icon {
        display: none;
    }
    .story-row-info {
        width: 100%;
    }
    .story-row-info h3 {
        white-space: normal;
        font-size: 1rem;
    }
    .story-row-stats {
        flex-direction: row;
        align-items: center;
        gap: 0.6rem;
        min-width: auto;
        width: 100%;
    }
    .story-row-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .story-row-actions .btn {
        width: 100%;
        text-align: center;
    }
    .filter-bar {
        flex-direction: column;
    }
    .container > div:first-child {
        flex-direction: column;
        gap: 0.8rem;
        align-items: flex-start;
    }
    #toast-container {
        right: 10px;
        left: 10px;
    }
    .toast-notification {
        max-width: 100%;
    }
    .sq-start-form {
        flex-wrap: wrap;
    }
    .gallery-card {
        width: 100%;
    }
    .map-legend {
        gap: 0.5rem;
        font-size: 0.75rem;
    }
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1rem;
    }
    .footer-links a {
        font-size: 0.8rem;
    }
    .alpha-banner {
        font-size: 0.78rem;
        padding: 0.5rem 0.8rem;
    }
    .valley-elder-badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.35rem;
    }
    .policy-page {
        padding: 1rem;
    }
    .policy-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .hero-footer-links {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    .hero-footer-links a {
        font-size: 0.8rem;
    }
    .gallery-share-row {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .comment-header {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    .admin-action-btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    .scribe-profile-top {
        flex-direction: column;
        text-align: center;
    }
    .scribe-streaks {
        justify-content: center;
    }
    .form-group input[type="text"],
    .form-group input[type="email"] {
        font-size: 16px;
    }
    .read-story-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.4rem;
    }
    .quest-tab {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
    .btn {
        font-size: 0.8rem;
    }
    .section-title {
        font-size: 1.2rem;
    }
    .celebration-title {
        font-size: 1.3rem;
    }
    .celebration-icon {
        font-size: 2.5rem;
    }
    .map-viewport {
        min-height: 250px;
    }
    .dashboard-map-viewport {
        min-height: 250px;
    }
    .map-poi-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .settlement-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
    .map-poi-label {
        font-size: 0.55rem;
        max-width: 70px;
    }
    .map-region-label {
        font-size: 0.6rem;
        letter-spacing: 1px;
    }
    .stat-value {
        font-size: 1.2rem;
    }
    .stat-card {
        padding: 0.8rem;
    }
}

.author-link {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s;
}
.author-link:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

.scribe-profile-header {
    padding: 1.5rem;
}
.scribe-profile-top {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.scribe-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(180,83,9,0.15);
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.scribe-profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.scribe-detail-section h3 {
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.scribe-settlement-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.settlement-stage-badge {
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
}
.scribe-gear-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.gear-badge {
    background: rgba(180,83,9,0.1);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    color: var(--parchment);
}
.scribe-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.monument-badge-display {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(180,83,9,0.1);
    border: 1px solid rgba(180,83,9,0.3);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    color: var(--parchment);
}
.scribe-achievements-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.achievement-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(180,83,9,0.15);
    border: 1px solid rgba(180,83,9,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-light);
    font-size: 0.75rem;
    cursor: default;
}
.streak-badge {
    font-size: 0.85rem;
    color: var(--parchment);
}

.folder-card {
    border-left: 3px solid var(--gold);
}
.folder-stories-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.folder-story-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    color: var(--gold-light);
    text-decoration: none;
    transition: background 0.2s;
}
.folder-story-link:hover {
    background: rgba(180,83,9,0.15);
}

.folder-section {
    margin-bottom: 2rem;
}
.folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: rgba(180,83,9,0.08);
    border: 1px solid rgba(180,83,9,0.2);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: background 0.2s;
}
.folder-header:hover {
    background: rgba(180,83,9,0.15);
}
.folder-header h3 {
    margin: 0;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 1rem;
}
.folder-body {
    border: 1px solid rgba(180,83,9,0.2);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0.5rem;
}
.folder-actions {
    display: flex;
    gap: 0.5rem;
}
.folder-manage-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.folder-manage-bar input {
    flex: 1;
    min-width: 150px;
}

.notification-bell {
    position: relative;
    color: var(--parchment);
    font-size: 1.1rem;
    text-decoration: none;
    padding: 0.2rem 0.4rem;
    transition: color 0.2s;
}
.notification-bell:hover {
    color: var(--gold-light);
}
.notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #e74c3c;
    color: white;
    font-size: 0.6rem;
    font-family: 'Crimson Text', serif;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    font-weight: 600;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: var(--card-bg, rgba(0,0,0,0.2));
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: background 0.2s;
}
.notification-item.unread {
    border-left-color: var(--gold);
    background: rgba(180,83,9,0.08);
}
.notification-icon {
    font-size: 1.2rem;
    padding-top: 0.1rem;
    flex-shrink: 0;
}
.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.notification-message {
    color: var(--parchment);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.4;
}
a.notification-message:hover {
    color: var(--gold-light);
}
.notification-time {
    font-size: 0.8rem;
    color: var(--parchment-dark);
}

.follow-stat {
    font-size: 0.85rem;
    color: var(--parchment-dark);
}
.follow-stat i {
    margin-right: 0.2rem;
}

.serial-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(139,92,246,0.08);
    border-radius: 6px;
    border: 1px solid rgba(139,92,246,0.2);
    margin-top: 0.3rem;
}
.serial-badge {
    font-size: 0.75rem;
    background: rgba(139,92,246,0.2);
    color: #a78bfa;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.chapter-count {
    font-size: 0.8rem;
    color: var(--parchment-dark);
}

.editor-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gold-dark);
    background: var(--surface-dark);
    padding: 0 0.5rem;
}
.editor-tab {
    padding: 0.6rem 1.2rem;
    background: none;
    border: none;
    color: var(--parchment-dark);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.editor-tab:hover {
    color: var(--gold-light);
    background: rgba(180,83,9,0.05);
}
.editor-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: rgba(180,83,9,0.08);
}

.find-replace-bar {
    background: var(--surface-dark);
    border-bottom: 1px solid var(--gold-dark);
    padding: 0.4rem 0.8rem;
    animation: slideDown 0.2s ease;
}
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.find-replace-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.2rem 0;
}
.find-input {
    flex: 1;
    padding: 0.35rem 0.6rem;
    font-family: 'Crimson Text', serif;
    font-size: 0.9rem;
    background: var(--parchment);
    color: var(--text-dark);
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
}
.find-input:focus {
    border-color: var(--gold);
    outline: none;
}
.find-count {
    font-size: 0.8rem;
    color: var(--parchment-dark);
    min-width: 3rem;
    text-align: center;
}
.btn-outline {
    background: none;
    border: 1px solid var(--gold-dark);
    color: var(--parchment);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Crimson Text', serif;
    transition: all 0.2s;
}
.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(180,83,9,0.1);
}

body.focus-mode .navbar,
body.focus-mode .toast-container {
    display: none !important;
}
.editor-container.focus-mode .chapter-nav,
.editor-container.focus-mode .editor-sidebar,
.editor-container.focus-mode .editor-toolbar,
.editor-container.focus-mode .editor-tabs,
.editor-container.focus-mode .find-replace-bar,
.editor-container.focus-mode .paste-warning {
    display: none !important;
}
.editor-container.focus-mode .editor-main {
    width: 100%;
    max-width: 100%;
}
.editor-container.focus-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--bg-dark);
    display: flex;
}
.editor-container.focus-mode #quill-editor {
    height: 100vh;
    border: none;
    border-radius: 0;
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-dark);
    font-size: 1.2rem;
    line-height: 2;
    padding: 2rem 3rem;
}
.focus-exit-hint {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: var(--parchment-dark);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 10000;
    transition: opacity 1s ease;
    pointer-events: none;
}
.focus-exit-hint kbd {
    background: rgba(255,255,255,0.15);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.8rem;
}

.sidebar-panel {
    background: var(--surface-dark);
    border: 1px solid rgba(180,83,9,0.2);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.6rem;
}
.sidebar-panel h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--gold);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.sprint-timer {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--gold-light);
    text-align: center;
    font-weight: 700;
}
.sprint-words {
    font-size: 0.85rem;
    color: var(--emerald-light);
    text-align: center;
}
.sprint-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}
.btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Crimson Text', serif;
}
.btn-danger:hover {
    background: #b91c1c;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.15rem 0;
    font-size: 0.85rem;
}
.stat-label {
    color: var(--parchment-dark);
}
.stat-value {
    color: var(--parchment);
    font-weight: 600;
}

.quest-goal-panel .quest-goal-name {
    font-size: 0.85rem;
    color: var(--parchment);
    text-align: center;
    margin-bottom: 0.3rem;
}
.quest-goal-panel .quest-goal-progress {
    text-align: center;
    margin-bottom: 0.3rem;
}
.quest-goal-panel .quest-goal-numbers {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--gold-light);
}
.quest-goal-panel .quest-goal-divider {
    margin: 0 0.3rem;
    color: var(--parchment-dark);
}
.quest-goal-panel .quest-goal-label {
    font-size: 0.75rem;
    color: var(--parchment-dark);
    display: block;
}
.quest-goal-panel .quest-goal-pct {
    text-align: center;
    font-size: 0.8rem;
    color: var(--emerald-light);
}

.goal-section {
    margin-bottom: 0.6rem;
}
.goal-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--parchment-dark);
    margin-bottom: 0.1rem;
}
.goal-input {
    width: 60px;
    padding: 0.15rem 0.3rem;
    font-size: 0.75rem;
    font-family: 'Crimson Text', serif;
    background: var(--parchment);
    color: var(--text-dark);
    border: 1px solid var(--gold-dark);
    border-radius: 3px;
    text-align: right;
}
.goal-input:focus {
    border-color: var(--gold);
    outline: none;
}
.goal-pct {
    font-size: 0.75rem;
    color: var(--emerald-light);
    text-align: right;
}
.goal-fill {
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)) !important;
}
.session-fill {
    background: linear-gradient(90deg, var(--emerald-dark), var(--emerald-light)) !important;
}

.xp-display {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--gold-light);
    font-weight: 700;
}

.notes-container {
    padding: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}
.notes-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.notes-subtab {
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--gold-dark);
    color: var(--parchment-dark);
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.notes-subtab:hover {
    border-color: var(--gold);
    color: var(--gold);
}
.notes-subtab.active {
    background: rgba(180,83,9,0.15);
    border-color: var(--gold);
    color: var(--gold);
}
.notes-textarea {
    width: 100%;
    min-height: 400px;
    padding: 1.2rem;
    font-family: 'Crimson Text', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    background: var(--parchment);
    color: var(--text-dark);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
}
.notes-textarea:focus {
    border-color: var(--gold);
    outline: none;
}
.notes-save-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}
.notes-save-indicator {
    font-size: 0.85rem;
    font-family: 'Crimson Text', serif;
}

.publishing-container {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}
.publishing-intro {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(180,83,9,0.05);
    border: 1px solid rgba(180,83,9,0.15);
    border-radius: 8px;
}
.publishing-intro h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    margin: 0 0 0.5rem 0;
}
.publishing-intro p {
    color: var(--parchment-dark);
    font-size: 0.9rem;
    margin: 0;
}
.publishing-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.pub-subtab {
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--gold-dark);
    color: var(--parchment-dark);
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.pub-subtab:hover {
    border-color: var(--gold);
    color: var(--gold);
}
.pub-subtab.active {
    background: rgba(180,83,9,0.15);
    border-color: var(--gold);
    color: var(--gold);
}
.pub-help-card {
    background: rgba(6,78,59,0.1);
    border: 1px solid rgba(6,78,59,0.25);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--parchment);
    line-height: 1.6;
}
.pub-textarea {
    width: 100%;
    min-height: 350px;
    padding: 1.2rem;
    font-family: 'Crimson Text', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    background: var(--parchment);
    color: var(--text-dark);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
}
.pub-textarea:focus {
    border-color: var(--gold);
    outline: none;
}
.pub-save-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}
.pub-save-indicator {
    font-size: 0.85rem;
    font-family: 'Crimson Text', serif;
}

.storyboard-toolbar {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.5rem;
}
.storyboard-canvas-wrapper {
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    background: rgba(0,0,0,0.15);
    min-height: 400px;
    overflow: auto;
    position: relative;
}
.storyboard-canvas {
    position: relative;
    min-height: 400px;
    min-width: 100%;
}
.storyboard-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.sb-node {
    position: absolute;
    background: var(--surface-dark);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    min-width: 120px;
    max-width: 200px;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.2s;
    z-index: 1;
}
.sb-node:hover {
    box-shadow: 0 2px 12px rgba(180,83,9,0.3);
}
.sb-node.sb-connecting {
    box-shadow: 0 0 0 3px var(--gold);
}
.sb-node-header {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}
.sb-node-del {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--parchment-dark);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 0.2rem;
}
.sb-node-del:hover {
    color: #ef4444;
}
.sb-node-label {
    font-family: 'Crimson Text', serif;
    font-size: 0.9rem;
    color: var(--parchment);
    word-wrap: break-word;
}

[data-theme="light"] .notes-textarea,
[data-theme="light"] .pub-textarea,
[data-theme="light"] .find-input,
[data-theme="light"] .goal-input {
    background: #fff;
    border-color: #d4a574;
}
[data-theme="light"] .sidebar-panel {
    background: rgba(245,230,202,0.6);
    border-color: rgba(180,83,9,0.15);
}
[data-theme="light"] .editor-tab {
    color: var(--text-dark);
}
[data-theme="light"] .editor-tab.active {
    background: rgba(180,83,9,0.06);
}
[data-theme="light"] .find-replace-bar {
    background: rgba(245,230,202,0.9);
}
[data-theme="light"] .btn-outline {
    color: var(--text-dark);
    border-color: #c9a96e;
}
[data-theme="light"] .pub-help-card {
    background: rgba(6,78,59,0.05);
}
[data-theme="light"] .sb-node {
    background: rgba(245,230,202,0.9);
}
[data-theme="light"] .storyboard-canvas-wrapper {
    background: rgba(245,230,202,0.3);
}

.pub-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: rgba(220,38,38,0.08);
    border: 1px solid rgba(220,38,38,0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--parchment);
    line-height: 1.6;
}
.pub-disclaimer > i {
    color: #f59e0b;
    font-size: 1.2rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}
[data-theme="light"] .pub-disclaimer {
    background: rgba(220,38,38,0.05);
    color: var(--text-dark);
}

.quest-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    font-family: 'Crimson Text', serif;
}
.quest-widget-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald), var(--emerald-light));
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: transform 0.2s;
    position: relative;
    margin-left: auto;
}
.quest-widget-toggle:hover { transform: scale(1.1); }
.quest-widget-mini-progress {
    position: absolute;
    bottom: -3px;
    left: 4px;
    right: 4px;
    height: 3px;
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
    overflow: hidden;
}
.quest-widget-mini-fill {
    height: 100%;
    background: var(--gold-light);
    border-radius: 2px;
    transition: width 0.5s ease;
    display: block;
}
.quest-widget-body {
    display: none;
    background: var(--dark-mid);
    border: 1px solid var(--emerald);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.quest-widget-body h4 {
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}
.quest-widget.expanded .quest-widget-body { display: block; }
.quest-widget-stats {
    font-size: 0.85rem;
    color: var(--parchment-dark);
}
.quest-widget-claim {
    width: 100%;
    margin-top: 0.5rem;
    animation: pulse-glow 1.5s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(212,160,48,0.3); }
    50% { box-shadow: 0 0 20px rgba(212,160,48,0.6); }
}
.quest-widget-remaining {
    font-size: 0.8rem;
    color: var(--parchment-dark);
    font-style: italic;
    margin-top: 0.3rem;
}

.editor-weekly-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: var(--dark-mid);
    border-top: 1px solid var(--emerald);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.75rem;
    color: var(--parchment-dark);
    z-index: 999;
    gap: 0.5rem;
}
.editor-weekly-progress {
    flex: 1;
    max-width: 200px;
    height: 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
    overflow: hidden;
}
.editor-weekly-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald), var(--gold));
    border-radius: 3px;
    transition: width 0.5s ease;
    display: block;
}

.weekly-challenge-card {
    background: linear-gradient(135deg, rgba(6,78,59,0.15), rgba(180,83,9,0.1));
    border: 1px solid var(--emerald);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}
.weekly-challenge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.weekly-challenge-header h3 {
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 1rem;
}
.weekly-challenge-desc {
    color: var(--parchment-dark);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 0.8rem;
}

.meter-narrative {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.4;
}

.milestone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.milestone-card {
    background: var(--dark-mid);
    border: 1px solid rgba(100,100,100,0.3);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.milestone-card.unlocked {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(180,83,9,0.1), rgba(6,78,59,0.1));
}
.milestone-card.locked {
    opacity: 0.5;
    filter: grayscale(0.5);
}
.milestone-card.unlocked:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212,160,48,0.2);
}
.milestone-icon {
    font-size: 2rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}
.milestone-card h4 {
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}
.milestone-card p {
    color: var(--parchment-dark);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}
.milestone-req {
    font-size: 0.75rem;
    color: var(--emerald-light);
}
.milestone-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--dark);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-top: 0.3rem;
    font-weight: 600;
}

[data-theme="light"] .quest-widget-body {
    background: #f5f0e8;
    border-color: var(--emerald);
}
[data-theme="light"] .editor-weekly-bar {
    background: #e8e0d0;
    border-top-color: var(--emerald);
    color: var(--text-dark);
}
[data-theme="light"] .weekly-challenge-card {
    background: linear-gradient(135deg, rgba(6,78,59,0.08), rgba(180,83,9,0.05));
}
[data-theme="light"] .milestone-card {
    background: #f5f0e8;
}
[data-theme="light"] .milestone-card.unlocked {
    background: linear-gradient(135deg, rgba(180,83,9,0.05), rgba(6,78,59,0.05));
}

@media (max-width: 768px) {
    .quest-widget { bottom: 2.5rem; right: 0.5rem; }
    .quest-widget-body { min-width: 180px; }
    .milestone-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

.alpha-banner {
    background: linear-gradient(135deg, rgba(180,83,9,0.15), rgba(6,78,59,0.1));
    border: 1px solid rgba(180,83,9,0.3);
    color: var(--parchment-dark);
    padding: 0.6rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    font-family: 'Crimson Text', serif;
    border-radius: 4px;
    margin-bottom: 0.8rem;
}
.alpha-banner i {
    color: var(--gold);
    margin-right: 0.3rem;
}
.alpha-banner strong {
    color: var(--gold-light);
}

.valley-elder-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #064e3b, #0d7a5f);
    color: #f5e6ca;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    border: 1px solid rgba(180,83,9,0.4);
    vertical-align: middle;
    margin-left: 0.3rem;
}
.valley-elder-badge i {
    color: #b45309;
    font-size: 0.65rem;
}

.admin-action-btn {
    background: rgba(220,38,38,0.1);
    color: #dc2626;
    border: 1px solid rgba(220,38,38,0.3);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: 'Crimson Text', serif;
    transition: all 0.2s;
}
.admin-action-btn:hover {
    background: rgba(220,38,38,0.2);
    border-color: rgba(220,38,38,0.5);
}

.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}
.form-group input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--parchment);
    color: #2c1810;
    border: 2px solid var(--gold);
    border-radius: 4px;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
}
