:root {
    --bg-dark: #050608;
    --bg-panel: #0a0c11;
    --bg-panel-light: #12151c;
    --accent-gold: #c29d5b;
    --accent-gold-dark: #8a6f3e;
    --text-main: #e2e4e9;
    --text-muted: #8b92a5;
    --border-color: #2a2e3d;
    --danger: #c92a2a;
    
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100%;
    height: 100%;
    max-width: 1920px;
    position: relative;
}

/* MAIN MENU LAYOUT */
#main-menu {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: 1fr 180px;
    height: 100%;
    width: 100%;
    padding: 20px;
    gap: 20px;
}

/* SIDEBAR */
.sidebar {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 60px;
    padding-left: 20px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-gold);
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--accent-gold);
    letter-spacing: 1px;
    font-weight: 600;
}

.logo-text p {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: transparent;
    border: 1px solid transparent;
    padding: 15px 20px;
    text-align: left;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.nav-item i {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.nav-text {
    display: flex;
    flex-direction: column;
}

.nav-title {
    font-family: var(--font-heading);
    font-size: 16px;
    letter-spacing: 1px;
}

.nav-desc {
    font-size: 12px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    background: linear-gradient(90deg, rgba(194, 157, 91, 0.05) 0%, transparent 100%);
    border: 1px solid var(--accent-gold-dark);
}

.nav-item:hover i, .nav-item.active i {
    color: var(--accent-gold);
}

.nav-item:hover .nav-title, .nav-item.active .nav-title {
    color: var(--accent-gold);
}

.version {
    padding-left: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

/* MAIN CONTENT */
.main-content {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 800px;
}

.section-header .line {
    flex-grow: 1;
    height: 1px;
    background: var(--border-color);
}

.header-icon {
    width: 12px;
    height: 12px;
    color: var(--accent-gold-dark);
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    letter-spacing: 2px;
    color: var(--text-main);
    font-weight: 400;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 50px;
}

/* CARDS */
.universe-cards {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1100px;
    justify-content: center;
    flex-grow: 1;
    max-height: 600px;
}

.card {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: flex-end;
    text-align: center;
    background-size: cover;
    background-position: center;
}

.card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(194, 157, 91, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 5px; right: 5px; bottom: 5px; left: 5px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    pointer-events: none;
    transition: border-color 0.4s ease;
}

.card:hover::before {
    border-color: rgba(194, 157, 91, 0.3);
}

.card-content {
    padding: 40px 20px;
    width: 100%;
    z-index: 2;
    background: linear-gradient(to top, rgba(5,6,8,1) 0%, rgba(5,6,8,0.8) 50%, transparent 100%);
}

.card-content h3 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.card-content .subtitle {
    font-size: 14px;
    letter-spacing: 4px;
}

.card-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
}

.card-divider::before, .card-divider::after {
    content: '';
    height: 1px;
    width: 40px;
    background: var(--accent-gold-dark);
}

.card-divider i {
    margin: 0 10px;
    color: var(--accent-gold);
    width: 16px;
    height: 16px;
}

.card-content p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

.card-icon-large {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 1px solid var(--accent-gold-dark);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.4s ease;
}

.card-icon-large i {
    width: 20px;
    height: 20px;
    color: var(--accent-gold);
}

.card:hover .card-icon-large {
    background-color: rgba(194, 157, 91, 0.1);
    transform: scale(1.1);
}

/* BOTTOM BAR */
.bottom-bar {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    display: flex;
    gap: 20px;
}

.save-slots-container {
    flex: 3;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
}

.save-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 14px;
    letter-spacing: 1px;
}

.save-header i {
    width: 16px;
    height: 16px;
}

.save-slots {
    display: flex;
    gap: 15px;
    flex-grow: 1;
}

.save-slot {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 15px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
}

.save-slot:hover {
    border-color: var(--accent-gold-dark);
    background: rgba(255,255,255,0.02);
}

.save-slot.occupied .slot-image {
    width: 60px;
    height: 60px;
    background: url('In Game Interface.png') center/cover;
    border-radius: 4px;
}

.save-slot.empty {
    justify-content: center;
    flex-direction: column;
    text-align: center;
    gap: 10px;
}

.save-slot.empty i {
    width: 32px;
    height: 32px;
    color: var(--border-color);
}

.slot-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slot-info h4 {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 400;
}

.slot-details, .save-slot.empty span {
    color: var(--text-muted);
    font-size: 12px;
}

.slot-date {
    color: #555;
    font-size: 11px;
    margin-top: 5px;
}

.quick-settings {
    flex: 1;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.setting-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    padding: 10px;
    transition: all 0.3s ease;
}

.setting-btn i {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.setting-btn:hover {
    background: rgba(255,255,255,0.03);
    border-color: var(--border-color);
}


/* GAME VIEW LAYOUT */
#game-view {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    height: 100%;
    width: 100%;
    gap: 0;
}

/* Scrollable Sidebars */
.scrollable-sidebar {
    overflow-y: auto;
    padding: 20px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
}

.scrollable-sidebar::-webkit-scrollbar {
    width: 6px;
}

.scrollable-sidebar::-webkit-scrollbar-thumb {
    background-color: #2a2e3d;
    border-radius: 10px;
}

.right-sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.sidebar-section {
    margin-bottom: 30px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.section-title-divider {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-divider::before {
    content: '';
    height: 1px;
    flex-grow: 1;
    background: var(--border-color);
}

.section-title-divider::after {
    content: '';
    height: 1px;
    flex-grow: 5;
    background: var(--border-color);
}

/* Nav Small */
.game-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item-small {
    background: transparent;
    border: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.nav-item-small i {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.nav-item-small:hover {
    background: rgba(255,255,255,0.03);
}

.nav-item-small:hover i {
    color: var(--accent-gold);
}

/* Character Info */
.character-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.char-portrait {
    width: 80px;
    height: 100px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.char-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 13px;
}

.char-row {
    display: flex;
    gap: 10px;
}

.char-row .label {
    color: var(--text-muted);
    width: 40px;
}

.char-row .val {
    color: var(--text-main);
}

/* Status Bars */
.status-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bar-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.bar-track {
    width: 100%;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
}

.health-fill {
    background: linear-gradient(90deg, #8b2222, var(--danger));
}

.sanity-fill {
    background: linear-gradient(90deg, #4b367c, #7b58cc);
}

/* Stats & Skills */
.stats-list, .skills-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 5px 0;
}

.stats-list li span:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.stats-list li i {
    width: 14px;
    height: 14px;
}

.stat-val {
    font-weight: 600;
}

.skills-list li {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.skill-info span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-info i {
    width: 12px;
    height: 12px;
}

.bar-track-small {
    width: 100%;
    height: 4px;
    background: var(--bg-dark);
    border-radius: 2px;
}

.bar-fill-gold {
    height: 100%;
    background: var(--accent-gold-dark);
    border-radius: 2px;
}

/* Center Panel */
.center-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-dark);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-panel);
}

.universe-indicator {
    display: flex;
    flex-direction: column;
    font-size: 11px;
}

.universe-indicator .label {
    color: var(--text-muted);
    letter-spacing: 1px;
}

.universe-indicator .val {
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.universe-indicator i {
    width: 12px;
    height: 12px;
    color: var(--accent-gold);
}

.main-tabs {
    display: flex;
    gap: 30px;
    height: 100%;
}

.tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    height: 100%;
    padding: 0 10px;
    transition: color 0.3s ease;
}

.tab:hover {
    color: var(--text-main);
}

.tab.active {
    color: var(--accent-gold);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-gold);
}

.header-actions {
    display: flex;
    gap: 15px;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold-dark);
}

.icon-btn i {
    width: 16px;
    height: 16px;
}

/* Story Area */
.story-container {
    flex-grow: 1;
    padding: 40px 60px;
    overflow-y: auto;
    max-width: 900px;
    margin: 0 auto;
}

.story-container::-webkit-scrollbar {
    width: 6px;
}

.story-container::-webkit-scrollbar-thumb {
    background-color: #2a2e3d;
    border-radius: 10px;
}

.chapter-title {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-size: 28px;
    font-weight: 400;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 40px;
}

.story-text p {
    font-size: 16px;
    line-height: 1.8;
    color: #cfd4df;
    margin-bottom: 20px;
}

.story-text .dialogue {
    color: #e57373;
    font-style: italic;
    padding-left: 20px;
    border-left: 2px solid #e57373;
}

.story-image {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    margin: 40px 0;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
}

/* Choices */
.choices-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 40px 0 20px;
}

.choices-divider .line {
    flex-grow: 1;
    height: 1px;
    background: var(--border-color);
}

.choices-divider span {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-size: 14px;
    letter-spacing: 2px;
}

.choice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 40px;
}

