:root {
    --bg-dark: #1a1614; /* Dark wood/ink */
    --bg-panel: #2a2421; /* Rich mahogany */
    --bg-card: #f2e8d5; /* Parchment/rice paper */
    --text-main: #6b5443; /* Lighter brown for better contrast on parchment */
    --text-dark: #2b211b; /* Dark choco for light modals */
    --text-light: #e8dbce; /* Light parchment for dark backgrounds */
    --text-muted: #8b7355; /* Faded ink */
    --accent-primary: #b84b31; /* Cinnabar red */
    --accent-primary-dark: #8c3622;
    --accent-gold: #cfa862; /* Dull imperial gold */
    --accent-jade: #5c8a73; /* Muted jade green */
    --border-color: #d1bfae; /* Aged paper edge */
    --border-dark: #4a3c31; /* Wood carving edge */
    --nav-height: 70px;
    --header-height: 60px;
    --font-sans: 'Georgia', 'Times New Roman', serif; /* Classic serif fits cultivation better */
}

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

body {
    background-color: var(--bg-dark);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M10 10 Q 30 30 50 10 T 90 10" stroke="rgba(207,168,98,0.05)" fill="none" stroke-width="1"/></svg>'); /* Subtle cloud/wind pattern */
    color: var(--text-light);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3 {
    font-weight: normal;
    color: var(--accent-gold);
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    border-bottom: 1px solid var(--accent-gold);
    padding-bottom: 5px;
    display: inline-block;
}

p { margin-bottom: 10px; }

/* Utility */
.hidden { display: none !important; }

/* Buttons */
button {
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    border-radius: 4px; /* Squarer buttons for traditional feel */
    padding: 10px 20px;
    font-weight: bold;
    font-size: 0.95em;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.primary-btn {
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-primary-dark));
    color: #fff;
    border: 1px solid var(--accent-gold);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.primary-btn:hover { 
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    filter: brightness(1.1);
}

.secondary-btn {
    background-color: var(--bg-panel);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}
.secondary-btn:hover { 
    background-color: #38302c;
}

.danger-btn {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}
.danger-btn:hover { 
    background: rgba(184, 75, 49, 0.1);
}

.close-btn {
    background: transparent;
    color: var(--accent-gold);
    font-size: 28px;
    position: absolute;
    top: 10px;
    right: 15px;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-btn:hover { color: #fff; transform: rotate(90deg); transition: transform 0.3s; }

/* Custom Searchable Dropdown */
.custom-select {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}
.custom-select input {
    width: 100%;
    padding: 10px 15px;
    background: var(--bg-panel);
    color: var(--text-light);
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    font-size: 0.95em;
    outline: none;
    font-family: var(--font-sans);
}
.custom-select input:focus { border-color: var(--accent-primary); box-shadow: 0 0 5px rgba(184,75,49,0.5); }

.select-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0; right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    z-index: 1001;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.select-option {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9em;
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-light);
}
.select-option:last-child { border-bottom: none; }
.select-option:hover { background: var(--bg-dark); color: var(--accent-gold); }

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

/* SweetAlert-like overlay */
#swal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(2px);
}
#swal-overlay.show { display: flex; }
.swal-panel {
    background: var(--bg-card);
    color: var(--text-dark);
    border: 2px solid var(--accent-gold);
    outline: 2px solid var(--bg-panel);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    width: min(92vw, 420px);
    border-radius: 10px;
    padding: 22px 22px 16px 22px;
    position: relative;
}
.swal-title { color: var(--accent-primary-dark); margin: 0 0 8px 0; text-align: center; }
.swal-message { margin: 8px 0 16px 0; line-height: 1.6; }
.swal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Type accents */
#swal-overlay.error .swal-panel { border-color: var(--accent-primary); box-shadow: 0 20px 60px rgba(184,75,49,0.35); }
#swal-overlay.success .swal-panel { border-color: #6dbf6d; box-shadow: 0 20px 60px rgba(46,204,113,0.25); }
#swal-overlay.warn .swal-panel { border-color: #e1b12c; box-shadow: 0 20px 60px rgba(225,177,44,0.25); }

.modal-content {
    background: var(--bg-panel);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M0 100 L 100 0" stroke="rgba(207,168,98,0.05)" stroke-width="1"/></svg>');
    padding: 30px;
    border-radius: 8px;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 20px rgba(207,168,98,0.2), inset 0 0 20px rgba(0,0,0,0.8);
    max-width: 420px;
    width: 90%;
    position: relative;
    max-height: 85vh; /* Make any modal scrollable when tall */
    overflow-y: auto;
}

/* Tab Modal Specific Content */
.tab-modal-content {
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding-top: 40px;
    background-color: var(--bg-card); /* Scroll texture inside */
    color: var(--text-dark);
    border: 4px solid var(--bg-panel);
    outline: 2px solid var(--accent-gold);
}

.tab-modal-content h2 {
    color: var(--accent-primary-dark);
    border-bottom-color: var(--accent-primary-dark);
    text-shadow: none;
    text-align: center;
    display: block;
}

.tab-modal-content .close-btn {
    color: var(--accent-primary-dark);
    top: 5px; right: 10px;
}

.modal-content input[type="password"],
.modal-content input[type="text"],
.modal-content select {
    width: 100%;
    padding: 10px;
    margin: 5px 0 15px 0;
    background: rgba(0,0,0,0.2);
    color: var(--text-light);
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    outline: none;
    font-family: var(--font-sans);
}
.modal-content select { cursor: pointer; }

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

/* App Layout */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* Header (Game Status Bar) */
#top-bar {
    height: 80px;
    background: linear-gradient(to bottom, var(--bg-panel), var(--bg-dark));
    border-bottom: 2px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    padding: 10px 15px;
    position: relative;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.top-bar-ornament {
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, transparent, var(--accent-gold), transparent);
    opacity: 0.8;
}

