body .story-simulator-container {
    display: flex !important;
    padding: 10px;
    direction: rtl;
}

body .story-simulator-container.layout-horizontal {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start;
    gap: 15px;
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body .story-simulator-container.layout-horizontal::-webkit-scrollbar {
    display: none;
}

.story-simulator-container.layout-vertical {
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.story-simulator-single-item-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: auto;
    flex-shrink: 0;
}

.story-simulator-item-wrapper:hover {
    transform: scale(1.05);
}

.story-simulator-username {
    font-size: 0.85em;
    color: #333;
    margin-top: 6px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

[dark="true"] .story-simulator-username {
    color: #ddd !important;
}

.story-simulator-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.92);
    color: white;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    align-items: center;
    justify-content: center;
}

.story-simulator-modal.story-visible {
    opacity: 1;
    display: flex;
}

.story-simulator-modal-content-wrapper {
    position: relative;
    padding: 15px;
    width: auto;
    max-width: 450px;
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #1c1c1c; 
    border-radius: 12px;
    overflow: visible; 
}

.story-simulator-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-simulator-content img,
.story-simulator-content video {
    max-width: 100%;
    max-height: calc(90vh - 100px); 
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.story-simulator-content video {
    min-width: 300px; 
}

.story-simulator-close-button {
    position: absolute;
    top: 10px;
    right: 15px; 
    color: #e0e0e0;
    font-size: 35px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 10005;
    cursor: pointer;
    line-height: 1;
}

.story-simulator-close-button:hover {
    color: #fff;
}

.story-simulator-external-link {
    display: none;
    position: absolute;
    bottom: -40px; 
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 18px;
    background-color: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9em;
    z-index: 10004;
    white-space: nowrap;
}

.story-simulator-external-link:hover {
    background-color: rgba(255,255,255,0.3);
}

.story-simulator-progress-bar-container {
    position: absolute;
    top: 10px; 
    left: 15px;
    right: 60px;
    height: 2.5px;
    display: flex;
    gap: 4px;
    z-index: 10001; 
}

.story-simulator-progress-bar {
    flex-grow: 1;
    background-color: rgba(255, 255, 255, 0.25);
    height: 100%;
    border-radius: 2px;
    overflow: hidden;
}

.story-simulator-progress-bar .story-simulator-progress {
    background-color: rgba(255, 255, 255, 0.9);
    height: 100%;
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 2px;
}

.story-simulator-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #2a2a2a; 
    color: white;
    border: none;
    cursor: pointer;
    z-index: 10002; 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    padding: 0; 
    transition: background-color 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); 
    display: flex;
    align-items: center; 
    justify-content: center; 
}

.story-simulator-prev {
    left: 15px; 
}

.story-simulator-next {
    right: 15px; 
}

.story-simulator-nav:hover {
    background-color: #383838; 
}

.story-simulator-nav:active {
    background-color: #1f1f1f; 
}

body.story-modal-open {
    overflow: hidden;
}

.story-simulator-container.layout-horizontal.is-dragging {
    cursor: grabbing;
    user-select: none;
}