.choice-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-btn:hover {
    border-color: var(--accent-gold-dark);
    background: rgba(194, 157, 91, 0.05);
}

.choice-num {
    width: 24px;
    height: 24px;
    border: 1px solid var(--text-muted);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.choice-btn:hover .choice-num {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.choice-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.choice-text {
    flex-grow: 1;
}

.skill-tag {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
}

.skill-inv { color: #64b5f6; border-color: rgba(100, 181, 246, 0.3); }
.skill-per { color: #81c784; border-color: rgba(129, 199, 132, 0.3); }
.skill-occ { color: #ba68c8; border-color: rgba(186, 104, 200, 0.3); }
.skill-ste { color: #ffd54f; border-color: rgba(255, 213, 79, 0.3); }

/* Inventory */
.inventory-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.inventory-slots {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.inv-slot {
    width: 60px;
    height: 60px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: border-color 0.3s;
}

.inv-slot:hover:not(.empty):not(.locked) {
    border-color: var(--accent-gold);
}

.inv-slot i {
    color: #a0a8b8;
    width: 24px;
    height: 24px;
}

.inv-slot .count {
    position: absolute;
    bottom: 2px;
    right: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

.inv-slot.empty {
    border-style: dashed;
}

.inv-slot.locked {
    background: rgba(0,0,0,0.3);
    opacity: 0.5;
}

/* Modals & Overlays */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-box {
    background: var(--bg-panel);
    border: 1px solid var(--accent-gold-dark);
    padding: 30px;
    border-radius: 6px;
    max-width: 400px;
    text-align: center;
}

.modal-box h3 { color: var(--accent-gold); font-family: var(--font-heading); margin-bottom: 15px;}
.modal-box p { font-size: 13px; color: var(--text-muted); margin-bottom: 20px;}
.modal-box input { width: 100%; padding: 10px; margin-bottom: 20px; background: var(--bg-dark); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 4px; }
.modal-actions { display: flex; gap: 10px; justify-content: center;}

.secondary-btn { background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); padding: 8px 15px; border-radius: 4px; cursor: pointer; }
.secondary-btn:hover { border-color: var(--text-main); color: var(--text-main); }
.primary-btn { background: var(--accent-gold-dark); border: none; color: #fff; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.primary-btn:hover { background: var(--accent-gold); }

.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 12, 16, 0.9);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 9999;
}
.spinner {
    width: 50px; height: 50px;
    border: 3px solid rgba(194, 157, 91, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-gold);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-family: var(--font-heading); color: var(--accent-gold); letter-spacing: 2px; }

/* Right Sidebar Data */
.quest-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: rgba(255,255,255,0.02);
}

.gold-icon {
    color: var(--accent-gold);
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.quest-info h4 {
    font-size: 14px;
    font-family: var(--font-heading);
    color: var(--text-main);
    margin-bottom: 5px;
}

.quest-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.journal-list {
    list-style: none;
}

.journal-list li {
    font-size: 13px;
    color: var(--text-muted);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

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

.dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-gold);
    margin-top: 6px;
    flex-shrink: 0;
}

.time {
    margin-left: auto;
    font-size: 11px;
    color: #555;
    white-space: nowrap;
}

.rel-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.rel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    flex-shrink: 0;
}

.rel-info {
    flex-grow: 1;
}

.rel-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-main);
}

.rel-info p {
    font-size: 11px;
    margin: 3px 0 5px;
}

.ally { color: #81c784; }
.ally-fill { background: #81c784; }
.suspicious { color: #e57373; }
.enemy-fill { background: #e57373; }

.world-state-info {
    position: relative;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: rgba(255,255,255,0.02);
}

.world-state-info h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 5px;
}

.world-state-info p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.world-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    color: #cfd4df;
    opacity: 0.5;
}