/* Vitals (HP/MP/STM) */
.player-vitals {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 30%;
    max-width: 120px;
}
.vital-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65em;
    font-weight: bold;
    color: var(--accent-gold);
}
.vital-label {
    width: 25px;
    text-shadow: 1px 1px 1px #000;
}
.vital-bar-bg {
    flex: 1;
    height: 6px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    overflow: hidden;
}
.vital-bar {
    height: 100%;
    transition: width 0.3s ease;
}
.hp-bar { background: linear-gradient(to right, #8c2020, #e63946); }
.mp-bar { background: linear-gradient(to right, #1d3557, #457b9d); }
.stm-bar { background: linear-gradient(to right, #b58900, #f1c40f); }

/* Center World Info */
.world-info {
    text-align: center;
    flex: 1;
    padding: 0 10px;
}
.location-text {
    font-family: var(--font-sans);
    font-weight: bold;
    font-size: 1.05em;
    color: var(--text-light);
    text-shadow: 1px 1px 2px #000;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.realm-text {
    font-size: 0.75em;
    color: var(--accent-gold);
    opacity: 0.9;
}

/* Right Currencies */
.currency-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    width: 25%;
}
.coin-row {
    font-size: 0.85em;
    color: var(--text-light);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 1px 1px 1px #000;
}
.coin-icon {
    font-size: 1.1em;
}

/* Main Content Area */
#main-content {
    flex: 1;
    overflow-y: auto;
    background-color: #110e0d;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Story Tab Layout */
#tab-story {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

#story-log {
    flex: 1;
    overflow-y: auto;
    padding: 20px 15px 10px 15px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    background-image: url('data:image/svg+xml;utf8,<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path d="M50 100 Q 100 50 150 100 T 250 100" stroke="rgba(255,255,255,0.02)" fill="none" stroke-width="1"/></svg>');
}

/* Chat Bubbles / Scrolls */
.chat-bubble {
    padding: 18px 22px; /* Increased padding */
    border-radius: 4px; /* Square corners */
    max-width: 95%; /* Wider for more text */
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border: 1px solid transparent;
    line-height: 1.8; /* Improved readability */
    font-size: 1.05em; /* Slightly larger */
    word-wrap: break-word;
}

.narrative-bubble {
    background: linear-gradient(135deg, #2a2421, #1f1b18);
    color: var(--text-light);
    border-left: 3px solid var(--accent-gold);
    align-self: flex-start;
    border-right: 1px solid var(--border-dark);
    border-top: 1px solid var(--border-dark);
    border-bottom: 1px solid var(--border-dark);
    margin-bottom: 20px; /* Space between paragraphs */
}
.narrative-bubble b {
    color: var(--accent-gold); /* Make bold text pop */
}
.text-action {
    color: #e27d60; /* Brighter, more readable orange/coral */
    font-style: italic;
    font-family: var(--font-sans);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}
.text-dialogue {
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255,255,255,0.3);
}
.tab-modal-content .stat-row span:last-child,
.tab-modal-content .stat-value {
    color: var(--text-dark);
    text-shadow: none;
}
#bond-detail-modal .stat-row span:last-child { color: var(--text-light); text-shadow: 0 0 4px rgba(0,0,0,0.6); }
.bond-card .subtitle, .npc-subtitle { color: #d9c8b7; }
.text-system-block {
    display: block;
    color: var(--accent-gold);
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dark);
    padding: 8px;
    margin: 10px 0;
    border-radius: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

.action-bubble {
    background: transparent;
    color: var(--accent-primary);
    border: 1px dashed var(--accent-primary);
    align-self: flex-end;
    font-style: italic;
    font-weight: bold;
    padding: 10px 20px;
    margin-bottom: 15px;
    position: relative; /* for absolute edit button */
}

.edit-action-btn {
    display: none;
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--bg-panel);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 10;
    font-size: 14px;
}
.action-bubble:hover .edit-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}
.edit-action-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-panel);
}

.system-bubble {
    background: var(--bg-panel);
    color: var(--text-light);
    border-left: 3px solid var(--accent-primary);
    align-self: flex-start;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}
.system-bubble b { color: var(--accent-primary-dark); }

#action-area {
    padding: 10px 15px 15px 15px;
    background: linear-gradient(to top, var(--bg-dark), var(--bg-dark) 80%, transparent);
    border-top: 1px dashed var(--border-dark);
    position: fixed;
    bottom: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 90;
}

#loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--accent-gold);
    font-style: italic;
}
.danger-btn.small { padding: 6px 10px; font-size: 0.85em; }

#story-log {
    flex: 1;
    overflow-y: auto;
    padding: 20px 15px 250px 15px; /* Added massive bottom padding so story isn't hidden behind the fixed action area */
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    background-image: url('data:image/svg+xml;utf8,<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path d="M50 100 Q 100 50 150 100 T 250 100" stroke="rgba(255,255,255,0.02)" fill="none" stroke-width="1"/></svg>');
}
/* Custom Action Input */
#custom-action-input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-dark);
    color: var(--text-light);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.95em;
    transition: border-color 0.2s ease;
}
#custom-action-input:focus {
    border-color: var(--accent-gold);
    outline: none;
    box-shadow: 0 0 5px rgba(207,168,98,0.3);
}

.choices-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.choices-grid::-webkit-scrollbar { height: 6px; }
.choices-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 3px; }

/* Ensure buttons remain square and responsive in a single row */
.action-choice-btn {
    flex: 0 0 auto;
    width: clamp(44px, calc((100vw - 80px)/6), 64px);
    aspect-ratio: 1/1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-choice-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(to bottom, var(--bg-panel), #1f1b18);
    border: 2px solid var(--border-dark);
    border-radius: 4px; /* Square edges */
    color: var(--accent-gold);
    font-size: 1.4em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    cursor: pointer;
}
.action-choice-btn:hover {
    background: var(--accent-primary-dark);
    color: #fff;
    border-color: var(--accent-gold);
    box-shadow: inset 0 0 15px rgba(207,168,98,0.2), 0 4px 8px rgba(0,0,0,0.5);
    transform: translateY(-2px);
}

#loading-indicator {
    text-align: center;
    color: var(--accent-gold);
    padding: 10px;
    font-style: italic;
    letter-spacing: 2px;
    animation: breath 2s infinite;
}

@keyframes breath {
    0% { opacity: 0.5; }
    50% { opacity: 1; text-shadow: 0 0 10px var(--accent-gold); }
    100% { opacity: 0.5; }
}

/* Floating Bottom Navigation (Jade/Wood theme) */
#bottom-nav {
    height: var(--nav-height);
    background: linear-gradient(to right, #1f1b18, #2a2421, #1f1b18);
    border-top: 2px solid var(--border-dark);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 5px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.6);
}

.nav-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75em;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.nav-btn.active {
    color: var(--accent-gold);
}
.nav-btn.active .nav-icon { 
    color: var(--accent-gold); 
    text-shadow: 0 0 8px rgba(207,168,98,0.5);
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
    filter: grayscale(0.3) sepia(0.5);
}

.nav-btn:hover:not(.active) { color: var(--text-light); }

/* Extended Menu Modal */
.menu-modal-content {
    max-width: 320px;
    padding: 30px 20px;
    background: var(--bg-panel);
    border: 2px solid var(--accent-gold);
}
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.modal-nav-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s ease;
}
.modal-nav-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: #201a18;
}
.modal-nav-btn .nav-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

/* Grids & Cards (Parchment style) */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.card {
    background: transparent;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-primary-dark);
    border-radius: 2px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}
.card:hover {
    background: rgba(0,0,0,0.03);
    border-color: var(--accent-primary-dark);
    transform: translateX(3px);
}
.card-title {
    color: var(--accent-primary-dark);
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 2px;
}
.card-subtitle {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-bottom: 10px;
    font-style: italic;
}
.card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8em;
    margin-top: 10px;
}
.card-stats span {
    background: rgba(139, 115, 85, 0.1);
    padding: 2px 8px;
    border-radius: 2px;
    border: 1px solid rgba(139, 115, 85, 0.3);
    color: var(--text-main);
}

/* Status Panel */
.stat-group {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px dashed var(--border-color);
    position: relative;
}
.stat-group h3 {
    font-size: 0.9em;
    color: var(--accent-primary-dark);
    text-transform: uppercase;
    margin-bottom: 10px;
    border: none;
    position: absolute;
    top: -12px;
    left: 10px;
    background: var(--bg-card);
    padding: 0 5px;
}
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted rgba(0,0,0,0.1);
    font-size: 0.95em;
}
.stat-row:last-child { border-bottom: none; }
.stat-row span:first-child { color: var(--text-muted); }
.stat-row span:last-child { font-weight: bold; color: var(--text-main); }

/* Inventory Grid System */
.inventory-modal-content {
    max-width: 450px;
    padding-bottom: 10px;
}
.inventory-container {
    max-height: 60vh;
    overflow-y: visible; /* Changed from auto to allow tooltips to overflow */
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px inset var(--border-color);
    margin-bottom: 10px;
}
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    justify-content: center;
}
.inventory-slot {
    width: 60px;
    height: 60px;
    background: var(--bg-panel);
    border: 2px solid var(--border-dark);
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}
.inventory-slot:hover {
    border-color: var(--accent-gold);
    box-shadow: inset 0 0 15px rgba(207,168,98,0.2);
    z-index: 10; /* Bring slot to front when hovered */
}
.empty-slot {
    opacity: 0.5;
}
.has-item {
    background: radial-gradient(circle at center, #3a2e28, var(--bg-panel));
}
.item-icon {
    font-size: 28px;
    user-select: none;
}
.item-quantity {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.75em;
    color: #fff;
    text-shadow: 1px 1px 2px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    font-weight: bold;
    z-index: 2;
}
.item-tooltip {
    display: none; /* Disabled tooltip CSS entirely, moved to modal */
}
.tooltip-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 2px;
}
.tooltip-meta {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-style: italic;
}
.tooltip-desc {
    font-size: 0.85em;
    line-height: 1.3;
    margin-bottom: 6px;
}
.tooltip-value {
    font-size: 0.8em;
    color: var(--accent-gold);
    text-align: right;
    font-weight: bold;
}
.inventory-footer {
    display: flex;
    justify-content: space-between;
    padding: 5px 15px;
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
}

/* Settings */
.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* Profile Detail Modal */
.profile-content {
    max-width: 350px;
    padding: 0;
}
.profile-header {
    text-align: center;
    padding: 25px 20px 15px 20px;
    border-bottom: 2px solid var(--accent-gold);
    background: rgba(207, 168, 98, 0.1);
}
.profile-header h2 { border: none; margin-bottom: 5px; }
.profile-role { color: var(--accent-jade); font-style: italic; }
.profile-body { padding: 20px; }

/* Desktop overrides */
@media (min-width: 768px) {
    #app { max-width: 600px; margin: 0 auto; border-left: 2px solid var(--border-dark); border-right: 2px solid var(--border-dark); }
}
